calling https wcf service from silverlight

孤街浪徒 提交于 2019-12-06 20:38:49

You need a separate domain node for https:

 <domain uri="https://*" />

From this post:

http://timheuer.com/blog/archive/2008/10/14/calling-secure-services-with-silverlight-2-ssl-https.aspx

mdm20

If the service and the silverlight app are served from the same web site and you are using Silverlight 4, you can accomplish this without a cross domain policy file by:

  • Accessing the silverlight application through https
  • Using a relative address in the ServiceReferences.ClientConfig file to access the service
  • Using transport mode security in the BasicHttpBinding for the service.

Here's an example of the ServiceReferences.ClientConfig:

<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IMyService" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                  <!--Transport mode security (setup the same way on the server):-->
                    <security mode="Transport" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
          <!--Relative address (This is the part that requires SL4):-->
            <endpoint address="../Services/MyService.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService"
                contract="MyApplication.MyService" name="BasicHttpBinding_IMyService" />
        </client>
    </system.serviceModel>
</configuration>
Kon

Have you looked here?

Calling WCF Service from Silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!