axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guido Wischrop" <wisch...@googlemail.com>
Subject Re: Modify servers HTTP response from "202 Accepted" to "200 OK"
Date Thu, 16 Aug 2007 09:24:27 GMT
Hi Jeff,
thanks for the quick reply. Your suggestion raised some more questions:
1) At which phase do we have to register the handler? We tried it after
the PostDispatch phase, but we are not sure if this is correct, because
we don't know at which point the HTTP response code is set. If it is
set in a flowComplete() method, it might be the wrong phase.

2) How do we get the HTTP headers? We tried
argMsgContext.getProperty(HTTPConstants.MC_HTTP_STATUS_CODE) and
argMsgContext.getProperty(HTTPConstants.RESPONSE_CODE) - but both do
return null. Also directly setting the response code in the
HttpServletResponse does not work.

Thanks for your help,
Guido

On 8/15/07, Walker, Jeff <Jeff.Walker@fmr.com> wrote:
> You might try writing a handler class that gets called on the outgoing
> response. If you correctly register the handler class, it will get
> called after the web service has formulated the response and sent it
> out.
>
> You can get the HTTP headers of the response from the MessageContext
> passed to your invoke() in the handler class, I think, and then you
> could try editing the appropriate http header. Once you do that, return
> true from invoke() and hopefully the adjusted http header with '200 OK'
> will go back to your client.
> Just a suggestion,
> -jeff
>
>
> -----Original Message-----
> From: Guido Wischrop [mailto:wischrop@googlemail.com]
> Sent: Wednesday, August 15, 2007 12:08 PM
> To: axis-user@ws.apache.org
> Subject: Modify servers HTTP response from "202 Accepted" to "200 OK"
>
> Hello,
> we are providing a service for an old external client. This client
> expects a 200 OK HTTP response for a successful delivered message. We
> implemented the service by using axis2 1.2 and unfortunately it
> answers with a "202 Accepted".
> We tried to set the response code in our MessageReceiver like this:
>
> HttpServletResponse response = (HttpServletResponse)
> MessageContext.getCurrentMessageContext().getProperty(HTTPConstants.MC_H
> TTP_SERVLETRESPONSE);
> if (response !=null ) {
>     response.setStatus(HttpServletResponse.SC_OK);
> }
>
> But this doesn't work. Is it possible to change the response code in
> some other way?
>
> Thanks for any help,
> Guido
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message