Problem to access the SOAP Header data

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I would like to know how to access the SOAP Header data?
I'm building an infopath application using JScript that will consume a
C#-implemented web service.

The infopath application already generated the following SOAP message,

<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext";>

<soap:Header>
<Security>
<Username>Demo User</Username>
<Password>Demo Password</Password>
</Security>
</soap:Header>

<soap:Body>
<GetResumeList
xmlns="http://microsoft.com/Solutions/InformationWorker/Recruiting/Resume/"/>
</soap:Body>
</soap:Envelope>

The web service method looks like this,
public class Submission
{
public LogonInfo Info;

[ WebService(Description="Server Variables",
Namespace="http://microsoft.com/Solutions/InformationWorker/Recruiting/Resume/";)]

[WebMethod]
[SoapHeader("Info", Direction=SoapHeaderDirection.InOut)]
public string GetResumeList()
{if (Info == null)
{.......}
......
}

where LogonInfo is,
public class LogonInfo : SoapHeader
{
public string username;
public string password;
public LogonInfo()
{....
}
}

My question is why the object "Info" is alway null from inside the above web
service method?. Just for info I could set a new value of the object "Info"
from within the web service method (for instance, username="aaa",
password="bbb" and the infopath apps could see the new value.

Many thanks in advance.





.



Relevant Pages

  • RE: InfoPath and SOAP Headers
    ... We have a Web Service in our intranet that expects a username to be supplied ... InfoPath can call the methods but cannot populate the header so audit data ... The SOAP header was a quick and dirty workaround as we hit the IIS double ...
    (microsoft.public.office.developer.office.sdks)
  • RE: Transform a Webservice With Xslt
    ... You can tell InfoPath to design a form using a web service. ... Transform a Webservice With Xslt ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: InfoPath support for .ASHX files
    ... purely InfoPath problem. ... In this case also make sure that the web service ... InfoPath support for .ASHX files ... I'm trying to create an InfoPath form to send some values to the ...
    (microsoft.public.biztalk.general)
  • RE: Problem to access the SOAP Header data
    ... You have to instantiate an Info object on the client even if its properties ... > The web service method looks like this, ... > public LogonInfo Info; ... > public string GetResumeList() ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: how can i create a user interface with infopath
    ... Expose your orchestration as a web service using the biztalk web service ... Then you can design an infopath ...
    (microsoft.public.biztalk.general)