calling axis webserivce with credentials in header


Kjartan Furnes


I'm trying to access a webservice on an axis server from my .net client
(c#). First I have to call a login service that returns a session ID. This
session id should then be added to the header of the actual webserivce call
together with a userid and version number. The header should look like this:

<ns1:UserID soapenv:actor=""
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns1="AuthHeader"
<ns2:SessionID soapenv:actor=""
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns2="AuthHeader"
<ns3:Version soapenv:actor=""
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns3="AuthHeader"

The problem is that the wsdl doesn't have any information about the header.
So the proxy generated by the wsdl tool has no way of including these
elements in the header. I've tried to create a class that overrides soap
header and added these values. The result looks like this:

<soap:Header><types:AuthHeader id="h_id1"><UserId
xsi:type="xsd:string">9.1</Version></types:AuthHeader ></soap:Header>

I have googled a bit and can see that there are some interop. issues with and axis but haven't found a solution to this yet. I've also tried to
modify the wsdl to include the header but with litle success. Does anyone
know how to solve this ? I realy don't want to create the soap message with
a string builder...


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