Re: webservices: simple question, accessing webservice members

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Hayato Iriumi (hiriumi_at_hotmail.com)
Date: 11/16/04


Date: Mon, 15 Nov 2004 19:06:20 -0800

I don't think you can access a public member of
System.Web.Services.WebService class from a client side. I would either
stored the value in database or use Session in the web service.

Good luck!

============================
Hayato Iriumi (hiriumi@hotmail.com)
Blog: http://www.vbaspcoder.com

"hellrazor" <jorge@another-world.com> wrote in message
news:Xns95A2AE03D3856jorgeanotherworldcom@207.46.248.16...
> Hi, (new to webservices here)
>
> Is it possible to access a class instance variable defined in a
webservice?
> I want to access this variable, in addition to the data being returned by
> the [webmethod].
>
> so let's say I have the following webservice class:
>
>
> public class Service1 : System.Web.Services.WebService
> {
>
> public string hello2;
>
> public ModelServices()
> {
> InitializeComponent();
> }
>
> [WebMethod]
> public string sayHello()
> {
> hello2 = "another hello to you!"
> return "hello there";
> }
> }
>
>
> ...............................
>
> So when I consume this webservice, I want to be able to call the
sayHello()
> method, and have access to the hello2 variable after having called
sayHello
> () and thus expecting the "hello2" variable to contain the "another hello
> to you!" value:
>
>
> remoteWS.Service1 ws = new remoteWS.Service1();
> string hello1 = ws.sayHello();
> string hello2 = ws.hello2;
>
>
>
> Is this possible, and how do I go about doing it? thanks!
>
>



Relevant Pages