HighTechTalks DotNet Forums  

calling axis webserivce with credentials in header

Dotnet Framework (Webservices) microsoft.public.dotnet.framework.webservices


Discuss calling axis webserivce with credentials in header in the Dotnet Framework (Webservices) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kjartan Furnes
 
Posts: n/a

Default calling axis webserivce with credentials in header - 01-03-2008 , 03:35 AM






Hi,

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:

<soapenv:Header>
<ns1:UserID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns1="AuthHeader"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">user1</ns1:UserID>
<ns2:SessionID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns2="AuthHeader"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5656640673802095969</ns2:SessionID>
<ns3:Version soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:ns3="AuthHeader"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">9.1</ns3:Version>
</soapenv:Header>

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">user1</UserId><SessionId
xsi:type="xsd:long">5656640673802095969</SessionId><Version
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
..net 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...



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.