public class RequestSOAPHeader : System.Web.Services.Protocols. SoapHeader
{
public string user { getset}
public string password { getset}
}
生成的WebService代理类中设置成属性成员:
public partial class ISysNotifyTodoWebServiceService
{
public RequestSOAPHeader RequestSOAPHeader { getset}
}
在访问的WebService方法上方添加SOAPHeader的声明:
[System.Web.Services.Protocols. SoapDocumentMethodAttribute( "", RequestNamespace="http://webservice.notify.sys/" , ResponseNamespace="http://webservice.notify.sys/" , Use=System.Web.Services.Description.SoapBindingUse .Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle .Wrapped)]
[ return: System.Xml.Serialization. XmlElementAttribute( "return", Form=System.Xml.Schema.XmlSchemaForm .Unqualified)]
[ SoapHeader( "RequestSOAPHeader")]
public notifyTodoAppResult setTodoDone([System.Xml.Serialization.XmlElementAttribute (Form=System.Xml.Schema.XmlSchemaForm .Unqualified)] notifyTodoRemoveContext arg0) {
object[] results = this.Invoke( "setTodoDone", new object[] {
arg0})
return (( notifyTodoAppResult)(results[0]))
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)