http and https support in one .xap file
-
Tuesday, December 13, 2011 11:27 PM
The project I am working on will end up running in sites on about 60 different servers. I want to use trusted in browser suport to add extra features for sites that decide to use https, but don't want to break the services for sites that still use http. Can I make one .xap file that the services will still work for if it uses http instead of https and has Trusted in browser ticked?
All Replies
-
Wednesday, December 14, 2011 2:50 AM
You can try to call protocol-less. So change the url to //bla.com/service.svc instead of http://bla.com/service.svc or https://bla.com/service.svc. It should automatically pickup the correct protocol, at least that's how it works in Javascript / Browser.
-
Wednesday, December 14, 2011 3:10 AM
Hi,
I create the default proxy and then modify the Binding eg.
replace the HttpTransportBindingElement with HttpsTransportBindingElement.
Regards,
Ladislav
-
Wednesday, December 14, 2011 8:25 AM
See my post here for an example web.config that allows http and https comunication over wcf services:
See this post for an example of a silverlight helper class to intialize the service bingdings correctly:

