Generating WSDL

Web service definition language (WSDL) is the XML file that stores the metadata used to describe your Web service, defines service endpoints, and publishes information about your Web service. WSDL helps automate the generation of client proxies for Web services in a language-and platform-independent way. Like the IDL file for CORBA, a WSDL file provides the framework for client and server communication.

StepsGenerating the WSDL

  1. From a project or Package Explorer, highlight the package that contains the Java file for which you are generating WSDL.

  2. Right click the file and select Generate WSDL.

  3. The Generate WSDL wizard displays. Table 4-7 describes the Generate WSDL properties. Complete the information and click next to move to the next window and Finish when done.

Table 4-7: Generating WSDL wizard options and properties

Window

Property

Description

General options

Web Service Name

The Web service for which you are generating WSDL.

Location URL

The location where the Web service is available.

Target Namespace

A valid Uniform Resource Identifier (URI) for the location where the WSDL document is published. The target namespace should not include the file name; WST appends the appropriate file name when the WSDL document is generated. The target namespace can be a Uniform Resource Name (URN), which is a globally unique and persistent URI.

http://www.com.sybase.webservices is an example of a valid URI.

urn:simpleJavaClass.test is an example of a valid URN.

Port Type Name

Describes a collection of operation elements that define the abstract interface of the Web service. The port type name provides a unique name among all port types defined within the WSDL document. For example:

<portType name="SimplePortType">

Binding Name

Contains the details of how the elements of the Port type name are converted to a concrete representation of the Web service by combining data formats and protocols:

<binding name="TestBinding"

Service Port Name

Indicates the Web service endpoint address. For example:

http://EAServer_1:8080/webservices/testPort or

testPort

Implementation Class

The name of the class file implementing the Web service.

Type Mapping Version

The type mapping version. Valid options are 1.1 (the default) and 1.2.

Soap Action

The URI for the SOAPAction HTTP header for the HTTP binding of SOAP. The SOAPAction HTTP request header field can be used to indicate the intent of the SOAP HTTP request. The URI identifies the intent.

Binding Style

The SOAP binding style:

  • Document – indicates that the SOAP body contains an XML document.

  • RPC (remote procedure call) – indicates that the SOAP body contains an XML representation of a method/operation call.

  • Wrapped – a document literal variation, that wraps parameters as children of the root element.

Soap uUse

The SOAP body use:

  • Literal – if using a document binding style.

  • Encoded – if using an RPC binding style.

Method Selection

Method nName

Select the methods/operations of the Web service for which the WSDL is to be generated.

Location

File Location

The location and file name (ending with .wsdl) of the generated WSDL file.

Summary

Summarizes your selections. Review and click Finish to generate the WSDL, or click Back to change any of your selections.