Export WSDL and XSD documents
We can export WSDL and XML schema definition (XSD) documents used by a Service Component Architecture (SCA) composition unit to a location of the choice.
Your SCA business-level application must contain one or more composition units that use a WSDL or XSD document.
A WSDL document is a file that provides a set of definitions that describe a web service in WSDL, an XML-based description language.
An XSD document is an instance of an XML schema written in the XML schema definition language. The document has the extension .xsd. The prefix xsd in the XML elements of an XSD document indicates the XML schema namespace.
We can export WSDL and XSD documents used by an SCA composition unit using the exportWSDLArtifacts command.
Run the exportWSDLArtifacts command to extract from a specified composition unit the WSDL and XSD files required for web services client development. The command extracts files for the services exposed by the web service binding, binding.ws.
- Start the wsadmin scripting tool.
- Optional: View online help for the exportWSDLArtifacts command.
Jython:
print AdminTask.help('exportWSDLArtifacts')
Using Jacl:
$AdminTask help exportWSDLArtifacts
- Export the WSDL and XSD documents to a location of your choice.
Use the exportWSDLArtifacts command to export the WSDL and XSD documents. The command has two required parameters, -cuName and -exportDir, both of type String.
Jython:
(dist)
AdminTask.exportWSDLArtifacts('[-cuName composition_unit_name -exportDir C:/my_directory]')
(zos)
AdminTask.exportWSDLArtifacts('[-cuName composition_unit_name -exportDir /my_directory]')
Using Jacl:
(dist)
$AdminTask exportWSDLArtifacts {-cuName composition_unit_name -exportDir C:/my_directory}
(zos)
$AdminTask exportWSDLArtifacts {-cuName composition_unit_name -exportDir /my_directory}
Variable Description $ is a Jacl operator for substituting a variable name with its value AdminTask is an object to run administrative commands with wsadmin.sh exportWSDLArtifacts is an AdminTask command composition_unit_name is the name of the composition unit whose WSDL or XSD documents are exported /my_directory is the absolute path of the directory to which the WSDL or XSD documents are exported
Results
After the exportWSDLArtifacts command runs, the following message displays in the command window:
'CWSAM0503I: WSDL Artifacts have been exported successfully.'
Example
Suppose to export WSDL or XSD documents in the HelloWorldAsync business-level application provided as a sample with the product. Run the following command in the Jython scripting language to export documents in the helloworldws composition unit: (dist)
AdminTask.exportWSDLArtifacts('[-cuName helloworldws -exportDir C:/my_directory]')
(zos)
AdminTask.exportWSDLArtifacts('[-cuName helloworldws -exportDir /my_directory]')
To run the command, the my_directory directory must exist on the computer.
Running the exportWSDLArtifacts command adds the helloworldws_WSDLArtifacts.zip file to the specified directory. The helloworldws_WSDLArtifacts.zip file has one WSDL file, AsynchTranslatorComponentTranslatorService_wsdlgen.wsdl.
What to do next
Examine the exported files to ensure that they contain the intended WSDL and XSD documents.
We can export WSDL and XSD documents using the console. See "Exporting WSDL and XSD documents".
Related concepts
WSDL
Related tasks
Example: Create an SCA business-level application Example: Create an SCA business-level application with the console Manage deployed applications Export WSDL and XSD documents