Re: Axis2 question about async. invocation of web services
Gul You don't always want transport level asynchrony. After all it causes problems with firewalls, NAT, etc. However, if you are going to be asynchronous, then it makes sense to have callbacks in the code as well as on the wire. Otherwise the blocking client can time out before the response gets back. It makes even more sense when you start adding reliability with WSRM. Paul On 3/7/07, Gul Onural <[EMAIL PROTECTED]> wrote: Great help. Thanks Paul. I think I understand the two ways of achieving asynchrony. I guess the ws-addressing-transport-level-asynchrony is closer to what I want to achieve. I was wondering why you think having both is the best option, i.e. why would you want both ? Thanks for the reply, again, it was really helpful. Gul -Original Message- From: Paul Fremantle [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 2:11 PM To: axis-user@ws.apache.org Subject: Re: Axis2 question about async. invocation of web services Gul There are two aspects. The client model and the transport model. The client model depends on whether you call the NonBlocking APIs (or use the async stubs). The transport model depends on whether you call the method: serviceClient().getOptions().setUseSeparateListener(true); or stub._getServiceClient().getOptions().setUseSeparateListener(true); This also relies on you enabling ws-addressing: engageModule("addressing"); This adds a header into the message. Any WS-Addressing compliant endpoint will now respond 202 OK and then initiate a new HTTP connection for the response. Certainly for Axis2 you don't need to do anything on the server side to enable this. A really important point is that the client-programming-model-asynchrony and the ws-addressing-transport-level-asynchrony are completely orthogonal. You can have the code blocking and two HTTP connections, or you can have the code nonBlocking and a single HTTP req-resp. Obviously the most useful combination is to have both. Just for interest, the WS-Addressing working group has recently published a WS-Policy assertion that services can use to say whether they support the single HTTP connection (known as anonymous) or the dual-http connection (known by W3 as nonAnonymous and Microsoft as Duplex). See here: http://dev.w3.org/cvsweb/~checkout~/2004/ws/addressing/ws-addr-wsdl.html ?content-type=text/html;%20charset=utf-8#wspolicyanonresponses Paul On 3/7/07, Gul Onural <[EMAIL PROTECTED]> wrote: > > > > > I have a question about the async. Invocation of the web service > interfaces with Axis2. > > My understanding from the existing documentation > (http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-us > ing-apache-axis2.html), > > Axis2 definition of the async. invocation refers to the pattern where : > > - calls to axis2 client immediately returns to the caller application > (async.), however invocation between the client and server still > becomes sync. > > What I want to achieve is that the calls to server immediately returns > to client as well. And then the server sends another message to the > client where the client has a listener for, when the task on the > server side completed. > > Can you give me some pointers to achieving this in a pluggable manner > using > Axis2 client and server components ? > What is the right way of doing it ? > > Thanks, > > Gul -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC Co-chair http://bloglines.com/blog/paulfremantle [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC Co-chair http://bloglines.com/blog/paulfremantle [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Axis2 question about async. invocation of web services
Great help. Thanks Paul. I think I understand the two ways of achieving asynchrony. I guess the ws-addressing-transport-level-asynchrony is closer to what I want to achieve. I was wondering why you think having both is the best option, i.e. why would you want both ? Thanks for the reply, again, it was really helpful. Gul -Original Message- From: Paul Fremantle [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 2:11 PM To: axis-user@ws.apache.org Subject: Re: Axis2 question about async. invocation of web services Gul There are two aspects. The client model and the transport model. The client model depends on whether you call the NonBlocking APIs (or use the async stubs). The transport model depends on whether you call the method: serviceClient().getOptions().setUseSeparateListener(true); or stub._getServiceClient().getOptions().setUseSeparateListener(true); This also relies on you enabling ws-addressing: engageModule("addressing"); This adds a header into the message. Any WS-Addressing compliant endpoint will now respond 202 OK and then initiate a new HTTP connection for the response. Certainly for Axis2 you don't need to do anything on the server side to enable this. A really important point is that the client-programming-model-asynchrony and the ws-addressing-transport-level-asynchrony are completely orthogonal. You can have the code blocking and two HTTP connections, or you can have the code nonBlocking and a single HTTP req-resp. Obviously the most useful combination is to have both. Just for interest, the WS-Addressing working group has recently published a WS-Policy assertion that services can use to say whether they support the single HTTP connection (known as anonymous) or the dual-http connection (known by W3 as nonAnonymous and Microsoft as Duplex). See here: http://dev.w3.org/cvsweb/~checkout~/2004/ws/addressing/ws-addr-wsdl.html ?content-type=text/html;%20charset=utf-8#wspolicyanonresponses Paul On 3/7/07, Gul Onural <[EMAIL PROTECTED]> wrote: > > > > > I have a question about the async. Invocation of the web service > interfaces with Axis2. > > My understanding from the existing documentation > (http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-us > ing-apache-axis2.html), > > Axis2 definition of the async. invocation refers to the pattern where : > > - calls to axis2 client immediately returns to the caller application > (async.), however invocation between the client and server still > becomes sync. > > What I want to achieve is that the calls to server immediately returns > to client as well. And then the server sends another message to the > client where the client has a listener for, when the task on the > server side completed. > > Can you give me some pointers to achieving this in a pluggable manner > using > Axis2 client and server components ? > What is the right way of doing it ? > > Thanks, > > Gul -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC Co-chair http://bloglines.com/blog/paulfremantle [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis2 question about async. invocation of web services
Gul There are two aspects. The client model and the transport model. The client model depends on whether you call the NonBlocking APIs (or use the async stubs). The transport model depends on whether you call the method: serviceClient().getOptions().setUseSeparateListener(true); or stub._getServiceClient().getOptions().setUseSeparateListener(true); This also relies on you enabling ws-addressing: engageModule("addressing"); This adds a header into the message. Any WS-Addressing compliant endpoint will now respond 202 OK and then initiate a new HTTP connection for the response. Certainly for Axis2 you don't need to do anything on the server side to enable this. A really important point is that the client-programming-model-asynchrony and the ws-addressing-transport-level-asynchrony are completely orthogonal. You can have the code blocking and two HTTP connections, or you can have the code nonBlocking and a single HTTP req-resp. Obviously the most useful combination is to have both. Just for interest, the WS-Addressing working group has recently published a WS-Policy assertion that services can use to say whether they support the single HTTP connection (known as anonymous) or the dual-http connection (known by W3 as nonAnonymous and Microsoft as Duplex). See here: http://dev.w3.org/cvsweb/~checkout~/2004/ws/addressing/ws-addr-wsdl.html?content-type=text/html;%20charset=utf-8#wspolicyanonresponses Paul On 3/7/07, Gul Onural <[EMAIL PROTECTED]> wrote: I have a question about the async. Invocation of the web service interfaces with Axis2. My understanding from the existing documentation (http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.html), Axis2 definition of the async. invocation refers to the pattern where : - calls to axis2 client immediately returns to the caller application (async.), however invocation between the client and server still becomes sync. What I want to achieve is that the calls to server immediately returns to client as well. And then the server sends another message to the client where the client has a listener for, when the task on the server side completed. Can you give me some pointers to achieving this in a pluggable manner using Axis2 client and server components ? What is the right way of doing it ? Thanks, Gul -- Paul Fremantle VP/Technology, WSO2 and OASIS WS-RX TC Co-chair http://bloglines.com/blog/paulfremantle [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]