我的Windows Server 2008 R2上有IIS7。我部署了WCF服務。當我在瀏覽器(本地或外部機器)中指定WCF服務地址時http://sbkisourcedev01/VCIndex/Calculator.svc?wsdl我正在瀏覽器中獲取服務描述。然而,當我試圖給項目添加到該服務我收到以下錯誤參考:WCF IIS服務器配置
The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading 'http://sbkisourcedev01/VCIndex/Calculator.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://sbkisourcedev01/VCIndex/Calculator.svc?wsdl'. Content Type application/soap+xml; charset=utf-8 was not supported by service http://sbkisourcedev01/VCIndex/Calculator.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.
我有這樣的服務在Windows 7上運行,它是好的。所以我相信我的W2K8 IIS配置設置有一些東西。
這裏是我的配置文件:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfig" />
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="serviceBehavior"
name="WCFVCIndex.Calculator">
<endpoint address=""
binding="basicHttpBinding"
contract="WCFVCIndex.ICalculator"
bindingConfiguration="basicHttpBindingConfig" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
在此先感謝。
謝謝,你剛剛救了我的一天! +1 –
你是怎麼做到的?你能提一下這些步驟嗎? – SamekaTV