Mapping the portType to a Service Definition Interface
WSDL2Java uses the portType and binding in the WSDL document to create the Service Definition Interface (SDI). The Service Definition 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:
<portType name="ActuateSoapPort">
<operation name="login">
<input message="wsdlns:Login"/>
<output message="wsdlns:LoginResponse"/>
</operation>
</portType>
<binding name="ActuateSoapBinding" type="wsdlns:ActuateSoapPort">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="login">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" parts="Request"/>
</input>
<output>
<soap:body use="literal" parts="Response"/>
</output>
</operation>
</binding>
The following WSDL code shows the specification of the service and port names, and the binding of the port to a machine address:
<service name="ActuateAPI"> <port name="ActuateSoapPort" binding="wsdlns:ActuateSoapBinding">
<soap:address location="http://localhost:8000"/>
</port>
</service>
An application uses this information to construct an interface to access the operations available from the service using a remote procedure call (RPC), as shown in the following code:
package com.actuate.schemas;
 
public interface ActuateSoapPort_PortType extends java.rmi.Remote {
public com.actuate.schemas.LoginResponse
login(com.actuate.schemas.Login request)
throws java.rmi.RemoteException;
In the example, 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 SDI.