cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Manson <dev.mansontho...@gmail.com>
Subject [Urgent] Webservice Client generation fail with CXF (non-WSI compliant WSDL : Non-unique body parts!)
Date Thu, 03 May 2012 15:24:18 GMT
Hi,

  I'm trying to call webservice from TIBCO's AMXBPM product with CXF. (It's
a propriatary BPM product)

  I can generate the webservice client with WSIMPORT of the JDK without
error. (see end of mail for example), but we would rather use CXF as we use
it for all other webservice client call.
  And although it's easier to use.

  It's very urgent as our project deadline are deadly close....


 When I try with CXF, i get the following error  (see at the end of the
mail for the full pom):

 *Non-unique body parts! In a port, operations must have unique operation
signatures on the wire for successful dispatching.*

(see full log at the end)

for the following WSDL :


   - wp.wsdl
   - processManagement.wsdl


(for de.wsdl, the -autoNameResolution helps to generate a working client,
but it's not enough for the wp.wsdl and processManagement.wsdl)

It seems that that the issue is related to WS-I standard, that the wsdl is
not compliant with it.

we tryed to use XJC plugin with wsdlextension (as -extension was mandatory
for wsimport to generate the client), but it's not working.

Any idea of how to generate the client from the wsdl ?
preferably without modifying the wsdl or we will some support issues with
TIBCO's support.
or if we can't do anything, what should we modify in the wsdl (+xsd?) so
that it works ?

Or is it possible to use the client generated by wsimport with CXF (I feel
it's a silly question as I think CXF is meant to replace wsimport, but
anyway, it won't kill me to ask ;))


Regards,
Thomas.



If you want to give a try, you can find the wsdl + wsd here :

https://docs.tibco.com/pub/activematrix_bpm/1.3.0_march_2012/doc/html2/BPM%20Developer%27s%20Guide/public_api/public_api.zip

failing wsdl are :


   - wp.wsdl
   - processManagement.wsdl







*Logs of CXF webservice client generation : *

wp.wsdl
*
#################################################################################
*
[DEBUG] Calling wsdl2java with args: [-d,
D:\myproject\repo\ws\module-bpm-ws-client\src\generated\java, -b,
file:/D:/myproject/repo/ws/module-bpm-ws-client/src/main/resources/xjb/wp.xjb,
-verbose,
file:/D:/myproject/repo/ws/module-bpm-ws-client/src/main/resources/wsdl/wp.wsdl]
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d D:\myproject\repo\ws\module-bpm-ws-client\src\generated\java
-b
file:/D:/myproject/repo/ws/module-bpm-ws-client/src/main/resources/xjb/wp.xjb
-verbose
file:/D:/myproject/repo/ws/module-bpm-ws-client/src/main/resources/wsdl/wp.wsdl
wsdl2java - Apache CXF 2.5.2

[DEBUG]
org.apache.cxf.tools.common.ToolException: Non-unique body parts! In a
port, operations must have unique operation signatures on the wire for
successful dispatching. In port
{http://services.wp.n2.tibco.com}WorkPresentationService_EP,
operations "{http://services.wp.n2.tibco.com}closeWorkItem" and "{
http://services.wp.n2.tibco.com}reOfferWorkItem" have the same request body
block {http://api.wp.n2.tibco.com}workRequest

     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContainer.java:603)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:249)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
     at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:212)
     at
org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:216)
     at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:289)
     at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
     at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
     at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Non-unique body parts! In a port, operations must have unique
operation signatures on the wire for successful dispatching. In port {
http://services.wp.n2.tibco.com}WorkPresentationService_EP, operations "{
http://services.wp.n2.tibco.com}closeWorkItem" and "{
http://services.wp.n2.tibco.com}reOfferWorkItem" have the same request body
block {http://api.wp.n2.tibco.com}workRequest


[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Non-unique body
parts! In a port, operations must have unique operation signatures on the
wire for successful dispatching. In port
{http://services.wp.n2.tibco.com}WorkPresentationService_EP,
operations "{http://services.wp.n2.tibco.com}closeWorkItem" and "{
http://services.wp.n2.tibco.com}reOfferWorkItem" have the same request body
block {http://api.wp.n2.tibco.com}workRequest

     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
     at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
     at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Non-unique body
parts! In a port, operations must have unique operation signatures on the
wire for successful dispatching. In port
{http://services.wp.n2.tibco.com}WorkPresentationService_EP,
operations "{http://services.wp.n2.tibco.com}closeWorkItem" and "{
http://services.wp.n2.tibco.com}reOfferWorkItem" have the same request body
block {http://api.wp.n2.tibco.com}workRequest

     at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:215)
     at
org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:216)
     at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:289)
     at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
     at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
     ... 17 more
Caused by: org.apache.cxf.tools.common.ToolException: Non-unique body
parts! In a port, operations must have unique operation signatures on the
wire for successful dispatching. In port
{http://services.wp.n2.tibco.com}WorkPresentationService_EP,
operations "{http://services.wp.n2.tibco.com}closeWorkItem" and "{
http://services.wp.n2.tibco.com}reOfferWorkItem" have the same request body
block {http://api.wp.n2.tibco.com}workRequest

     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContainer.java:603)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:249)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
     at
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:212)
     ... 21 more
*
#################################################################################
*


*pom.xml:*
*
#################################################################################
*
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>myproject</artifactId>
    <groupId>com.mansonthomodule.test.myproject</groupId>
    <version>0.0.1.3</version>
  </parent>

  <artifactId>module-bpm-ws-client</artifactId>
  <version>0.0.1.1-SNAPSHOT</version>
  <name>Projet générant les clients des Web Services de Tibco BPM</name>
  <description>Les classes Java sont générées à partir des fichiers wsdl
fournis par Tibco.</description>

  <scm>
    <connection>scm:svn:
http://subversion.myproject.test.mansonthomas.com/module-bpm-ws-client/trunk
</connection>
    <developerConnection>scm:svn:
http://subversion.myproject.test.mansonthomas.com/module-bpm-ws-client/trunk
</developerConnection>
    <url>
http://subversion.myproject.test.mansonthomas.com/module-bpm-ws-client/trunk
</url>
  </scm>

  <distributionManagement>
    <site>
      <id>maven.myproject.fr</id>
      <name>maven.myproject.fr</name>
      <url>scp://
maven.myproject.test.mansonthomas.com/var/www/maven/${project.artifactId}/${project.version}
</url>
    </site>
  </distributionManagement>

  <!--dependencies> <dependency> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
    </dependency> <dependency> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
    </dependency> </dependencies -->

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/generated/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Création du jar contenant les sources -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin-version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>genwsclient</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-sources__wsdl2java</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>wsdl2java</goal>
                </goals>
                <configuration>
                  <sourceRoot>${basedir}/src/generated/java</sourceRoot>
                  <includes>
                    <!--include>brm.wsdl</include>
<include>busserv.wsdl</include>
                      <include>dac.wsdl</include>
<include>ec.wsdl</include> <include>pflow.wsdl</include -->
                    <include>wp.wsdl</include>
                    <include>processManagement.wsdl</include>
                    <!--include>de.wsdl</include -->
                  </includes>
                  <wsdlOptions>
                    <!--wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/brm.wsdl</wsdl>
                      <bindingFiles>
<bindingFile>${basedir}/src/main/resources/xjb/brm.xjb</bindingFile>
                      </bindingFiles> </wsdlOption> <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/busserv.wsdl</wsdl>
                      <bindingFiles>
<bindingFile>${basedir}/src/main/resources/xjb/busserv.xjb</bindingFile>
                      </bindingFiles> </wsdlOption> <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/dac.wsdl</wsdl>
                      <bindingFiles>
<bindingFile>${basedir}/src/main/resources/xjb/dac.xjb</bindingFile>
                      </bindingFiles> </wsdlOption> <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/ec.wsdl</wsdl>
                      <bindingFiles>
<bindingFile>${basedir}/src/main/resources/xjb/ec.xjb</bindingFile>
                      </bindingFiles> </wsdlOption> <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/pflow.wsdl</wsdl>
                      <bindingFiles>
<bindingFile>${basedir}/src/main/resources/xjb/pflow.xjb</bindingFile>
                      </bindingFiles> </wsdlOption -->
                    <wsdlOption>

<wsdl>${basedir}/src/main/resources/wsdl/wp.wsdl</wsdl>
                      <extraargs>
                        <extraarg>-xjc-Xwsdlextension</extraarg>
                        <extraarg>-xjc-Xts</extraarg>
                      </extraargs>
                      <bindingFiles>

<bindingFile>${basedir}/src/main/resources/xjb/wp.xjb</bindingFile>
                      </bindingFiles>
                    </wsdlOption>
                    <wsdlOption>

<wsdl>${basedir}/src/main/resources/wsdl/processManagement.wsdl</wsdl>
                      <extraargs>
                        <extraarg>-xjc-Xwsdlextension</extraarg>
                        <extraarg>-xjc-Xts</extraarg>
                      </extraargs>
                      <bindingFiles>

<bindingFile>${basedir}/src/main/resources/xjb/processManagement.xjb</bindingFile>
                      </bindingFiles>
                    </wsdlOption>
                    <!--wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/de.wsdl</wsdl>
                      <extraargs> <extraarg>-autoNameResolution</extraarg>
</extraargs> <bindingFiles>

<bindingFile>${basedir}/src/main/resources/xjb/de.xjb</bindingFile>
</bindingFiles>
                      </wsdlOption -->
                  </wsdlOptions>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-ts</artifactId>
                <version>2.2.12</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf.xjcplugins</groupId>
                <artifactId>cxf-xjc-wsdlextension</artifactId>
                <version>2.6.0</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>includesrc</id>
      <build>
        <resources>
          <resource>
            <directory>${basedir}/src/generated/</directory>
          </resource>
          <resource>
            <directory>src/main/resources</directory>
          </resource>
        </resources>
      </build>
    </profile>
  </profiles>
</project>
*
#################################################################################
*



*
JDK wsimport  that successfully generate the client : *
*
#################################################################################
*
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension brm.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension busserv.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension dac.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension de.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension ec.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension pflow.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension processManagement.wsdl
C:\dev\jdk1.6.0_25\bin\wsimport.exe -d c:\temp\classes -s c:\temp\sources
-verbose -keep -extension wp.wsdl
*
#################################################################################
*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message