开发者

How do I make calls to a WCF service with jquery ajax from an SSL-secured page?

I have a WCF service returning JSON to jQuery ajax calls and presenting the results on an ASPX page. When the page is NOT under SSL, the ajax calls work perfectly. When the page IS under SSL, the calls fail. I understand that this behavior must be due to the Same Origin Policy (SOP).

So, how do I setup my WCF service to accept calls from an SSL-secured page? Does the WCF service also 开发者_StackOverflow社区need to be secured? If so, how do I do this?

Thanks,

Joe


If the problem is SOP, could you host the JSON services on the same server as the ASPX pages?

It may be that it is a browser setting which blocks a combination of SSL and non-SSL content.


you have to make sure that the browser has a valid certificate for the web service end point.

what happens when you fire up a javascript editor within your browser, and make a call to the web service? do you get any specific errors back?

in firefox, install "firebug" if you haven't already. look at your ajax calls and see what headers are returned from the server. specifically the status code. than you can be sure which part of your call is failing and with what error


Just wanted to post a follow up on this. It was so long ago that I can't remember if I actually figured out the cause, but in the end I realized that the data in my calls wasn't of a critically scure nature anyway. No user data was being passed. So, I just ran the page without SSL and my AJAX calls worked just fine. Sorry for no real resolution in this for anyone that was wondering! :(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜