Home > REST Service vs. Non-REST Service Contracts > Non-REST Service with Custom Service Contract

Non-REST Service with Custom Service Contract

Let's start by studying the interaction between a service consumer and a service that provides a custom service contract:

  1. Issue a SOAP message to request invoice data by invoking the getInvoice service capability, as pre-defined in the WSDL definition of the Invoice service contract.
  2. Receive the requested invoice data in a SOAP response message issued by the getInvoice service capability of the Invoice service.
  3. Issue a SOAP message to request customer data by invoking the GetCustomer service capability, as pre-defined in the WSDL definition of the Customer service contract.
  4. Receive the requested customer data in a SOAP response message issued by the GetCustomer service capability of the Customer service.
  5. Issue a SOAP message requesting to have the customer address added to the print queue by invoking the print service capability of the Printer service, as pre-defined in the WSDL definition of the Printer service contract.
  6. Receive a SOAP response message indicating that the action was successful (or not).

Figure 1 and the following example help demonstrate this interaction scenario.

Non-REST Service with Custom Service Contract: The steps required for a service consumer to interact with three services, each with a custom service contract.

Figure 1 - The steps required for a service consumer to interact with three services, each with a custom service contract.

Provided here is a sample code fragment that shows how this interaction would need to be programmed within the service consumer.

Invoice invoice =
	InvoiceService(http://invoice.example.com/).getInvoice(I001)
Customer customer =
	CustomerService(http://customer.example.com/).getCustomer
		invoice.getCustomerId() // customer id is C081
		)
PrinterService(http://printer.example.com/).print(
	queue1, customer.getAddress()
	)

At the network level, the messages exchanged are service-specific. Without further annotation, any middleware that may be involved in the exchanges will be unable to determine whether these are read or write functions, or make any optimizations or perform any checks based on this information.