Return-Path: Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 25150 invoked from network); 19 Feb 2002 14:36:11 -0000 Received: from gorilla.mchh.siemens.de (194.138.158.18) by daedalus.apache.org with SMTP; 19 Feb 2002 14:36:11 -0000 Received: from blues.mchh.siemens.de (mail2.mchh.siemens.de [194.138.158.227]) by gorilla.mchh.siemens.de (8.9.3/8.9.3) with ESMTP id PAA22732 for ; Tue, 19 Feb 2002 15:36:09 +0100 (MET) Received: from mchh274e.demchh201e.icn.siemens.de ([139.21.200.84]) by blues.mchh.siemens.de (8.9.1/8.9.1) with ESMTP id PAA23068 for ; Tue, 19 Feb 2002 15:36:02 +0100 (MET) Received: by MCHH274E with Internet Mail Service (5.5.2653.19) id <1DHMSB8T>; Tue, 19 Feb 2002 15:36:07 +0100 Message-ID: <15A0F4D7BF4DD411BD4C0008C71E2F28D96ACC@MCHH233E> From: Dittmann Werner To: "'axis-user@xml.apache.org'" Subject: AW: Complex type in SOAP header Date: Tue, 19 Feb 2002 15:35:54 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks :-). I didn't see that static method=20 in MessageContext. Now it's clear. Werner > -----Urspr=FCngliche Nachricht----- > Von: Adam.Leggett [mailto:Adam.Leggett@upco.co.uk] > Gesendet: Dienstag, 19. Februar 2002 15:11 > An: 'axis-user@xml.apache.org' > Betreff: RE: Complex type in SOAP header >=20 >=20 > In a Handler, where you have access to the MessageContext you=20 > can get the > SOAP envelope like so: >=20 > //get message from context > Message msg =3D msgContext.getRequestMessage(); > =09 > //retrieve SOAP envelope > SOAPEnvelope env =3D=20 > msg.getSOAPPart().getAsSOAPEnvelope(); >=20 > From your target service you can get the MessageContext with=20 > the static > method MessageContext.getCurrentContext(). >=20 > Cheers >=20 > Adam >=20 > -----Original Message----- > From: Dittmann Werner [mailto:Werner.Dittmann@icn.siemens.de]=20 > Sent: Tuesday, February 19, 2002 1:53 PM > To: 'axis-user@xml.apache.org' > Subject: AW: Complex type in SOAP header >=20 >=20 > Just a question: how can I access the envelope (env) in a=20 > service? Looking > at some example I don't see where the service has access to the > envelope.=20 > =20 > Regards, > Werner > -----Urspr=FCngliche Nachricht----- > Von: Adam.Leggett [mailto:Adam.Leggett@upco.co.uk] > Gesendet: Dienstag, 19. Februar 2002 10:44 > An: 'axis-user@xml.apache.org' > Betreff: RE: Complex type in SOAP header >=20 >=20 > Thanks Jeff. I actually worked this out late yesterday by=20 > taking a look at > the the source for SOAPHeader and MessageElement.=20 > =20 > Im interested to know if you have any idea of how this=20 > header message could > be captured in WSDL using a Java based tool.=20 > I know .NET can do this, but in my case a Handler processes=20 > the SOAP Header > so its not part of my service interface(s). I fixed my=20 > generated WSDL by > manually editing it. > =20 > Thanks Again > =20 > Adam >=20 > -----Original Message----- > From: Jeff Talbot [mailto:talbotj@businesslogic.com]=20 > Sent: Monday, February 18, 2002 8:07 PM > To: 'axis-user@xml.apache.org' > Subject: RE: Complex type in SOAP header >=20 >=20 >=20 >=20 > You shouldn't need to deal with Element's or DOM's. Axis=20 > includes support > for complexTypes passed as SOAP Header elements (you just=20 > need to make sure > you have serializers registered for your types). On the=20 > client side you can > create the header in the following manner: > SOAPHeader header =3D new SOAPHeader(NAMESPACE,=20 > localName, object);=20 > Then, in the service implementation (or in a handler), you=20 > can retrieve the > header in this way:=20 > SOAPHeader header =3D env.getHeaderByName(NAMESPACE, = localName);=20 > And the value:=20 > object =3D header.getValueAsType(new QName(NAMESPACE,=20 > localName));=20 > Hope this helps!=20 >=20 >=20 > > -----Original Message-----=20 > > From: Adam.Leggett [mailto:Adam.Leggett@upco.co.uk]=20 > > Sent: Monday, February 18, 2002 10:33 AM=20 > > To: 'axis-user@xml.apache.org'=20 > > Subject: RE: Complex type in SOAP header=20 > >=20 > >=20 > > If anyone is interested I resolved this by simply building a=20 > > org.w3c.dom.Element in the client, using the SOAPHeader(Element)=20 > > constructor. Then in my handler I retrieved the the=20 > > SOAPHeader from the=20 > > MessageContext and used header.getAsDOM() in order to parse=20 > > the contents.=20 > >=20 > > In addition I had to manually edit the WSDL to include the=20 > > =20 > > details. I needed it to interop with .NET using the SOAP=20 > > header to carry=20 > > authentication credentials. .NET seems to require SOAP Header=20 > > details to be=20 > > encapsulated as a complex type. That's why I needed to build=20 > > the client DOM=20 > > and unmarshall it in the Handler. I could'nt find a way to=20 > > serialize/deserialize a JavaBean in the SOAP Header that > > encapsulated my=20 > > authentication details. I would prefer not to have to do it=20 > > in such a low=20 > > level way if I can. Any ideas appreciated.=20 > >=20 > > Thanks=20 > >=20 > > Adam=20 > >=20 > > -----Original Message-----=20 > > From: Adam.Leggett [mailto:Adam.Leggett@upco.co.uk]=20 > > Sent: Monday, February 18, 2002 12:00 PM=20 > > To: Axis User (axis-user@xml.apache.org)=20 > > Subject: Complex type in SOAP header=20 > >=20 > >=20 > > I need to serialize a JavaBean to send in the SOAP header,=20 > > and to retrieve=20 > > it from the MessageContext in a handler.=20 > >=20 > > I have no problem when the header element is a xsd dataype.=20 > >=20 > > Has anyone tried this yet?=20 > >=20 > > Adam Leggett=20 > > UPCO=20 > > Direct Line: 0113 20 10 631=20 > > Fax: 0113 20 10 666=20 > > =20 > > The contents of this email are intended for the named=20 > > addressees and may=20 > > contain confidential and / or privileged material. If=20 > > received in error,=20 > > please contact UPCO on +44 (0)113 20 10 600 and then delete=20 > > the entire email=20 > > from your system. Unauthorised review, distribution,=20 > > disclosure or other use=20 > > of this information could constitute a breach of confidence. Your=20 > > co-operation in this matter is greatly appreciated.=20 > >=20 >=20