Calling a web service from http to https

笑着哭i 提交于 2019-12-11 08:39:25

问题


Here is my scenario...

I'm working on a server that is http:// in Classic ASP

The company purchased a web service that verifies information, this web service is https://xxx.svc?etc

What can I do to call this service? I've tried AJAX with jQuery, I've tried XmlHTTPRequest and XDR, and I'm just about out of ideas. I'm running into the same error every time.."Access Denied" when I call "open" on my object. I've heard a few things about Same Domain policies and Cross Site Scripting, but it's 2012 now. Is there any way to accomplish this?


回答1:


You are running into cross domain issues.

Setup a server side page that communicates with the webservice through the ServerXMLHttp object. Read more about this here.

You could then process the request server side or make use of JavaScript to make an AJAX request to your server side page. Since it will be on the same domain, you will not run into cross domain issues.




回答2:


2 suggestions...

Have you looked at JSONP: http://en.wikipedia.org/wiki/JSONP

Or you could call the service on the server side…



来源:https://stackoverflow.com/questions/10609639/calling-a-web-service-from-http-to-https

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!