2011-12-12 69 views
0

我創建了一個簡單的WCF服務,並託管在其IIS的位置http://localhost/EssentialWCFIISService/service.svc不能得到服務引用了WCF

如果我在Web瀏覽器中打開這個網址的服務畫面顯示了罰款,給我這個地址,使用svcutil.exe文件 - http://localhost/EssentialWCFIISService/service.svc?wsdl

於是我創建了一個基本的客戶端應用程序,並單擊添加服務引用並將該地址放入出現的對話框中。但是我收到以下錯誤:

An existing connection was forcibly closed by the remote host Metadata contains a reference that cannot be resolved: 'http://localhost/EssentialWCFIISService/service.svc?wsdl'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost/EssentialWCFIISService/service.svc?wsdl . 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.

從周圍的Googling我發現有幾個人有這個問題,人們的意見常常說,沿着「更改客戶端的綁定,以匹配服務器的綁定」線的東西... ..但是我甚至不在這個階段,我的客戶中根本沒有任何約束力,因爲這是一個空的項目。任何想法最新怎麼了?

+0

您是否在您的(WCF)web.config中爲結束點指定了binding和bindingCongifuration?發佈你的配置;很多時候這些只是你配置文件中的問題。 – hawkke

+0

在這裏找到答案 - http://stackoverflow.com/questions/6213956/svcutil-problem-with-wcf-service-hosted-in-iis-7-5 –

回答

0

添加服務參考時不要包含?wsdl