We have a SSL configured website that hosts a WCF-service. The service's binding has crossDomainScriptAccessEnabled="true"
and communication is serialized using JSON.
When we request this service from http it returns JSONP but when it is requested using HTTPS it returns just JSON. I need to have JSONP in either way, please help.
Current configuration is like this:
<webHttpBinding>
<binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
<behaviors>
<serviceBehaviors>
<behavior name="JsonServiceBehaviors">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors><behavior name="webHttpBehavior">
<webHttp />
</behavior></endpointBehaviors>
</behaviors>
<services>
<service name="Backend.CIService" behaviorConfiguration="JsonServiceBehaviors">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="webHttpBindingWithJsonP" contract="Backend.ICIService"
behaviorConfiguration="webHttpBehavior"/>
</service></services>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…