WSDL

Web Services Description Language (WSDL) is an Extensible Markup Language (XML)-based description language. This language was submitted to the World-Wide Web Consortium (W3C) as the industry standard for describing Web services. The power of WSDL is derived from two main architectural principles: the ability to describe a set of business operations and the ability to separate the description into two basic units. These units are a description of the operations and the details of how the operation and the information associated with it are packaged.

A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definitions of endpoints and messages are separated from their concrete network deployment or data format bindings. This separation supports the reuse of abstract definitions: messages, which are abstract descriptions of exchanged data, and port types, which are abstract collections of operations. The concrete protocol and data format specifications for a particular port type constitutes a reusable binding. A port is defined by associating a network address with a reusable binding, and a collection of ports defines a service. Therefore, a WSDL document is composed of several elements.

The following is the structure of the information in a WSDL file:Anatomy of a WSDL file

A WSDL file contains the following parts:

A WSDL file describes a Web service with the following elements:

portType

The description of the operations and associated messages. The portType element defines abstract operations.

<portType name="EightBall">
	<operation name="getAnswer">
		<input message="ebs:IngetAnswerRequest"/>
		<output message="ebs:OutgetAnswerResponse"/>
	</operation>
</portType>

message

The description of input and output parameters and return values.

<message name="IngetAnswerRequest">
	<part name="meth1_inType" type="ebs:questionType"/>
</message>
<message name="OutgetAnswerResponse">
	<part name="meth1_outType" type="ebs:answerType"/>
</message>
		

types

The schema for describing XML types used in the messages.

<types>
	<xsd:schema targetNamespace="...">
		<xsd:complexType name="questionType">
			<xsd:element name="question" type="string"/>
		</xsd:complexType>
		<xsd:complexType name="answerType">
		...
</types>

binding

The bindings describe the protocol that is used to access a portType, as well as the data formats for the messages that are defined by a particular portType element.

<binding name="EightBallBinding" type="ebs:EightBall">
	<soap:binding style="rpc" transport="schemas.xmlsoap.org/soap/http">
	<operation name="ebs:getAnswer">
	<soap:operation soapAction="urn:EightBall"/>
		<input>
			<soap:body namespace="urn:EightBall" ... />
		...

Service

The services and ports define the location of the Web service.

The service contains the Web service name and a list of ports.

Ports

The ports contain the location of the Web service and the binding used for service access.
<service name="EightBall">
	<port binding="ebs:EightBallBinding" name="EightBallPort">
		<soap:address location="localhost:8080/axis/EightBall"/>
	</port>
</service>
	

When creating JAX-RPC Web services for this product, you must first have an implementation bean that includes a service endpoint interface. Then, you use the Java2WSDL command-line tool to create a WSDL file that defines the Web services. This is a bottom-up development.

If you are starting with the WSDL to generate the implementation bean class, it is a top-down development. Run the WSDL2Java command line tool against the WSDL file to create Java APIs and deployment descriptor templates.

Multipart WSDL and WSDL publication

The product supports deployment of Web services using a multipart Web Services Description Language (WSDL) file. In multipart WSDL files, an implementation WSDL file contains the wsdl:service. This implementation WSDL file imports an interface WSDL file, which contains the other WSDL constructs. This supports multiple Web services using the same WSDL interface definition.

The <wsdl:import> element indicates a reference to another WSDL file. If the <wsdl:import> element location attribute does not contain a URL, that is, it contains only a file name, and does not begin with http://, https:// or file://, the imported file must be located in the same directory and must not contain a relative path component. For example, if META-INF/wsdl/A_Impl.wsdl is in your module and contains the <wsdl:import="A.wsdl" namespace="..."/> import statement, the A.wsdl file must also be located in the module META-INF/wsdl directory.

It is recommended that you place all WSDL files in either the META-INF/wsdl directory, if you are using Enterprise JavaBeans (EJB), or the WEB-INF/wsdl directory, if you are using JavaBeans components, even if relative imports are located within the WSDL files. Otherwise, implications exist with the WSDL publication when you use a path like <location="../interfaces/A_Interface.wsdl"namespace="..."/>. Using a path like this example fails because the presence of the relative path, regardless of whether the file is located at that path or not. If the location is a Web address, it must be readable at both deployment and server startup.

You can publish the files located in the META-INF/wsdl or the WEB-INF/wsdl directory through either a URL address or file, including WSDL or XML Schema Definition (XSD) files. For example, if the file referenced in the <wsdl-file> element of the webservices.xml deployment descriptor is located in the META-INF/wsdl or the WEB-INF/wsdl directory, it is publishable. If the files imported by the <wsdl-file> are located in the wsdl/ directory or its subdirectory, they are publishable.

If the WSDL file referenced by the <wsdl-file> element is located in a directory other than wsdl, or its subdirectories, the file and its imported files, either WSDL or XSD files, which are in the same directory, are copied to the wsdl directory without modification when the application is installed. These types of files can also be published.

If the <wsdl-file> imports a file located in a different directory (a directory that is not -INF/wsdl or a subdirectory), the file is not copied to the wsdl directory and not available for publishing.




Related tasks
Developing a WSDL file for JAX-RPC applications
Making deployed Web services application available to clients
Related reference
Web services: Resources for learning
Java2WSDL command for JAX-RPC applications
WSDL2Java command for JAX-RPC applications
Related information
Web Services Description Language (WSDL) 1.1
Concept topic    

Terms of Use | Feedback

Last updated: Aug 29, 2010 10:43:27 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v602web&product=was-nd-mp&topic=cwbs_wsdl
File name: cwbs_wsdl.html