怎么解决这个报错( 试图创建 System.Web.Services.Protocols.SoapHttpClientProtocol 的实例时发生异常。异常为“代理类上需要 WebServi
xx.asmx.cs的代码如下:
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------
//
// 此源代码由 wsdl, Version=1.1.4322.2032 自动生成。
//
namespace SystemManageOperator
{
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SystemManageOperatorSoapBinding", Namespace="http://webservice.interfaces.bmcc.com")]
public class SystemManageOperatorService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
/// <remarks/>
public SystemManageOperatorService()
{
this.Url = "http://localhost:9080/webserviceServer/services/SystemManageOperator";
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://webservice.interfaces.bmcc.com", ResponseNamespace="http://webservice.interfaces.bmcc.com", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("healthCheckReturn", IsNullable=true)]
[WebMethod]
public BizResp healthCheck([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] ReqHeader reqHeader)
{
object[] results = this.Invoke("healthCheck", new object[] {
reqHeader});
return ((BizResp)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginhealthCheck(ReqHeader reqHeader, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("healthCheck", new object[] {
reqHeader}, callback, asyncState);
}
/// <remarks/>
public BizResp EndhealthCheck(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((BizResp)(results[0]));
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://req.webservice.interfaces.bmcc.com")]
public class ReqHeader
{
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string appid;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string reqno;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string reqtime;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string ver;
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://resp.webservice.interfaces.bmcc.com")]
public class RespHeader
{
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string appid;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string respcode;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string respmsg;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string respno;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string resptime;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string srcreqno;
}
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://resp.webservice.interfaces.bmcc.com")]
public class BizResp
{
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public RespHeader respheader;
}
}
--------------------------------------------------------
在最后一句[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
上说没这个方法,不能知道是什么麻烦?高手帮忙调试一下,多谢!!!!!