While SCDJWS 5.0 objectives specify WSDL 2.0 specification version, the exam questions are still based on the WSDL 1.1 specification.
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:
A WSDL file contains the following parts:
Web service interface definition (Abstract part)
This part contains the elements and the namespaces.
Describes the messages it sends and receives.
Describes the operation associates a message exchange pattern with one or more messages.
Web service implementation (Concrete part)
This part contains the definition of the service and ports.
Specifies transport and wire format details for one or more interfaces.
Specifies a port (an endpoint) associates a network address with a binding.
Specifies a service which groups together endpoints that implement a common interface.
A WSDL file describes a Web Service with the following elements:
The description of the operations and associated messages (interface). The portType element defines abstract operations:
The operation can receive a message but will not return a response.
The operation can receive a request and will return a response.
The operation can send a request and will wait for a response.
The operation can send a message but will not wait for a response.
<portType name="procurementPortType"> <operation name="orderGoods"> <input message = "OrderMsg"/> </operation> </portType>
The description of input and output parameters and return values.
<message name="OrderMsg"> <part name="productName" type="xs:string"/> <part name="quantity" type="xs:integer"/> </message>
The schema for describing XML types used in the messages.
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 attributes are:
name any name
type - points to the port type defined in the abstract part
soap:binding attributes are:
style - "rpc" | "document"
transport - Communication protocol : SOAP, Transport protocol : HTTP/SMTP
defines each operation that the port exposes.
must also specify how the input and output are encoded : literal | encoded
<binding name="ProcurementSoapBinding" type="tns:procurementPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="orderGoods"> <soap:operation soapAction="http://example.com/orderGoods"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding>
The services and ports define the location of the Web Service.
The service contains the Web Service name and a list of ports.
<service name="ProcurementService"> <port name="ProcurementPort" binding="tns:ProcurementSoapBinding"> <soap:address location="http://example.com/procurement"/> </port> </service>
The port contain the location of the Web Service and the binding used for service access.
<port name="ProcurementPort" binding="tns:ProcurementSoapBinding"> <soap:address location="http://example.com/procurement"/> </port>