嗨我已經在服務器計算機上部署了WCF Web服務。我可以在瀏覽器中瀏覽它。但是當我去到它的服務引用到開發計算機上我的web應用程序我得到以下細節錯誤:無法訪問託管在服務器上的遠程WCF Web服務
在服務器Web.config中Metadata contains a reference that cannot be resolved: 'http://ServerMachineName:500/ITCAMSWebService_deploy/Services/Authentication.svc?wsdl'. The WSDL document contains links that could not be resolved. There was an error downloading 'http://ServerMachineName:500/ITCAMSWebService_deploy/Services/Authentication.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://ServerMachineName:500/ITCAMSWebService_deploy/Services/Authentication.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by service
http://ServerMachineName:500/ITCAMSWebService_deploy/Services/Authentication.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.
生成服務模型部分如下:
<system.serviceModel>
<services>
<service name="Authentication" behaviorConfiguration="Behavior_Authentication">
<host>
<baseAddresses>
<add baseAddress="http://ServerMachineName:500/ITCAMSWebService_deploy/Services/Authentication.svc"></add>
</baseAddresses>
</host>
<endpoint address="" contract="IAuthentication" binding="basicHttpBinding" bindingConfiguration="ITCAMSWebService.IAuthentication" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
</system.serviceModel>
如果您有權訪問服務器,請在wcf服務的配置中啓用跟蹤。它會告訴你到底發生了什麼問題。 –