我们有一个负载均衡服务器,可以将客户端请求定向到IIS 8,Windows 2012下托管微型wcf服务的2个底层服务器之一。
客户" 我们公司的网络"得到例外"仅#34;当他们尝试添加服务参考"在.NET客户端到wcf服务。该请求通过HTTPS安全。
在公司网络上添加引用成功,并且,当在公司网络外部的浏览器中浏览相同服务的URL(https://myhost.com/WcfServices/MyService.svc?WSDL)时,它不会给出任何例外并像往常一样显示服务合同。
以下是他们尝试添加引用时的例外情况。
网址https://myhost.com/WcfServices/MyService.svc处的文档未被识别为已知文档类型。 每种已知类型的错误消息可以帮助您解决问题: - 来自' XML Schema'的报告是'文档格式无法识别(内容类型为' text / html; charset = UTF-8')。'。 - 来自' https://myhost.com/WcfServices/MyService.svc'的报告是'文档格式无法识别(内容类型为' text / html; charset = UTF-8')。'。 - 来自' DISCO Document'的报告这个XML文档中禁止使用DTD。'。 - 来自' WSDL文件的报告'是'文档格式无法识别(内容类型为' text / html; charset = UTF-8')。'。 元数据包含无法解析的引用:' https://myhost.com/WcfServices/MyService.svc'。 元数据包含无法解析的引用:' https://myhost.com/WcfServices/MyService.svc'。 如果在当前解决方案中定义了服务,请尝试构建解决方案并再次添加服务引用。
这是我的web.config文件的样子..
<system.serviceModel>
<diagnostics performanceCounters="All" />
<service behaviorConfiguration="WcfServices.MyServiceBehavior"
name="WcfServices.MyService">
<endpoint address="" binding="wsHttpBinding" contract="WcfServices.IMyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfServices.Service1Behavior">
<serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"
maxConcurrentInstances="1000" />
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="WcfServices.MyServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="LargeSizeMessages"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas
maxDepth="32"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
</wsHttpBinding>
</bindings>
我花了无数个小时尝试了一系列在互联网上发现的建议......遗憾的是没有人解决这个问题。这里有什么问题?任何帮助都非常感谢!!!