SL4/WCF 不支持 HTTPS
我需要帮助尝试在生产服务器上使用 https 获取 SL4/WCF 应用程序。该应用程序使用 http 可以完美运行,并且使用 https 时,它将加载 xap 并显示登录页面,但在尝试进行身份验证或进行 wcf 调用时出现一般错误:
“操作期间发生异常,导致结果无效。检查 InnerException 以获取异常详细信息。”
“[发生异步异常] 论据: 调试资源字符串不可用。通常,键和参数提供了足够的信息来诊断问题。请参阅 http:// go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60310.0&File=System.dll&Key=Async_ExceptionOccurred”
环境为 SL4 - MVVM、IIS7、Basic WCF、Silverlight 故障行为类,并使用 Asp.net 成员资格提供程序进行身份验证。网站和服务位于同一目录中,所以我认为不存在跨域问题 - 该网站确实使用 http 工作,并且 fiddler 没有显示丢失的 clientaccesspolicy.xml 文件 - 尽管我已经安装了该文件。 XAP 加载后,Fiddler 不会提供任何线索或流量。我还可以在使用 https 时直接浏览并访问该服务。
任何帮助或建议将不胜感激。 谢谢, 最大限度。
这是 web.config:
<extensions>
<behaviorExtensions>
<add name="silverlightFaults" type="Accruit.RidgeLine.Behaviors.SilverlightFaultBehavior, Accruit.RidgeLine.Behaviors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
<behaviors>
<serviceBehaviors>
<behavior name="silverlightBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="true" />
</behavior>
<behavior name="">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" httpsHelpPageEnabled="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="SilverlightFaultBehavior">
<silverlightFaults />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="Accruit.RidgeLine.Web.BankingService" behaviorConfiguration="silverlightBehavior" >
<!-- Endpoint for Standard SOAP clients -->
<endpoint address="" contract="Accruit.RidgeLine.Web.IBankingService"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"/>
<!-- Endpoint for Silverlight clients -->
<endpoint address="SilverlightEndPoint" contract="Accruit.RidgeLine.Web.IBankingService"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService_SilverlightEndPoint"
behaviorConfiguration="SilverlightFaultBehavior" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<client>
<endpoint address="https://domainname.com/BankingService.svc"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"
contract="BankingService.IBankingService" name="BasicHttpBinding_IBankingService" />
<endpoint address="https://domainname.com/BankingService.svc/SilverlightEndPoint"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"
contract="BankingService.IBankingService" name="basicHttpBinding_IBankingService_SilverlightEndPoint" />
</client>
I need help trying to get an SL4/WCF app using https on a production server. The app works perfect using http, and with https it’ll load the xap and display the login page, but I get a generic error when trying to authenticate or make wcf calls:
“An exception occurred during the operation, making the result invalid. Check InnerException for exception details.”
“[Async_ExceptionOccurred]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60310.0&File=System.dll&Key=Async_ExceptionOccurred”
The environment is SL4 - MVVM, IIS7, Basic WCF, Silverlight fault behavior class, and authentication using the Asp.net membership provider. The website and services are located in the same directory, so I don’t think there’s a crossdomain issue – the site does work using http and fiddler doesn’t show a missing clientaccesspolicy.xml file – although I have that file installed anyways. Fiddler doesn’t provide any clues or traffic after the xap has loaded. I can also browse to and access the service directly while using https.
Any help or suggestions would be appreciated.
Thanks,
Max.
Here’s the web.config:
<extensions>
<behaviorExtensions>
<add name="silverlightFaults" type="Accruit.RidgeLine.Behaviors.SilverlightFaultBehavior, Accruit.RidgeLine.Behaviors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
<behaviors>
<serviceBehaviors>
<behavior name="silverlightBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="true" />
</behavior>
<behavior name="">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" httpsHelpPageEnabled="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="SilverlightFaultBehavior">
<silverlightFaults />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="Accruit.RidgeLine.Web.BankingService" behaviorConfiguration="silverlightBehavior" >
<!-- Endpoint for Standard SOAP clients -->
<endpoint address="" contract="Accruit.RidgeLine.Web.IBankingService"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"/>
<!-- Endpoint for Silverlight clients -->
<endpoint address="SilverlightEndPoint" contract="Accruit.RidgeLine.Web.IBankingService"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService_SilverlightEndPoint"
behaviorConfiguration="SilverlightFaultBehavior" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<client>
<endpoint address="https://domainname.com/BankingService.svc"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"
contract="BankingService.IBankingService" name="BasicHttpBinding_IBankingService" />
<endpoint address="https://domainname.com/BankingService.svc/SilverlightEndPoint"
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IBankingService"
contract="BankingService.IBankingService" name="basicHttpBinding_IBankingService_SilverlightEndPoint" />
</client>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了我的评论之外,还有一些需要查看的内容:
这里有很棒的链接 ,检查 sladapters 帖子。
这是Silverlight 部署指南< /a>,最近刚刚推出,可从 MS 获得。那里有相当扎实的东西。
我遇到的许多问题都与 ServiceReference.ClientConfig 文件中为本地计算机编码的端点地址有关。我保留了一份开发副本&我的解决方案中的部署副本。鉴于您可以导航到该服务,因此这里可能引用了错误......
In addition to my comment, here's a few things to check out:
Great link here, check sladapters post.
Here is the Silverlight Deployment Guide, which just launched recently and is available from MS. Pretty solid stuff there.
A lot of the issues I've run into have to do with the endpoint addresses being coded for the local machine in your ServiceReference.ClientConfig file. I keep a dev copy & a deploy copy in my solutions. Given the fact that you can navigate to the service, it's probably being referenced wrong here...
该应用程序是使用 Silverlight Web 项目中包含的 wcf 服务构建的,并且还使用 Uri(Application.Current.Host.Source, "..") 以编程方式覆盖绑定 uri。我将 wcf 服务分离到它们自己的中项目并删除了 uri 代码(这导致了防火墙和 dsn 访问问题,因为 443 被转发到另一个端口),但使用自签名 ssl 证书时仍然遇到问题,因此我们必须在 Silverlight 客户端之前购买有效的证书。与 wcf 服务通信。
The app had been built with the wcf services included in the Silverlight web project and the binding uri was also being programmatically overridden using Uri(Application.Current.Host.Source, "..”). I separated out the wcf services into their own project and removed the uri code (which caused firewall and dsn access issues because 443 was being forwarded to another port). I still had issues using a self-signed ssl certificate though, so we had to purchase a valid one before the Silverlight client would communicate with the wcf service.