I had got this error after changing the web service return type and SoapDocumentMethod.
Initially it was:
[WebMethod]
public int Foo()
{
return 0;
}
I decided to make it fire and forget type like this:
[SoapDocumentMethod(OneWay = true)]
[WebMethod]
public void Foo()
{
return;
}
In such cases, updating the web reference helped.
To update a web service reference: