Share via


PortType Element

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

The <portType> element in a Web Services Description Language (WSDL) file identifies a set of operations and the messages involved with each operation.

The following code example of the Calc.wsdl file shows the <portType> element named CalcSoapPort.

In this WSDL file, there is only one <portType> element. However, other files might include multiple <portType> elements, each of which describes a specific set of operations and associated messages.

<portType name='CalcSoapPort'>
    <operation name='Multiply' parameterOrder='A B'>
      <input message='wsdlns:Calc.Multiply' />
      <output message='wsdlns:Calc.MultiplyResponse' />
    </operation>
    <operation name='Divide' parameterOrder='A B'>
      <input message='wsdlns:Calc.Divide' />
      <output message='wsdlns:Calc.DivideResponse' />
    </operation>
    <operation name='Subtract' parameterOrder='A B'>
      <input message='wsdlns:Calc.Subtract' />
      <output message='wsdlns:Calc.SubtractResponse' />
    </operation>
    <operation name='Add' parameterOrder='A B'>
      <input message='wsdlns:Calc.Add' />
      <output message='wsdlns:Calc.AddResponse' />
    </operation>
  </portType>

The CalcSoapPort element has four <operation> child elements, each of which describes an operation.

The name attribute of the <operation> element identifies the various operations: Multiply, Divide, Subtract, and Add.

All of these operations are request-response operations in which the <input> element specifies the message format for the request and the <output> element specifies the message format for the response.

Each <input> and <output> element has an optional name attribute that identifies that message. In this sample, this name attribute is missing. These names must be unique among all <input> and <output> elements within the enclosing <portType>.

See Also

Concepts

About the Calc.wsdl File
Types Element
Message Element
Binding Element
Service Element