Exporting WSDL and XSD documents using scripting

You can export Web Services Description Language (WSDL) and XML schema definition (XSD) documents used by a Service Component Architecture (SCA) composition unit to a location of your choice.

Before you begin

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 Extensible Markup Language (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.

About this task

You 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 that are required for web services client development. The command extracts files for the services exposed by the web service binding, binding.ws.

Procedure

  1. Start the wsadmin scripting tool.
  2. Optional: View online help for the exportWSDLArtifacts command.
    Using Jython:
    print AdminTask.help('exportWSDLArtifacts')
    Using Jacl:
    $AdminTask help exportWSDLArtifacts
  3. 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.

    Using Jython:

    AdminTask.exportWSDLArtifacts('[-cuName composition_unit_name -exportDir C:/my_directory]')

    Using Jacl:

    $AdminTask exportWSDLArtifacts {-cuName composition_unit_name -exportDir C:/my_directory}
    Table 1. exportWSDLArtifacts command elements. Run the exportWSDLArtifacts command with the two required parameters.
    $ is a Jacl operator for substituting a variable name with its value
    AdminTask is an object to run administrative commands with the wsadmin tool
    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 you want 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:

AdminTask.exportWSDLArtifacts('[-cuName helloworldws -exportDir C:/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.

You can export WSDL and XSD documents using the administrative console. See "Exporting WSDL and XSD documents."




In this information ...


Related concepts

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms of Use | Feedback

Last updatedLast updated: Sep 19, 2011 4:16:02 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-base-dist&topic=tsca_export_wsdl_scripting
File name: tsca_export_wsdl_scripting.html