首页 文章

为什么动态更改 Webservice Url 后会出现异常?

提问于
浏览
1

在我的 webform 项目中,我让用户输入一个新的 WSDL URL。

我已经将 webservice 的属性设置为动态,并使用

service.url = strNewWebserviceUrl

但是当我尝试调用 webservice 的函数时,总会抛出以下错误:

System.Web.Services.Protocols.SoapException:可能的 SOAP 版本不匹配:信封命名空间http://schemas.xmlsoap.org/wsdl/是意外的。期待http://schemas.xmlsoap.org/soap/envelope/。 at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message,WebResponse response,Stream responseStream,Boolean asyncCall)at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object [7] parameters)at WebApplication2.EL8SceenService.ScreenService.executeScreen(OperationContext context,String msoName)in D:\ CSharp\WebApplication2TRY\WebApplication2\WebApplication2\Web References\EL8SceenService\Reference.cs:line

1 回答

  • 1

    根据错误消息,您似乎包含 URL 的?wsdl 部分而不是 Web 服务的直接 URL。

相关问题