B
Bsiang Tan
Dear all experts,
Here is my web service code :
......
private int Number = -1;
.......
[WebMethod]
public void InitNumber(int num)
{
.....
this.Number = num;
}
[WebMethod]
public int GetNumber( )
{
.....
return Number;
}
in my web app code :
{
TestService Service = new TestService( );
....
....
// Invoke Web Service InitNumber method
Service.InitNumber( 100 );
....
....
int i = Service.GetNumber( );
....
....
}
What I get from variable i is -1, although I call the InitNumber( ) and set
it to 100.
Is it web service a stateless ?
Is it mean that each time I call the Web Service, it actually re-instantiate
?
Thank for you all helpful hands...
Best regards,
Bsiang
Here is my web service code :
......
private int Number = -1;
.......
[WebMethod]
public void InitNumber(int num)
{
.....
this.Number = num;
}
[WebMethod]
public int GetNumber( )
{
.....
return Number;
}
in my web app code :
{
TestService Service = new TestService( );
....
....
// Invoke Web Service InitNumber method
Service.InitNumber( 100 );
....
....
int i = Service.GetNumber( );
....
....
}
What I get from variable i is -1, although I call the InitNumber( ) and set
it to 100.
Is it web service a stateless ?
Is it mean that each time I call the Web Service, it actually re-instantiate
?
Thank for you all helpful hands...
Best regards,
Bsiang