关于 c#:HTTP 状态 400 尝试将 Web 服务引用添加到项目时

HTTP status 400 when trying to add web service reference to a project

我正在尝试将此 WCF 服务引用添加到我的 Visual Studio 2012 C# 项目中。当我尝试通过添加服务对话框加载服务时,我收到此错误

There was an error downloading
'https://api.onecallnow.com/WebService/3.1/soap.svc/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 400: Bad Request. Metadata
contains a reference that cannot be resolved:
'https://api.onecallnow.com/WebService/3.1/soap.svc'. Content Type
application/soap+xml; charset=utf-8 was not supported by service
https://api.onecallnow.com/WebService/3.1/soap.svc. The client and
service bindings may be mismatched. The remote server returned an
error: (415) Cannot process the message because the content type
'application/soap+xml; charset=utf-8' was not the expected type
'text/xml; charset=utf-8'.. If the service is defined in the current
solution, try building the solution and adding the service reference
again.

我查看了其他有关此错误的问题,但几乎所有问题都建议更改有关 WCF 服务配置的某些内容,而我无权访问。

有人建议消息的最后一部分意味着我使用的 SOAP 版本与服务使用的不同,但我在"添加 Web 服务"对话框中没有看到任何更改它的选项。

有人可以帮我正确添加此服务参考吗?


如果您在浏览器中访问该服务,您将看到以下内容:

enter

如果服务的所有者可以为您提供 WSDL 和其他元数据文件,您可以使用 ServiceModel 元数据实用工具 (SvcUtil.exe) 构建代理;否则他们可能有您可以使用的替代方法。

当然,假设该服务是供公众使用的。