axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathew, Jose" <jmat...@siemens-emis.com>
Subject RE: Help with Axis Handlers!!
Date Tue, 11 Oct 2005 16:14:51 GMT
Well, I could track it down to "Invocation arguments were modified"
exception in HandlerChainImpl class. Apparently axis checks to see if the
original invocation arguments were modified in the postinvoke( ) method
there. So does that mean that altering the SOAPBody in a handler is not
allowed?? 
 
- Jose
 
  _____  

From: Mathew, Jose 
Sent: Tuesday, October 11, 2005 8:53 AM
To: axis-user@ws.apache.org
Subject: RE: Help with Axis Handlers!!


Thanks Arun!
 
I have been using Axis' handlers, now I have switched to JAXPRC Handlers
like you suggested. One problem, though..  in my scenario, I have just one
Handler class, and I make use of the handleRequest (return false) and
handleResponse (return true) methods to process my request and response ,
and completely avoid execution of the actual end point by returning false
from handleRequest method. In my handleResponse , I need to set a new
message into the messagecontext . I do it like this..
 
ByteArrayInputStream bis = new ByteArrayInputStream(response.getBytes());
InputSource is = new InputSource((java.io.InputStream)bis);
   
SOAPMessage soapMessage= MessageFactory.newInstance().createMessage();      
DocumentBuilder parser =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document soapDoc = parser.parse(is);     
soapMessage.getSOAPPart().getEnvelope().getBody().addDocument(soapDoc);
   
((SOAPMessageContext)context).setMessage(soapMessage);  // Is there a
setResponseMessage( ) instead?
((SOAPMessageContext)context).getMessage().writeTo(System.out);
 
 
The handleResponse proceeds with out any errors, but in the response at the
client side, i keep getting a "Server Error" SOAP fault message. I am pretty
sure that the message I am setting in the SOAPMessageContext is a 'good'
SOAP message, since it was working while I was using Axis Handlers..
 
Any idea what is going wrong? Any help would be greatly appreciated.
 
Thanks again
 
Jose Mathew

  _____  

From: Soactive Inc [mailto:soactive@gmail.com] 
Sent: Sunday, October 09, 2005 1:04 AM
To: axis-user@ws.apache.org
Subject: Re: Help with Axis Handlers!!


You need to return false in the request handling function of the handler
that you would like to skip rest of the handlers:

public boolean handleRequest(MessageContext mc) {

   // some logic

   // once you decide to quit the remainder of the chain, set the
appropriate response message and return false

   context.setResponseMessage(someResponseMessage);

   return false;
}

-Arun


On 10/7/05, Mathew, Jose <jmathew@siemens-emis.com
<mailto:jmathew@siemens-emis.com> > wrote: 

I am using Axis 1.2
As part of something I am trying to do, I would like to break out of a
Request handler I have for a service, and return a SOAP response, without
going further down the chain (skip deserialization etc) . Is this possible?
Can anyone help me with any tips? 
Thanks.

Jose Mathew



Mime
View raw message