Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I bind WCF json to https with multiple bindings?

I am using WCF to bind webservices to SOAP and JSON. I must run ssl in production. I've bound the soap address to https, but I cannot figure out how to bind the JSON address to https. Here is my config.

<protocolMapping>
  <add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
  <service name="EnterpriseServices.Service.AuthorizationServiceBase">
    <endpoint address="soap" binding="basicHttpBinding" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
    <endpoint address="soap" binding="basicHttpsBinding" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
    <endpoint address="json" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="EnterpriseServices.Contracts.Authorization.IAuthorizationManagerBase" />
  </service>
...

Is there a protocolMapping I can add for my "json" endpoint that I can use to bind to https?

like image 351
Steve Avatar asked Jun 17 '26 06:06

Steve


1 Answers

Do you have the security mode set to Transport in your bindings?

<webHttpBinding>
  <binding name="jsonpSsl">
     <security mode="Transport" />
  </binding>
</webHttpBinding>

Check out this answer: WCF service with JSONP over SSL

like image 157
Boone Avatar answered Jun 20 '26 01:06

Boone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!