Author: chatra Date: Mon Nov 6 21:10:47 2006 New Revision: 471986 URL: http://svn.apache.org/viewvc?view=rev&rev=471986 Log: reviewed and committing patch of Jira AXIS2-1611 Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/dii.html Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/dii.html URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/dii.html?view=diff&rev=471986&r1=471985&r2=471986 ============================================================================== --- webservices/axis2/branches/java/1_1/xdocs/1_1/dii.html (original) +++ webservices/axis2/branches/java/1_1/xdocs/1_1/dii.html Mon Nov 6 21:10:47 2006 @@ -1,10 +1,15 @@ -

Writing Web Service Clients Using Axis2's Primary APIs

+ + + +

Writing Web Service Clients Using Axis2's Primary APIs

-

This section presents complex yet powerful XML based client API which is intended for advanced users. However if you are a new user we recommend using code generation given in the user guide. +

This section presents complex yet powerful XML based client API +which is intended for advanced users. However if you are a new user we recommend +using code generation given in the user guide.

-

Web services can be used to provide a wide-range of functionality to user +

Web services can be used to provide a wide-range of functionality to the user from simple, less time consuming operations such as "getStockQuote" to time consuming business services. When we utilize (invoke using client applications) these Web services we cannot use simple generic invocation @@ -14,8 +19,8 @@ complete, then most often we may end up with "connection time outs". On the other hand, if there are simultaneous service invocations that we need to perform from a single client application, then the use of a "blocking" client -API will degrade the performance of the client application. Similarly there -are various other consequences such as One-Way transports that come in to +API will degrade the performance of the client application. Similarly, there +are various other consequences such as One-Way transports that come into play when we need them. Let's try to analyze some common service invocation paradigms.

@@ -121,7 +126,8 @@
  • Request-Response, Non-Blocking that uses two transport connections
  • -

    Request-Response, Blocking Client

    + +

    Request-Response, Blocking Client

    Axis2 provides the user with several invocation patterns for Web services, ranging from pure blocking single channel invocations to non-blocking dual @@ -158,7 +164,8 @@ printed in your command line, then you have successfully tested the client.

    -

    One Way Client

    + +

    One Way Client

    In the Web service "MyService" we had an IN-ONLY operation with the name "ping" (see Web Services @@ -183,7 +190,7 @@ }

    Since we are accessing an IN-ONLY operation we can directly use the -"fireAndForget()" in ServiceClient to invoke this operation. This will not +fireAndForget() in ServiceClient to invoke this operation. This will not block the invocation and will return the control immediately back to the client. You can test this client by running the target "testPingClient" of the ant build file at "Axis2Home/samples/userguide".

    @@ -192,9 +199,11 @@ There's a lot more to explore. Let's see some other ways to invoke the same operations.

    -

    Request-Response, Non-Blocking that uses one transport connection

    -

    In the "EchoBlockingClient" once the "serviceClient.sendReceive(payload);" + +

    Request-Response, Non-Blocking that uses one transport connection

    + +

    In the "EchoBlockingClient" once the serviceClient.sendReceive(payload); is called, the client is blocked till the operation is complete. This behavior is not desirable when there are many Web service invocations to be done in a single client application or within a GUI. A solution would be to @@ -222,10 +231,11 @@ Web service Clients.

    To run the sample client ("EchoNonBlockingClient") you can simply use the -"testEchoNonBlockingClient" target of the ant file found at the +testEchoNonBlockingClient target of the ant file found at the "Axis2_HOME/samples" directory.

    -

    Request-Response, Non-Blocking that uses two transport connections

    + +

    Request-Response, Non-Blocking that uses two transport connections

    The solution provided by the Non-Blocking API has one limitation when it comes to Web service invocations which take a long time to complete. The @@ -299,11 +309,13 @@ }

    The boolean flag (value true) -in the "options.setUseSeparateListener(...)" method informs the Axis2 +in the options.setUseSeparateListener(...) method informs the Axis2 engine to use separate transport connections for request and response. -Finally "service.finalizeInvoke()" informs the Axis2 engine to stop +Finally service.finalizeInvoke() informs the Axis2 engine to stop the client side listener started to retrieve the response.

    To run the sample client ("EchoNonBlockingDualClient") you can simply use the "testEchoNonBlockingDualClient" target of the ant file found at the "Axis2_HOME/samples" directory.

    + + --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org