我是wcf的新手。我創建並承載了簡單的wcf服務iis 7.5使用教程http://debugmode.net/2010/09/07/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5/在IIS7.5上託管WCF服務
一切正常,直到我試圖使用此服務。當我嘗試在我的客戶端添加服務引用它給了以下錯誤
Metadata contains a reference that cannot be resolved: 'http://localhost:4567/Service1.svc?wsdl'. The WSDL document contains links that could not be resolved. There was an error downloading 'http://localhost:4567/Service1.svc?xsd=xsd0'. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host Metadata contains a reference that cannot be resolved: 'http://localhost:4567/Service1.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:4567/Service1.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.
我服務的web.config文件中包含
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
客戶端的wcf配置是什麼? –
客戶端沒有wcf配置。在客戶端我mux試圖添加服務參考 – yrahman