|
Page Edited :
CXF20DOC :
WSDL to Java
WSDL to Java has been edited by maomaode (Jul 06, 2007). Content:Synopsiswsdl2java [[-?]|[-help]|[-h]] [-fe <frontend name>] [-db <data binding name>] [-wv <wsdl version>]
[-p [[wsdl-namespace=] PackageName ] ...]
[-b <binding-name>] [-d <output-directory>] [-compile]
[-classdir <compile-class-dir>] [-client] [-server] [-impl] [-all] [-ant] [-nexclude [schema-namespace[=java-packagename]] ...]
[-exsh (true/false)] [-dns(true/false)] [-dex (true/false)] [-validate] [-v] [[-verbose]|[-quiet]] {wsdlfile}
You must specify the absolute or relative path to the WSDL document as the last argument. JAXWS CustomizationBy default, the frontend we used in CXF wsdl2java tool is JAXWS frontend, in JAXWS case, it allow us to customize the WSDL to Java mapping through the customization binding file, in samples/hello_world_async, you can see there is a wsdl/async_binding.xml binding file , which will be loaded by the tool and generate the extra async methods in the SEI. Q: What if I want to change the generated SEI name? A: We don't have an option to do this, but you can have a binding file like the following snippet to achieve this goal <bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="hello_world.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions/wsdl:portType">
<class name="GreeterSEI"/>
</bindings>
</bindings>
Q: I had the binding file, how to pass this file to the wsdl2java A: If you are using the command line tool, you can do this wsdl2java HelloWorld.wsdl -b my_binding.xml If you are using the CXF ant wsdl2java macro, you can do this <wsdl2java file="hello_world.wsdl" bindingfile="${basedir}/wsdl/my_binding.xml"/>
If you are using the CXF Maven2 codegen-plugin, you should do this <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>2.0-incubator-RC-SNAPSHOT</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${YOUR_WSDL_PATH}/myService.wsdl</wsdl> <extraargs> <extraarg>-b</extraarg> <extraarg>${YOUR_BINDING_FILE_PATH}/my_binding.xml</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> Q: What else can I change with the JAXWS customization binding file? A: You can find the full list of the customization items in the JAXWS Specification Chapter8 |
Unsubscribe or edit your notifications preferences
