Problem to access the SOAP Header data

C

chandra

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.
 
R

Rodrigo García

Hi.
I'm not sure if I understand you correctly.

You have to instantiate an Info object on the client even if its properties
are null. Otherwise, you'll get a null reference on the server.

Could you post your client code?

Regards.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top