WAS v8.5 > Script the application serving environment (wsadmin) > Manage deployed applications using wsadmin.sh

Export WSDL and XSD documents using scripting

We 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.

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.

  1. Start the wsadmin scripting tool.

  2. Optional: View online help for the exportWSDLArtifacts command.

    Jython:

      print AdminTask.help('exportWSDLArtifacts')

    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.

    Jython:

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

    Jacl:

      $AdminTask exportWSDLArtifacts {-cuName composition_unit_name -exportDir C:/my_directory}

    exportWSDLArtifacts command elements. Run the exportWSDLArtifacts command with the two required parameters.

    Variable Description
    $ is a Jacl operator for substituting a variable name with its value
    AdminTask is an object to run administrative commands with wsadmin
    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:


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:

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.

Examine the exported files to ensure they contain the intended WSDL and XSD documents.

We can export WSDL and XSD documents using the dmgr console. See "Exporting WSDL and XSD documents."


Related concepts:

WSDL


Related


Example: Creating an SCA business-level application with scripting
Example: Creating an SCA business-level application with the console
Manage deployed applications using wsadmin.sh
Export WSDL and XSD documents


+

Search Tips   |   Advanced Search