2014-02-22 51 views
3

我正在嘗試將this WCF service reference添加到我的Visual Studio 2012 C#項目中。當我嘗試加載通過添加服務對話框的服務,我得到這個錯誤嘗試將Web服務引用添加到項目時的HTTP狀態400

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服務對話框。

有人可以幫助我正確添加此服務參考?

回答

5

如果你在瀏覽器中去的服務,你會看到以下內容:

enter image description here

服務擁有者停用了元數據發佈,所以你將不能夠通過添加,添加服務引用服務參考對話框。

如果服務的所有者可以爲您提供WSDL和其他元數據文件,可以使用ServiceModel Meatadata Utility Tool (SvcUtil.exe)建立一個代理;否則他們可能會有其他方法可以使用。

當然,假設這項服務是爲公共消費而設計的。

+0

是的,我花了很長時間才發現沒有元數據發佈就無法使用服務。 –

相關問題