xsd2wsdl — generates a WSDL document containing the types defined in an XML Schema document.
xsd2wsdl
[[-?] | [-help] | [-h]] [-t target-namespace
] [-n wsdl-name
] [-d output-directory
] [-o output-file
] [-v] [[-verbose] | [-quiet]] {xsdurl
}
xsd2wsdl imports an XML Schema document and generates a WSDL file containing a types
element populated by the types defined in the XML Schema document.
The arguments used to manage WSDL file generation are reviewed in the following table.
Option | Interpretation |
---|---|
-? | Displays the online help for this utility. |
-help | |
-h | |
-t | Specifies the target namespace for the generated WSDL. |
-n | Specifies the value of the generated definition element's name attribute. |
-d
output-directory
| Specifies the directory in which the generated WSDL is placed. |
-o
output-file
| Specifies the name of the generated WSDL file. |
-v | Displays the version number for the tool. |
-verbose | Displays comments during the code generation process. |
-quiet | Suppresses comments during the code generation process. |
xsdurl | The path and name of the existing XSDSchema file. |
The -t
target-namespace
and the xsdurl
arguments are required. All other arguments are optional and may be listed in any order.
To call this tool from Ant you execute the org.apache.cxf.tools.misc.XSDToWSDL
class.
Example 3 shows the java task to execute this command.
Example 3. Generating a WSDL from a Schema Using Ant
<java classname="org.apache.cxf.tools.misc.XSDToWSDL" fork="true"> <arg value="-t"/> <arg value="http://cxf.apache.org/demos"/> ... <arg value="MyXSD.xsd"/> <classpath> <path refid="fsf.classpath"/> </classpath> </java>