[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Simple WSE 2.0 question: passing data thru SoapContext

igeta

7/31/2003 2:13:00 AM

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
2 Answers

Eric

7/31/2003 3:04:00 AM

0

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" <igeta@yahoo.com> wrote in message
news:803e4947.0307301813.785723af@posting.google.com...
> 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


Lucien

8/1/2003 3:56:00 PM

0

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" <igeta@yahoo.com> wrote in message
news:803e4947.0307312032.42f09b65@posting.google.com...
> Thanks Kevin. I needed to restart my VS.net before I could see the
> WSE 2.0 setting. Thanks again.
>
>
> "Kevin Cunningham" <nospam@nospam.xxx> wrote in message
news:<Oq34PBxVDHA.1680@tk2msftngp13.phx.gbl>...
> > 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" <igeta@yahoo.com> wrote in message
> > news:803e4947.0307301813.785723af@posting.google.com...
> > > 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