来自我的silverlight 4.0应用程序。我可以轻松访问WCF文件,但当移动到https时,我无法访问WCF服务。错误详情如下:
An unknown error occurred. Please contact your system Administrator for more information.
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at FileSearch.SearchServices.GetTypeofFileDetailedCompletedEventArgs.get_Result()
at FileSearch.Home.<SearchButton_Click>b__0(Object s, GetTypeofFileDetailedCompletedEventArgs ea)
at FileSearch.SearchServices.SearchServiceClient.OnGetTypeofFileDetailedCompleted(Object state)
我已经看过关于这个问题的不同帖子,但没有任何东西指向我正确的方向。
以下是有关承载silverlight应用程序以及WCF服务的Web应用程序的web.config文件的详细信息。
<services>
<service name="FileSearch.Web.Services.SearchService">
<endpoint address="" binding="customBinding" bindingConfiguration="FileSearch.Web.Services.SearchService.customBinding0" contract="FileSearch.Web.Services.SearchService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
这是servicerefernce.clientconfig文件:
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_SearchService">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="../Services/SearchService.svc"
binding="customBinding" bindingConfiguration="CustomBinding_SearchService"
contract="SearchServices.SearchService" name="CustomBinding_SearchService" />
</client>
</system.serviceModel>
</configuration>
更新
我收到了仅在https模式下运行服务的答案。我想在http和https模式下运行该服务。
关于这个的任何想法?
答案 0 :(得分:2)
指定两个端点,一个带有安全传输,另一个带有安全传输。
答案 1 :(得分:1)
答案 2 :(得分:0)
要支持Https计划,您需要将传输更改为<httpsTransport>.
我看到您正在使用<httpTransport>.