A service interface is a mechanism for grouping a set of business operations that logically belong together. For example, all operations that deal with the management of customers in your enterprise or all operations that deal with the order processing in your enterprise. Business operations define a concrete business function. They define the input data needed for the operation and define the output data that is the result of the operation.
In Rational® Developer for System z®, portTypes are used to describe service interfaces. A portType consists of one or more operations which use WSDL messages to define their input and output.
The portTypes and their operations always from the service caller point of view. You will only see the request-response and one-way style for portType operations. This view of port types is also consistent with the Business Process Execution Language for Web Services (BPEL4WS) specification.
Using a request-response operation, the endpoint receives a message and sends a correlated message. The caller of the operation waits for a synchronous response. The following figure shows an example of a portType (or interface) with a request-response operation:
<portType name="CustomerInfo">
<operation name="getCustomer" parameterOrder="customerNumber">
<input name="getCustomerRequest"
message="tns:getCustomerRequest" />
<output name="getCustomerResponse"
message="tns:getCustomerResponse" />
</operation>
</portType>
Using a one-way operation, the endpoint receives a message. In this case, the caller is sending an asynchronous message and does not wait for a response. The following figure shows an example of a portType (or interface) with a one-way operation:
<portType name="PurchaseOrder">
<operation name="purchaseOrder" parameterOrder="order">
<input name="purchaseOrderRequest"
message="tns:purchaseOrderRequest" />
</operation>
</portType>
The messages that define the input and output of operations are built from parts which are typed using an XML schema. The following figure shows definitions of the input operation and the output operation that are referenced in Figure 1.
<message name="getCustomerRequest"> <part name="customerNumber" type="xsd:string"/> </message> <message name="getCustomerResponse"> <part name="result" type="xsd1:Customer"/> </message> <message name="purchaseOrderRequest"> <part name="order" type="xsd1:Order"/> </message>
<complexType name="Customer">
<all>
<element name="customerNumber" type="string"/>
<element name="zipCode" type="string"/>
<element name="firstName" type="string"/>
<element name="lastName" type="string"/>
<element name="city" type="string"/>
<element name="street" type="string"/>
</all>
</complexType>
<complexType name="Order">
<all>
<element name="orderNumber" type="string"/>
<element name="customerNumber" type="string"/>
<element name="itemNumber" type="string"/>
<element name="itemQuantity" type="string"/>
</all>
</complexType>