I have a site on HTTPS which runs only on Internet Explorer (Because it's based on Silverlight) and previously it was on HTTP and I had a POS device which I used to send AJAX requests to initiate its Windows service.
Everything was working fine until HTTPS came up.
Problem when I request to initiate service which request would be like this:
function InitiateService(apiUrl, myJSON) {
console.log("JSONToInitiateService: ", myJSON);
$.ajax({
type: "POST",
contentType: "application/json",
data: null,
url: apiUrl + "/InitiateService1",
dataType: 'json',
data: myJSON,
success: function (result) {
console.log("initiate servise result: ", result);
},
error: function (result) {
console.log("initiate servise result: ", result);
}
});
}
and everything is same as before.
it returns:
[object Object]{readyState: 0, status: 0, statusText: "No Transport"}
and then I found 'No Transport' Error w/ jQuery ajax call in IE and I added:
$.support.cors = true;
to function and crossDomain: true,
to AJAX request.
Now it's saying error objects
I run Internet Explorer as administrator.
and I read CORS - cross domain POST to HTTP from HTTPS, but there weren't any valid answers.
and IIS Server manager doesn't have any certificates so certificates shouldn't be the problem.
Questions
By different pages, I couldn't induct that it's possible or not (based on same origin policy) to send AJAX request from HTTPS page to HTTP service?
If it's possible then without changing HTTP service how I can solve the problem?
now I found out, I can't use CORS (based on this article):
The server must support CORS and signal that the client’s domain is allowed to do so.