Ok I had one WebMethod in my web service which is working fine.
Then I wanted to add another one where I want to send whole object but when I trying to call this method from Windows Form its says method missing?
WebService code:
{
[WebMethod]
public int getNumber(int n)
{
return n * n * 100;
}
[WebMethod]
public string GetValues(string value)
{
return "OK";
}
}
Client code:
private void button1_Click_1(object sender, EventArgs e)
{
localhost.Service1 service2 = new localhost.Service1();
metadata detective = new metadata();
detective.CrimeID = txtCrimeID.Text;
detective.InvestigatorID = txtInvestID.Text;
detective.DataArtefactID = txtDataID.Text;
service2. **<== when I type here GetValues = "Menu.localhost.Service1 does not contain definition for GetValues"**
}
But if straight after “service2.” i will start typing get, then method getNumber will be displayed as a possible choice. I dont uderstand Why one method is working fine but another one looks like not exist?
After modifying the webservice, the changes will not propogate to your winforms application until you update the reference to it. The available methods are stored in meta-data for the service when the reference is created.
Update your service reference.