Hello everyone!
i am trying to pass string str to method getNetworkOffers. when checking radio2
i wait to be returned 1. However 0 is returned.
can you see any mistakes? i suppose that str is not passed. Can you help?
thanks
private void pricesButton_Click(object sender, EventArgs e)
{
String str = "";
localhost.Service wsConvert = new localhost.Service();
string chooseService = System.Convert.ToString(serviceTextBox.Text);
if (net2.Checked)
{
str = "red";
resultLabel1.Text = "Price for downloading " + chooseService + "=" + wsConvert.getNetworkOffers(str, chooseService).ToString();
resultLabel2.Text = "Price for uploading " + chooseService + "=" +
wsConvert.getNetworkOffers(str, chooseService).ToString();
}
}
This is the webMethod
[System.Web.Services.WebMethod()]
public double getNetworkOffers(string network, string service)
{
if ( network.Equals("red"))
{
//if (service.Equals("voice"))
return 1;
}
else
{
return 0;
}
}
Jan MontanoPosted Jan 26, 2009, 10:02 PM
My guess is that you're having an issue with the cache not being refreshed. Just to be sure, try making a new web method with the exact signature and the exact code. just a different name (getNetworkOffers1). and call that newly created method instead.
// e.g. this should definitely return 1 if your network = 1.
public double getNetworkOffers1(string network, string service)
{
if ( network.Equals("red"))
{
//if (service.Equals("voice"))
return 1;
}
else
{
return 0;
}
}