The portType element describes a set of abstract operations and the abstract message that is involved in the operation.
The name attribute of the portType element is used for defining a unique name among all the port types that can be defined within the WSDL 1.1 document.
WSDL 1.1 Operation element
The operation element is used for describing a specific operation.
The name attribute of the operation element is used for defining a name for an operation.
The following is an example of the operation element in a WSDL 1.1 file.
<wsdl:portType name = "WSDemoPortType"> <wsdl:operation name = "helloWorld"> <wsdl:input message = "ns:helloWorldRequest" wsaw:Action = "urn:helloWorld"/> <wsdl:output message = "ns:helloWorldResponse" wsaw:Action = "urn:helloWorldResponse"/> </wsdl:operation> </wsdl:portType>
WSDL 1.1 has four primitive types of operations:
- One-way: the endpoint receives a message. So the operation only has a single input element.
<wsdl:portType name = "WSDemoPortType"> <wsdl:operation name = "helloWorld"> <wsdl:input message = "ns:helloWorldRequest" wsaw:Action = "urn:HelloWorld"/> </wsdl:operation> </wsdl:portType>
- Request-response: the endpoint receives a message, and sends a correlated message. So the operation has one input element followed by one output element.
<wsdl:portType name = "WSDemoPortType"> <wsdl:operation name = "helloWorld"> <wsdl:input message = "ns:helloWorldRequest" wsaw:Action = "urn:helloWorld"/> <wsdl:output message = "ns:helloWorldResponse" wsaw:Action = "urn:helloWorldResponse"/> </wsdl:operation> </wsdl:portType>
- Solicit-response: the endpoint sends a message, and receives a correlated message. So the operation has one output element followed by one input element.
<wsdl:portType name = "WSDemoPortType"> <wsdl:operation name = "helloWorld"> <wsdl:output message = "ns:helloWorldResponse" wsaw:Action = "urn:helloWorldResponse"/> <wsdl:input message = "ns:helloWorldRequest" wsaw:Action = "urn:helloWorld"/> </wsdl:operation> </wsdl:portType>
- Notification: the endpoint sends a message. So the operation only has a single output element.
<wsdl:portType name = "WSDemoPortType"> <wsdl:operation name = "helloWorld"> <wsdl:output message = "ns:helloWorldResponse" wsaw:Action = "urn:helloWorldResponse"/> </wsdl:operation> </wsdl:portType>