> 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 ;))

A wsimport generated client should certainly work with CXF with the same 
caveats that it mentions about relying on the SOAPAction.     At this point, 
that may be your best option.   The WSDL is certainly not WSI-BasicProfile 
compliant.  :-(

There isn't a way to turn off the very basic WSI-BP validation that CXF does 
at this point.   You COULD edit the wsdl to add a wsam:Action="...." type 
thing to each wsd:input in the portType.   That would allow the code 
generation to at least complete.  Use the value of the SOAPAction from the 
binding for it.

xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata";



Dan





On Thursday, May 03, 2012 05:24:18 PM Thomas Manson wrote:
> 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(WSDLToJavaContain
> er.java:603) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCont
> ainer.java:249) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:138) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:286) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:10
> 3) 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(AbstractCodegenMoh
> o.java:216) at
> org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.
> java:289) at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMana
> ger.java:490) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLi
> fecycleExecutor.java:694) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecyc
> le(DefaultLifecycleExecutor.java:556) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLif
> ecycleExecutor.java:535) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFa
> ilures(DefaultLifecycleExecutor.java:387) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(De
> faultLifecycleExecutor.java:348) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecyc
> leExecutor.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(DelegatingMethodAccessorIm
> pl.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(DefaultLi
> fecycleExecutor.java:719) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecyc
> le(DefaultLifecycleExecutor.java:556) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLif
> ecycleExecutor.java:535) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFa
> ilures(DefaultLifecycleExecutor.java:387) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(De
> faultLifecycleExecutor.java:348) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecyc
> leExecutor.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(DelegatingMethodAccessorIm
> pl.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(AbstractCodegenMoh
> o.java:216) at
> org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.
> java:289) at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMana
> ger.java:490) at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLi
> fecycleExecutor.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(WSDLToJavaContain
> er.java:603) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCont
> ainer.java:249) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:138) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:286) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:10
> 3) 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/tru
> nk </connection>
>     <developerConnection>scm:svn:
> http://subversion.myproject.test.mansonthomas.com/module-bpm-ws-client/tru
> nk </developerConnection>
>     <url>
> http://subversion.myproject.test.mansonthomas.com/module-bpm-ws-client/tru
> nk </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</bind
> ingFile> </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
> *
> ##########################################################################
> ####### *
-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to