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);
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:[EMAIL PROTECTED]
Sent: Sunday, October 09, 2005 1:04 AM
To: [email protected]
Subject: Re: Help with Axis 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 <[EMAIL PROTECTED]>
wrote:
I am using Axis 1.2As 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
