Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 10986 invoked from network); 16 Aug 2007 15:45:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Aug 2007 15:45:29 -0000 Received: (qmail 44860 invoked by uid 500); 16 Aug 2007 15:45:19 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 44838 invoked by uid 500); 16 Aug 2007 15:45:18 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 44827 invoked by uid 99); 16 Aug 2007 15:45:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 08:45:18 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.223.178.26] (HELO maillnx-us311.fmr.com) (192.223.178.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 15:45:14 +0000 Received: from MSGMMKSM02WIN.DMN1.FMR.COM (msgmmksm02win.dmn1.fmr.com [10.33.139.33]) by maillnx-us311.fmr.com (Switch-3.1.8/Switch-3.1.7) with SMTP id l7GFipjo013993 for ; Thu, 16 Aug 2007 11:44:51 -0400 Received: from MSGMMKIV01WIN.DMN1.FMR.COM (10.33.148.30) by MSGMMKSM02WIN.DMN1.FMR.COM (Sigaba Gateway v4.0) with ESMTP id 152440327; Thu, 16 Aug 2007 11:44:50 -0400 Received: from MSGMROIM02WIN.DMN1.FMR.COM ([172.26.2.195]) by MSGMMKIV01WIN.DMN1.FMR.COM with SMTP_server; Thu, 16 Aug 2007 11:44:50 -0400 Received: from msgmrocls2win.fmr.com ([10.37.181.25]) by MSGMROIM02WIN.DMN1.FMR.COM with Microsoft SMTPSVC(5.0.2195.6713); Thu, 16 Aug 2007 11:44:50 -0400 x-mimeole: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Modify servers HTTP response from "202 Accepted" to "200 OK" Date: Thu, 16 Aug 2007 11:44:50 -0400 Message-ID: <8B0552BD5078074B87F6DC3A7EAB76EB422907@MSGMROCLS2WIN.DMN1.FMR.COM> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Modify servers HTTP response from "202 Accepted" to "200 OK" Thread-Index: Acff51TrR1iyQx3OSqi7djbW5g85NgANAhNQ From: "Walker, Jeff" To: X-OriginalArrivalTime: 16 Aug 2007 15:44:50.0632 (UTC) FILETIME=[61B53480:01C7E01C] X-Virus-Checked: Checked by ClamAV on apache.org I don't know Axis2, so I can't help you much. I use Axis 1.3. My basic thought was that you could try to either change the http header, or create a new response object and set that in the message context, in the handler. Not sure if this is possible in Axis2. I think you should look again at argMsgContext.setProperty(HTTPConstants.RESPONSE_CODE) little more closely. It 'feels' like the correct way to do it, don't you think? Perhaps you can call it in a different place than where you do now? Anyway, in Axis1, you can register handlers in a client-config.wsdd file, or do it programmatically, using code like this:=20 private static void registerClientHandlers(PaGWebService_ServiceLocator locator) { try { = //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D //Register Clientside Handler = //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D //PaGWebService_ServiceLocator locator =3D new PaGWebService_ServiceLocator(); javax.xml.namespace.QName portName =3D new javax.xml.namespace.QName("sessions", "PaGWebService"); javax.xml.rpc.handler.HandlerRegistry hr =3D locator.getHandlerRegistry(); java.util.List handlerChain =3D hr.getHandlerChain(portName); javax.xml.rpc.handler.HandlerInfo hInfo =3D new javax.xml.rpc.handler.HandlerInfo(); hInfo.setHandlerClass(client.ClientSideHandler.class); handlerChain.add(hInfo); } catch (Exception e) { System.out.println("Caught an exception when registering the clientside handler: " + e.getMessage()); } } Obviously, you need to supply the correct locator object and get the QName correct. I don't know if this is the exact way to do it in Axis2, though. Sorry I couldn't help more, -jeff =20 -----Original Message----- From: Guido Wischrop [mailto:wischrop@googlemail.com]=20 Sent: Thursday, August 16, 2007 5:24 AM To: axis-user@ws.apache.org Subject: Re: Modify servers HTTP response from "202 Accepted" to "200 OK" 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 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 =3D (HttpServletResponse) > MessageContext.getCurrentMessageContext().getProperty(HTTPConstants.MC_H > TTP_SERVLETRESPONSE); > if (response !=3Dnull ) { > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org