Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2005

Tip: Looking for answers? Try searching our database.

Problem to access the SOAP Header data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chandra - 01 Dec 2005 09:37 GMT
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.
Rodrigo García - 02 Dec 2005 11:44 GMT
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.

> I would like to know how to access the SOAP Header data?
> I'm building an infopath application using JScript that will consume a
[quoted text clipped - 53 lines]
>
> Many thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.