Simple WSE 2.0 question: passing data thru SoapContext

J

Jerry

Hi All,

I am trying to pass an item from my client to a web service using WSE
2.0. The web service somehow cannot get the SoapContext from the
message.

On the client, I have the following:
localhost.Service1 service = new localhost.Service1 ();
SoapContext sc = service.RequestSoapContext;
sc["some_item"] = 1;
service.HelloWorld ();

// localhost is my proxy.

On the web service:
SoapContext sc = RequestSoapContext.Current;
// do something with sc["some_item"]
return "Hello World";

The SoapContext is always null. I couldn't find the right
documentation (tutorial) that would tell me what to do. Could someone
help? Thanks in advance for your help.

Thanks,
Jerry
 
K

Kevin Cunningham

Jerry,
You need to register the soap extension. You can do this by:
1. Right clicking on your project
2. Select WSE 2.0 Settings
3. Check the "Enable Microsoft Web Services Enhancement Extensions"
checkbox

HTH,
 
L

Lucien

Of course you can also add this without the setting tool by manually adding
the extension element to the application config file. But the settings tool
is very convenient...


Jerry said:
Thanks Kevin. I needed to restart my VS.net before I could see the
WSE 2.0 setting. Thanks again.


"Kevin Cunningham" <[email protected]> wrote in message
Jerry,
You need to register the soap extension. You can do this by:
1. Right clicking on your project
2. Select WSE 2.0 Settings
3. Check the "Enable Microsoft Web Services Enhancement Extensions"
checkbox

HTH,

--
Kevin Cunningham
Software Architects, Inc.

Jerry said:
Hi All,

I am trying to pass an item from my client to a web service using WSE
2.0. The web service somehow cannot get the SoapContext from the
message.

On the client, I have the following:
localhost.Service1 service = new localhost.Service1 ();
SoapContext sc = service.RequestSoapContext;
sc["some_item"] = 1;
service.HelloWorld ();

// localhost is my proxy.

On the web service:
SoapContext sc = RequestSoapContext.Current;
// do something with sc["some_item"]
return "Hello World";

The SoapContext is always null. I couldn't find the right
documentation (tutorial) that would tell me what to do. Could someone
help? Thanks in advance for your help.

Thanks,
Jerry
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top