SOAPHeader element - not a complex type ???

E

Emul

I have to send a SOAP request from my .NET/C# client to a server
(Apache/Java/Axis) that expects a SessionKey to appear in the
SOAPHeader. Their WSDL does not describe the header (I spoke with them
and they are not able to provide WSDL with it) so I handcrafted the
WSDL and ran WSDL.EXE on it. This takes me 99% of the way there, but
the last 1% seems insurmountable! The problem is that the server
expects the SOAPHeader to contain the value as a simple type (string),
not a complex type. Here is what is expected...
<soapenv:Header...>
<ns:SessionKey...> XXXXXX </ns:SessionKey>
</soapenv:Header>
Here is what I get from .NET...
<soapenv:Header...>
<ns:MyHeader...>
<SessionKey...> XXXXXX </SessionKey>
</ns:MyHeader>
</soapenv:Header>
I want to get rid of the MyHeader - to simply change it from a
complexType to an element. If I try to change it from a complexType to
an element, I get the error that use="encoded" values must be
complexTypes. .NET seems to allow this for use="literal" types, but
the body is use="encoded", and if the body is encoded, the header must
be as well - or I get a VS TOOL error. (from WSDL.EXE)
Q: Is there a way in .NET to create a simple one-element SOAPHeader,
not an embedded/nested complex type?
Thank you so very much. - Emul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top