I have a WCF service that I need to run over SSL, I am calling it from a webpage (using jQuery) which may or may not be a secure page. The problem is, if I make the call from a secure webpage on my site, the call runs exactly how I would expect...however, if I make the call from a non-secure page on my site, to the secure web service (using "https://" ;) ) it returns null data (via Firebug). Anything I'm missing? Is this even possible?
Here is the configuration of the service I'm calling (I'm more than happy to provide more stuff if needed):
<behaviors>
<endpointBehaviors>
<behavior name="AspNetAjaxBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="ClientServices.Membership" behaviorConfiguration="ServiceGatewayBehavior">
<endpoint address="" behaviorConfiguration="AspNetAjaxBehavior" bindingConfiguration="SecureBinding"
binding="webHttpBinding" contract="ClientServices.Membership" />
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="SecureBinding">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
Here is the code that calls the service:
$.ajax({
url: serviceUrl,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: '{"review":{"Username":"' + username + '"}}',
success: function (data) {
$.log(data);
},
error: function (a, b, c) {
$.log(b);
},
cache: false
});
UPDATE
If I change the service call method to "GET" and call it directly over SSL it works fine and outputs the jSon that I would expect. It's only inside the non-secure page where the problem persists.