axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guo Tianchong" <>
Subject Re: Axis 1.3 - Problem with Handler
Date Tue, 16 Dec 2008 06:17:58 GMT
hi, Hari

I am working with Axis2 1.4.1 and don't know well about Axis 1.3.

but I also remain concerned about this issue.

  ----- Original Message ----- 
  From: Harikrishna Vemula
  Sent: Tuesday, December 16, 2008 2:05 PM
  Subject: Re: Axis 1.3 - Problem with Handler

  Hi guo,
  But in Axis 1.3 we don't have InvocationResponse object itself. In 1.3 invoke method return
type is void. So, as per my knowledge 
only way to stop the process and send back the response by throwing Fault.
  But is there any other way by which we can catch Fault and process the fault message and
send back normal response to client?

  JAX-RPC is having methods with return type true for handleRequest method, how to use JAXRPC
handlers in axis? Any idea?

  Thanks in advance...


  On Tue, Dec 16, 2008 at 6:56 AM, Guo Tianchong <> wrote:


    you can do something in the Handler's invoke() method
    and encapsulate a new SOAP body in the MessageContext object.

    Using AXIOM, that looks like :

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {

            SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
            OMNamespace soapNamespace = fac.createOMNamespace(Constants.URI_SOAP11_ENV, "soap");

            // make envelope element
            SOAPEnvelope newEnvelope = fac.createSOAPEnvelope(soapNamespace);

            // make header element
            SOAPHeader header = fac.createSOAPHeader(newEnvelope);
            // add your header blocks here

            // make body element
            SOAPBody body = fac.createSOAPBody(newEnvelope);
            // add your body response here
           // body.addChild(.....)


            return InvocationResponse.CONTINUE;


    Please have a try.


      ----- Original Message ----- 
      From: Harikrishna Vemula
      Sent: Monday, December 15, 2008 10:36 PM
      Subject: Axis 1.3 - Problem with Handler

         I have a Webservice for that i implemented a Handler to validate input request with
XSD. Whenever any exception occurs in 
invoke method i'm throwing AxisFault. But client doesn't want to have exception as return
value even though any exception occurs.
      Client is expecting to recieve a normal SOAP response with ErrorCode & ErrorMsg
parameters in the response.

      How can i send response with ErrorCode & ErrorMsg when any exception raised in Handlers?

      Please help me out, this is an urgent requirement.

      Thanks in advance...
      Hari Krishna Vemula

  Hari Krishna Vemula

View raw message