-----Original Message-----
From: Adam.Leggett [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 3:44 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Complex type in SOAP headerThanks Jeff. I actually worked this out late yesterday by taking a look at the the source for SOAPHeader and MessageElement.Im interested to know if you have any idea of how this header message could be captured in WSDL using a Java based tool.I know .NET can do this, but in my case a Handler processes the SOAP Header so its not part of my service interface(s). I fixed my generated WSDL by manually editing it.Thanks AgainAdam-----Original Message-----
From: Jeff Talbot [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:07 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Complex type in SOAP header
You shouldn't need to deal with Element's or DOM's. Axis includes support for complexTypes passed as SOAP Header elements (you just need to make sure you have serializers registered for your types). On the client side you can create the header in the following manner:
SOAPHeader header = new SOAPHeader(NAMESPACE, localName, object);
Then, in the service implementation (or in a handler), you can retrieve the header in this way:
SOAPHeader header = env.getHeaderByName(NAMESPACE, localName);
And the value:
object = header.getValueAsType(new QName(NAMESPACE, localName));
Hope this helps!
> -----Original Message-----
> From: Adam.Leggett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 18, 2002 10:33 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Complex type in SOAP header
>
>
> If anyone is interested I resolved this by simply building a
> org.w3c.dom.Element in the client, using the SOAPHeader(Element)
> constructor. Then in my handler I retrieved the the
> SOAPHeader from the
> MessageContext and used header.getAsDOM() in order to parse
> the contents.
>
> In addition I had to manually edit the WSDL to include the
> <soap:header>
> details. I needed it to interop with .NET using the SOAP
> header to carry
> authentication credentials. .NET seems to require SOAP Header
> details to be
> encapsulated as a complex type. That's why I needed to build
> the client DOM
> and unmarshall it in the Handler. I could'nt find a way to
> serialize/deserialize a JavaBean in the SOAP Header that
> encapsulated my
> authentication details. I would prefer not to have to do it
> in such a low
> level way if I can. Any ideas appreciated.
>
> Thanks
>
> Adam
>
> -----Original Message-----
> From: Adam.Leggett [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 18, 2002 12:00 PM
> To: Axis User ([EMAIL PROTECTED])
> Subject: Complex type in SOAP header
>
>
> I need to serialize a JavaBean to send in the SOAP header,
> and to retrieve
> it from the MessageContext in a handler.
>
> I have no problem when the header element is a xsd dataype.
>
> Has anyone tried this yet?
>
> Adam Leggett
> UPCO
> Direct Line: 0113 20 10 631
> Fax: 0113 20 10 666
> <http://www.upco.co.uk>
> The contents of this email are intended for the named
> addressees and may
> contain confidential and / or privileged material. If
> received in error,
> please contact UPCO on +44 (0)113 20 10 600 and then delete
> the entire email
> from your system. Unauthorised review, distribution,
> disclosure or other use
> of this information could constitute a breach of confidence. Your
> co-operation in this matter is greatly appreciated.
>
Title: Message
hmm,
if you're wondering how to get Java2Wsdl / Wsdl2java to recognize headers, they
don't do it. at least not right now (i believe it is on the todo list). if
you're wondering about a 3rd party tool to do it, i don't know of
any.
right
now i am also manually editing the wsdl.
- Complex type in SOAP header Adam.Leggett
- RE: Complex type in SOAP header Adam.Leggett
- RE: Complex type in SOAP header Jeff Talbot
- RE: Complex type in SOAP header Adam.Leggett
- RE: Complex type in SOAP header Adam.Leggett
- Jeff Talbot
