T
TiGeR79
Hi,
i've been developing a webservice with 2 seperate webmethods.
The idea is that i have a class which is able to generate a code and also
able to make an image of this code.
Now i'd like to have 2 webmethods ; one which can be called to generate (and
return) the code and one to generate (and return) the image.
The problem im experiencing is that i first make an instance of this class,
then i call the first webmethod (generate code which works fine) after that i
call the second webmehod but instead of making an image out of the code i get
an error because it lost the code. If i place the call to the imagemaking
method in the first webmethod (together with the codegenerating call) it all
works.
Example :
Class UniqueCode
private string uniqueCode;
public void makeUniqueCode()
{
uniqueCode = blah blah my code to make an uniqueid;
}
public Bitmap makeImageFromCode()
{
blah blah my code to make an image of the uniqueCode string;
return uniqueCodeImage;
}
now the webservice :
UniqueCode test = new UniqueCode()
[WebMethod]
public String getCode()
{
string anyCode = test.MakeUniqueCode();
return anyCode;
}
[WebMethod]
public Bitmap getImage()
{
Bitmap testImage = test.makeImageFromCode();
return testImage;
}
any idea how i can solve my problem ? seems like some scope issue or
something, the instance of the class exists (with its global variable
uniquCode) during the call to the first webmethod but seems like it gets
reset befor the call to the second webmethod....
i've been developing a webservice with 2 seperate webmethods.
The idea is that i have a class which is able to generate a code and also
able to make an image of this code.
Now i'd like to have 2 webmethods ; one which can be called to generate (and
return) the code and one to generate (and return) the image.
The problem im experiencing is that i first make an instance of this class,
then i call the first webmethod (generate code which works fine) after that i
call the second webmehod but instead of making an image out of the code i get
an error because it lost the code. If i place the call to the imagemaking
method in the first webmethod (together with the codegenerating call) it all
works.
Example :
Class UniqueCode
private string uniqueCode;
public void makeUniqueCode()
{
uniqueCode = blah blah my code to make an uniqueid;
}
public Bitmap makeImageFromCode()
{
blah blah my code to make an image of the uniqueCode string;
return uniqueCodeImage;
}
now the webservice :
UniqueCode test = new UniqueCode()
[WebMethod]
public String getCode()
{
string anyCode = test.MakeUniqueCode();
return anyCode;
}
[WebMethod]
public Bitmap getImage()
{
Bitmap testImage = test.makeImageFromCode();
return testImage;
}
any idea how i can solve my problem ? seems like some scope issue or
something, the instance of the class exists (with its global variable
uniquCode) during the call to the first webmethod but seems like it gets
reset befor the call to the second webmethod....