简体   繁体   English

如何更改SoapHttoClientProtocol对象的URL?

[英]How do I change the URL of a SoapHttoClientProtocol object?

I received some code from a client containg a wsdl.exe generated SoapHttpClientProtocol sub-class for us to access. 我从包含wsdl.exe生成的SoapHttpClientProtocol子类的客户端接收了一些代码,供我们访问。 I altered the code as follows: 我将代码更改如下:

public WebService(string url, bool useDefaultCredentials)
{
   this.Url = url;
   this.UseDefaultCredentials = useDefaultCredentials;
}

The client changed the URL for the web-service so we changed the config to match, unfortunately it still appears to be hitting the old URL. 客户端更改了Web服务的URL,因此我们更改了配置以使其匹配,但不幸的是,它似乎仍然是旧的URL。

The code contains several attributes referencing the old web service. 该代码包含引用旧Web服务的几个属性。 Specifically a WebServiceBindingAttribute with a Namespace parameter set to the old .asmx file and a SoapDocumentMethodAttribute with the Action parameter set to the old URL and the RequestNamespace parameter set to the old .asmx file. 具体来说,将WebServiceBindingAttributeNamespace参数设置为旧的.asmx文件,将SoapDocumentMethodAttributeAction参数设置为旧的URL,将RequestNamespace参数设置为旧的.asmx文件。 Could these be the problem? 这些可能是问题吗?

从客户端更新:看起来除了更改Web服务的位置以外,他们还更改了SOAP方法的命名空间,从而破坏了自动生成的[SoapDocumentMethod]属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM