Archived Forum Post

Index of archived forum posts

Question:

How to use SSL in SOAP Example?

Dec 28 '12 at 10:34

I used gsoap to access my ws (SSL), now that I have CHILKAT,I would like know, if have any way to use SSL in this sample:

http://www.example-code.com/vcpp/http_soap.asp


Answer

Yes, it is very easy. Change the following code fragment from this:

    const char * domain;
    long port;
    bool ssl;
    domain = "www.webservicex.net";
    port = 80;
    ssl = false;
    CkHttpResponse *resp = 0;
    resp = http.SynchronousRequest(domain,port,ssl,req);
to this:
    const char * domain;
    long port;
    bool ssl;
    domain = "www.webservicex.net";
    port = 443;
    ssl = true;
    CkHttpResponse *resp = 0;
    resp = http.SynchronousRequest(domain,port,ssl,req);