WSDL files are written in XML. To learn more about XML, see Web services: Resources for learning.
A WSDL contains the following parts...
- Web service interface definition
This is where the elements are contained, as well as the namespaces.
- Web service implementation
This is where you find the definition of the service and ports.
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"/> </operation> </portType>
The description of parameters (input and output) 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>
The schema for describing XML complex 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>
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="schemas.xmlsoap.org/soap/http"> <operation name="ebs:getAnswer"> <soap:operation soapAction="urn:EightBall"/> <input> <soap:body namespace="urn:EightBall" ... /> ...
The remaining parts, services and ports, indicate where you can find the WSDL.
ServiceContains the Web service name and a list of the ports.
PortsContains 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"/> </port> </service>