You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sebastian Maleszewski <se...@post.pl> on 2003/05/08 13:20:35 UTC

How to build SOAP header acceptable by .NET client?

Hi

I have encountered a problem with interop Axis and .NET.
I've built web service in java and exposed it using Axis.
I'm using a custom soap header. I know that Axis doesn't
generate automaticly necessary data for soap header in wsdl, 
so I added that statments myself by hand to the wsdl.
This web service will be used by clients based on Microsoft
platform (.NET and ASP/COM).
My next step was to built .NET client (proxy) using wsdl.exe
(.NET) tool. The .NET client works fine with one exception.
The client doesn't understand Axis's soap header and on the
other side - Axis doesn't understand .NET client's soap header :-)
The issue is that Axis and .NET differently encode soap header
in soap envelope.

Below I present both styles of encoding soap header:

Axis style:

<soapenv:Header>
 <ns1:MyHeader soapenv:actor=""
      soapenv:mustUnderstand="0"
      xsi:type="xsd:string"
      xmlns:ns1="http://localhost:8080/axis/MyService.jws">Foo</ns1:MyHeader>
</soapenv:Header> 

.NET style:

<soap:Header>
 <tns:MyHeader id="h_id1">
    <headerKey xsi:type="xsd:string">Foo</headerKey>
 </tns:MyHeader>
</soap:Header>

Does anybody know how can I build soap header on Axis side
which will be accepted by .NET proxy ?
Any java sample will be welcome.

Regards,
Sebastian