问题描述
其中红色字体部分是第三方应用系统需要添加的Header部分为业主调用参考http://bbs.csdn.net/topics/390347215这个地址的代码之后publicclassSoapHeader{///<summary>///构造一个SOAP头///</summary>publicSoapHeader(){this.Properties=newDictionary<string,object>();}///<summary>///构造一个SOAP头///</summary>///<paramname="className">SOAP头的类名</param>publicSoapHeader(stringclassName){this.ClassName=className;this.Properties=newDictionary<string,object>();}///<summary>///构造一个SOAP头///</summary>///<paramname="className">SOAP头的类名</param>///<paramname="properties">SOAP头的类属性名及属性值</param>publicSoapHeader(stringclassName,Dictionary<string,object>properties){this.ClassName=className;this.Properties=properties;}///<summary>///SOAP头的类名///</summary>publicstringClassName{get;set;}///<summary>///SOAP头的类属性名及属性值///</summary>publicDictionary<string,object>Properties{get;set;}///<summary>///为SOAP头增加一个属性及值///</summary>///<paramname="name">SOAP头的类属性名</param>///<paramname="value">SOAP头的类属性值</param>publicvoidAddProperty(stringname,objectvalue){if(this.Properties==null){this.Properties=newDictionary<string,object>();}Properties.Add(name,value);}}以上是类WSHelper.SoapHeadersoapHeader=newWSHelper.SoapHeader();soapHeader.ClassName="authInfo";soapHeader.AddProperty("userId","jyjg");soapHeader.AddProperty("password","JYJG9wzg");string[]args=newstring[1];args[0]=TextBox1.Text;objectresult=WSHelper.InvokeWebService(url,"getUserById",soapHeader,args);这样调用包头对吗returnmi.Invoke(obj,args);最后执行语句出错
解决方案
解决方案二:
这个参考代码