我有一个通过 SSL(https) 托管的 WCF 服务,其 web.config 如下所示:
<system.serviceModel>
<services>
<service name="MyProject.HTMLService" behaviorConfiguration="HTMLServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="https://someip/HTMLService.svc"/>
<add baseAddress="https://hostname/HTMLService.svc"/>
</baseAddresses>
</host>
<endpoint address="" binding="webHttpBinding" bindingConfiguration="https" contract="MyProject.IHTMLService"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="https">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="HTMLServiceBehavior">
<serviceMetadata httpsGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
ClientAccessPolicy.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="http://*"/>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
当我尝试将服务引用添加到我的 silverlight 4 应用程序中时,会生成所有必需的文件,但 ServiceReferences.ClientConfig 文件仅包含标记。此外,configuration.svcinfo 和 configuration91.svcinfo 文件没有 Bindinds、EndPoints 和 Behavior 配置。
如何解决这个问题?谢谢..