Although this is a dead question from 2 years ago, I would still like to answer it as this is my first related search result when I encounter the exact same problem.
The WSDL file generated via .asmx?wsdl has an attribute
elementFormDefault=qualified
within it's schema tag, which forces the clients to add a namespace prefix to all input element if they were to successfully pass their input to server. (If the client ignore the namespace prefix regardless, the server will receive empty request with no input).
Since in my case my client could not generate a qualified soap request no matter what, I have to change on server side.
The way you do it is to add
[XmlElement(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
in front of every input parameter for every web method:
[WebMethod]
public string TestMethod(
[XmlElement(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]string input1,
[XmlElement(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]int input2)
{
/***code here****/
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…