WSDL interfaces

The WSDL interface document defines the message format for operations and messages defined by a particular portType. You can generate a monolithic WSDL document that contains all WSDL elements, or a separate WSDL interface document.

The WSDL interface document contains the following top level elements:

portType.

An abstract set of one or more operations supported by one or more ports. Each operation defines an in and out message as well as an optional fault message. A port can support the following types of operations:

  • One way. The port receives an input message and no replies are expected.

  • Request-response. The port receives an input message then sends a correlated output message.

Message.

An abstract, typed definition of the data being communicated between the service requestor and service provider. A message can have one or more typed parts, however there are interoperability implications on the number of parts depending on RPC or Document, as defined by WS-I.

Type.

A container for data type definitions using some type system such as XSD.

The following WSDL interface document is based on the StockQuoteService Sample.

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="StockQuoteService" targetNamespace="http:///"
    xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http:///"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="getQuoteRequest">
        <part name="symbol" type="xsd:string"/>
    </message>
    <message name="getQuoteResponse">
        <part name="result" type="xsd:float"/>
    </message>
  <!--   This service interface file defines a single port  
-->
  <!--   type StockQuoteServiceJavaPortType                 
-->
  <!--   with only one operation getQuote.                  
-->
    <portType name="StockQuoteService">
    <!--   The operation makes use of two abstract messages  
-->
    <!--   getQuoteRequest and getQuoteResponse.             
-->
        <operation name="getQuote" parameterOrder="symbol">
            <input message="tns:getQuoteRequest"
name="getQuoteRequest"/>
            <output message="tns:getQuoteResponse"
name="getQuoteResponse"/>
        </operation>
    </portType>
</definitions>

 

Related Concepts

Web services overview
Web Services Description Language (WSDL)

Related Tasks
Developing Web services
Using the Web Services Explorer

Related Reference
Web Services Description Language (WSDL) reference
WSDL bindings
WSDL services
WSDL Java bindings
WSDL EJB binding document