Return-Path: Delivered-To: apmail-xml-axis-user-archive@xml.apache.org Received: (qmail 98322 invoked by uid 500); 10 Sep 2002 13:33:24 -0000 Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 98297 invoked from network); 10 Sep 2002 13:33:19 -0000 Message-ID: <058c01c258ce$47bc8680$3c26849b@BRE04000027466> From: "Jean-Marc Taillant" To: References: Subject: Re: SOAP Header, addHeader method Date: Tue, 10 Sep 2002 15:30:50 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: I take the 2002/09/09 and all is ok ... ----- Original Message ----- From: "Agrawal, Anuj (Anuj)** CTR **" To: "'Axis Dev Mailing List'" ; ; "'Axis User Mailing List'" Sent: Tuesday, September 10, 2002 3:28 PM Subject: RE: SOAP Header, addHeader method > Jean-Marc - > > We're facing the same problem. And we just tried latest build from 2002/09/09 per Davanum's suggestion, but it doesn't appear to have fixed the problem. :( > > Any luck on your end? > Anyone else have a fix for this? > We need this badly! :( (no pressure.. ;)) > Thanks. > Anuj. > > > -----Original Message----- > > From: Jean-Marc Taillant [mailto:taillan2@bst.bsf.alcatel.fr] > > Sent: Tuesday, September 10, 2002 8:32 AM > > To: axis-dev@xml.apache.org; dims@yahoo.com > > Subject: Re: SOAP Header, addHeader method > > > > > > I will try the last build from 2002/09/09 > > > > > > > > ----- Original Message ----- > > From: "Davanum Srinivas" > > To: > > Sent: Tuesday, September 10, 2002 2:22 PM > > Subject: Re: SOAP Header, addHeader method > > > > > > > Fixed. Please cross-check with latest nightly build. > > > > > > -- dims > > > > > > --- Jean-Marc Taillant wrote: > > > > Hi, > > > > I joined the mail from the mailing list about the > > addHeader problem > > > > > > > > > > ---------------------------------------------------------------------- > > > > Ricky, > > > > That helped quite a bit -- thanks. I tracked down the > > problem. First, > > the > > > > reason I wasn't able to see the .addHeader method on the > > SOAPEnvelope > > object > > > > is because the class I'm in (a holdover) imported > > > > javax.xml.soap.SOAPEnvelope. So when I made a call to > > > > SOAPEnvelope envelope = > > msgContext.getRequestMessage().getSOAPEnvelope(); > > > > > > > > It was really returning a javax.xml.soap.SOAPEnvelope > > object not an > > > > org.apache.axis.message.SOAPEnvelope. I didn't have to > > cast it, nor did > > I > > > > get compile time errors because the Axis IMPL is a > > subclass of the Sun > > > > interface. As a result the method addHeader() wasn't found. > > > > > > > > So since I couldn't use addHeader(), the road I was going > > down was to > > call > > > > addChildElement on the returned SOAPEnvelope object -- > > which in this > > case > > > > was javax.xml.soap.SOAPEnvelope -- but the implementation > > is actually in > > the > > > > parent class of org.apache.axis.message.SOAPEnvelope: > > > > org.apache.axis.message.MessageElement. > > > > > > > > Now, I've looked through the source code for both the axis > > MessageElement > > > > object and the SOAPEnvelope object, and it seems like the code for > > > > addChildElement is stubbed out. However, if I use the > > addChildElement() > > call > > > > instead of the addHeader() call, the element is not > > appended and my > > > > modification doesn't take -- no error is thrown but the > > SOAP request > > isn't > > > > changed. > > > > > > > > The bug here is that both the > > org.apache.axis.message.SOAPHeader class > > and > > > > the org.apache.axis.message.SOAPBody class don't override the > > > > addChildElement of their parent. If you look at the code > > for both of > > these > > > > classes, you'll see that they have a addHeaderElement() and > > addBodyElement() > > > > respectively. SOAPEvenlope has a similar behavior. But > > none of the 3 > > > > sub-classes override the parent class's method so the > > header, envelope > > or > > > > body is never really changed. > > > > > > > > The solution to this (bug?) is for the SOAPHeader, SOAPBody and > > SOAPEnvelope > > > > classes to override the addChildElement of the parent so that the > > element > > > > doesn't go in the generic "children" ArrayList in the > > MessageElement > > parent > > > > class but get added to the nested "bodyElements" Vector > > (in SOAPBody) > > and > > > > "headers" Vector (in SOAPHeader). I'd be happy to help the Axis > > developers > > > > with this change if necessary. > > > > > > > > Regards, > > > > Rob > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Ricky Ho [mailto:riho@cisco.com] > > > > Sent: Friday, September 06, 2002 10:54 AM > > > > To: axis-user@xml.apache.org > > > > Subject: RE: Handlers and SOAP message re-writing > > > > > > > > > > > > Following is my exact code based on AXIS beta 2 > > > > > > > > import org.apache.axis.*; > > > > import org.apache.axis.handlers.*; > > > > import org.apache.axis.message.*; > > > > > > > > public class PutHeaderHandler extends BasicHandler { > > > > public void invoke(MessageContext msgContext) throws AxisFault > > > > { > > > > try { > > > > System.out.println(" -- PutHeaderHandler > > starts --"); > > > > System.out.println("Options are : " + > > getOptions()); > > > > > > > > SOAPEnvelope envelope = > > > > msgContext.getRequestMessage().getSOAPEnvelope(); > > > > System.out.println("Request message is : > > " + envelope); > > > > envelope.addHeader(new > > SOAPHeaderElement("TestNameSpace", > > > > "isAuthenticated", new Boolean(true))); > > > > > > > > System.out.println("Add header"); > > > > } catch (Exception e) { > > > > throw AxisFault.makeFault(e); > > > > } > > > > } > > > > } > > > > > > > > Rgds, Ricky > > > > ----------------------------------------- > > > > > > > > > > > > > ===== > > > Davanum Srinivas - http://xml.apache.org/~dims/ > > > > > > __________________________________________________ > > > Yahoo! - We Remember > > > 9-11: A tribute to the more than 3,000 lives lost > > > http://dir.remember.yahoo.com/tribute > >