eMi
eMi

Reputation: 1

Webservice Call HTTPS

I am trying to make an https call to a web-service using XMLHttpRequest object in javascript. i successfully made a regular http call but having trouble getting the https working. The https call requires an ssl cert so any ideas how to attach the cert for this call ?

    url2="https://myServer/axis2/webService/...";        
envelope2 =
        '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">' +
           '<soap:Header/>' +
           '<soap:Body>' +
                        .....
           '</soap:Body>' +
        '</soap:Envelope>';

.. then

 xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-Type", "application/soap+xml;charset=UTF-8;action=\"urn:getProjectInfo\"");
    xmlHttp.setRequestHeader("Content-Length", len);
    xmlHttp.setRequestHeader("SOAPAction", "urn:getProjectInfo");

the problem is how to handle the ssl keystore to make the call ... thanks for any help/insight

Upvotes: 0

Views: 2162

Answers (1)

Jordan
Jordan

Reputation: 32532

You don't attach a cert for the call. You have to install the SSL cert on the server this is running on. If the SSL cert is installed, then the call will work simply by making it HTTPS.

Like Pekka referred to, you will run into a same-origin-policy issue if the page you are making the request from is not the exact same domain: in this case "https://myserver/" (capitalization is not important).

Upvotes: 1

Related Questions