hi, Sriram:

I think I met the same problem as yours.

My application asks the webservice to return the http 204 status.

My solution is to put the following code snippet in my ServiceClass's method.

HttpServletResponse resp = 
(HttpServletResponse)MessageContext.getCurrentMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE);
resp.setStatus(204);


Using a kind of Http Monitor (ex: Live HTTP headers in Firefox), I could find 
the Http Response header's status is 204.


>All

But I put the following code snippet in my outflow's handler,

public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
    ......
    HttpServletResponse response = 
(HttpServletResponse)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE);
    response.setStatus(204);
    ......
}

It always throw the NullPointerException for "response.setStatus(204);" 
statement.

Does the handler can not get HttpServletResponse?
Any ideas?

Thanks
Guo.



  ----- Original Message ----- 
  From: sri ram
  To: [email protected]
  Sent: Monday, February 02, 2009 6:32 PM
  Subject: Re: HTTP status


        Can someone give some insight on this

        --- On Mon, 2/2/09, sri ram <[email protected]> wrote:

          From: sri ram <[email protected]>
          Subject: HTTP status
          To: [email protected]
          Date: Monday, 2 February, 2009, 1:55 PM


                Hi all,
                I am using Axis 2.1.4 and XMLBeans as my databinding.
                I have extended AxisServlet .If I get the proper response
                with no exceptions I am getting HTTP status as 200, which is 
completely
                fine but when I get any fault message its sets the status to 
500 automatically.
                So I have added  the code to set the staus to 200 everytime 
even if there is an exception
                but its not working .Does the Axis 2 apis prevent it from 
setting .

                response.setContentType("text/xml; charset=UTF-8");
                response.setStatus(200);

                Do help me on this its urgent

                Thanks ,
                Sriram





----------------------------------------------------------------------
          Add more friends to your messenger and enjoy! Invite them now.


------------------------------------------------------------------------------
  Unlimited freedom, unlimited storage. Get it now 

Reply via email to