Mapping the portType to a web service interface
The .NET framework uses the portType and binding in the WSDL document to create the web service interface. The web service interface specifies the input and output messages of the request-response pairs for an operation and the service name and port.
The following WSDL code shows the specification of the input and output messages, Login and LoginResponse, and the binding of this request-response pair to the login operation:
<wsdl:portType name="ActuateSoapPort">
<wsdl:operation name="login">
<wsdl:input message="tns:Login" />
<wsdl:output message="tns:LoginResponse" />
</wsdl:operation>
The following WSDL code shows the specification of the service and port names and the binding of the port to a machine address:
<wsdl:binding name="ActuateSoapBinding" type="tns:ActuateSoapPort">
<soap:binding transport="http://schemas.xmlsoap.org/soap
/http" style="document" />
</wsdl:binding>
<wsdl:service name="ActuateAPI">
<wsdl:port name="ActuateSoapPort"
binding="tns:ActuateSoapBinding">
<soap:address location="http://ENL2509:8000" />
</wsdl:port>
</wsdl:service>
An application uses this information to construct an interface to access the operations available from the service using a remote procedure call (RPC). In the following code example, taken from ActuateAPI class, the client application performs the following tasks:
*Sets up the SOAP message.
*The remote procedure call, login( ), submits a request, passing a Login object as a parameter and returns a LoginResponse object in response from the BIRT iHub defined by ActuateSoapPort in the web service interface.
[System.Web.Services.Protocols.SoapHeaderAttribute
("HeaderValue")]