• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

finding response time for quality of webservices using java in axis2

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey ..
is it possible to find the response time for java soap webservices using java ....
if it is possible please let me know....




with regards,
vidhya
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one of the ways is by using handlers on client/server side.
handlers would have access to both request and response.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Yes, as Arun Kumar says, you can use handlers.
Assume you want to find the time it takes for a request to travel from the client until the client receives the corresponding response:
1. In the client-side handler, add a timestamp in a SOAP header of outgoing messages.
2. In the server-side handler, insert the timestamp from ingoing messages into the MessgeContext of each message and, for outgoing messages, transfer the timestamp from the MessageContext to a SOAP header.
Properties in the MessageContext are copied from the incoming message to the outgoing response.
3. In the client-side handler, when receiving a message with a timestamp, calculate and log the time it took for the request.

The above approach have the drawback that it does not separate the time spent "on the wire" from the time taken to actually process a request.
Best wishes!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - I am new to Axis2 and am also trying to do the same. I used the operationContext to set the current time when the action is of type request
and then used it to calculate the duration when the action is of type response.
Do you see any problem with this approach ?
Here is some relevant code

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Are you experiencing any problems with your implementation?
I am not familiar with the Axis web service stack, so I cannot really tell if my suggestions work with it. If it adheres to the JAX-WS standard, then there should (theoretically) be no problems.
Best wishes!
 
Rahul Ury
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to be working fine although I am not entirely clear on what "Operation Context" means. I assume it means for a given user & for a given session & most importantly one user operation (ie) one webservice operation call done by the user.

If I were to do this in a generic non-axis2 way, or said differently,
On the server side, how do I pass ANY information between a request message and its corresponding response message ?
I think the statement 2 you made

2. In the server-side handler, insert the timestamp from ingoing messages into the MessgeContext of each message and, for outgoing messages, transfer the timestamp from the MessageContext to a SOAP header.
Properties in the MessageContext are copied from the incoming message to the outgoing response.


addresses it, but can you please elaborate with a code snippet please ?

Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic