WSDL anatomy

WSDL files are written in XML. To learn more about XML, see Web services: Resources for learning.

A WSDL contains the following parts...

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



The description of the operations and their associated messages. PortTypes define abstract operations

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



The description of parameters (input and output) and return values

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



The schema for describing XML complex types used in the messages

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



Bindings describe the protocol used to access a service, as well as the data formats for the messages defined by a particular portType

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

The remaining parts, services and ports, indicate where you can find the WSDL.



Contains the Web service name and a list of the ports.



Contains the location of the Web service and the binding to used to access the service.

<service name="EightBall">
    <port binding="ebs:EightBallBinding" name="EightBallPort">
        <soap:address location="localhost:8080/axis/EightBall"/>