H
hellrazor
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!
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!