i have deployed a webservice in JBoss and Then added two handlers before the service.One handlers(Request handler) takes the incoming soap message and prints it out and similarly the outgoing messgage from the service passed through another handler ( Response Handler) and prints out a mesasge.Bothe teh handlers are defined as two seperate class files.
what I want to do is , Can I directly send teh message from the Request Handler to Response Handler instead of hitting the service and coming back?
I take this as an opportunity to see how handler chain work:
Consumer end-point ---------> [ Handler A on Provider side ------> Provider end-point ]
-Suppose we have a simple case where we ignore/block the incoming request,
In this case, the Handler A (via underlying SOAP engine) will not forward the request to the Provider end-point.
It's the duty of the Handler A
1) prepare a customized response if needed
2) or let the default reponse to be the orginal request itself
so that the underlying SOAP engine will pass back to the Consumer end-point.
Now in your AXIS2 case, you have 2 different handlers: 1 RequestHandler and 1 for ResponseHandler
I would only *guess*, in your RequestHandler:
if somehow by code you tell AXIS2 not to forward the request to the end-point, then AXIS2 will not forward the request to the End-Point
Then AXIS2 will call ResponseHandler to do whatever it wished (implicitly going back to Client)
Just doing an experiment with a debugger and you will the flow of handler chaining. Go luck.
This is like "Trust But Verify."
padma harika pottamsetty
Joined: Jun 27, 2011
Well I tried doing what you said , about "if somehow by code you tell AXIS2 not to forward the request to the end-point, then AXIS2 will not forward the request to the End-Point "
So in the request handler the Changes that I made was , instead of CONTINUE, I replaced it with ABORT.But that completely stopped the message to flow further .
I even tried hardcoding a soap message in response handler, so as to sent it back to the client.But I could only the request and no response.
I dint understand how to exactly stop the message from going to the endpoint.
Also I wanted clarify on one thing , the two ways you defined .. can they be still used by axis2?