What is a Service Client?

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Eran Chinthaka
  • 30 Nov, 2008

The ServiceClient class, within Axis2, is the client API (Application Programme Interface) to the service being invoked. Each instance of this class is associated with a given service hosted somewhere else on the Web. Methods inside the Service Client class will provide a convenient API to access the operations of the service. These methods correspond to the most commonly used message exchange patterns. For example, the sendReceive method helps to do a synchronous In-Out method invocation and the sendRobust method helps to invoke a Robust In-Only operation.

Some of these methods also provide the option of non-blocking invocations. For example, the sendReceiveNonBlocking method will help to do a asynchronous In-Out method invocation.

In addition to these, the ServiceClient API provides a convenient API to interact with the message and the message context. Using the service client, you can easily add SOAP headers to the outgoing message and also set properties to the message context. Thereby dynamically customizing the internal behavior of the Axis2 engine.

 

Applies To

1. Apache Axis2/Java