problem with WebMethod in c#
Hi
I have the following 2 classes in say a project
public class abc
{ private int k;
public abc(int a) { k = a; }
public int getval() { return k; }
public void setval(int m) { k = m; }
}
***********
public Service
{ abc test1 = new abc(20);
[WebMethod]
public int getcatalog() { return test1.getval(); }
[WebMethod]
public void change(int h) { test1.setval(h); }
// here whatever code the .NET creates for me for a webservice.....
}
both the above classes are in the same namespace. ( actually the second one is a WEBSERVICE )
NOW i create a windows application and add Web Reference to the above.
The problem is say i give
1) ss.getcatalog(); // ss is say the object of thatwebreference.class
2) ss.change(132);
3) ss.getcatalog();
I DO NOT GET THE CHANGED value if i print getcatalog() ie., i get 1) and 3) to be the same value. why is it so .... ?
This is just a simple application i put here ... i have much more that i have to build on this ..
Help is appreciated.
Skar