Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KSOAP2: How to use HttpsTransportSE?

Tags:

android

ksoap2

I am developing a android app to communicate with an web service that requires an SSL connection. To do that, I want to use HttpsTransportSE, but I can't find tutorials about how to use that class. I am trying to build a new instance, but I don't know exactly the info I must pass to the constructor. A line of my code:

HttpsTransportSE httpsTransport = new HttpsTransportSE("address", port, ????, timeout);

What string should be at ???? place?

If I replace ???? by "" or null, an IOException occurs. I think ???? should be the client certificate. Is that right? Does anybody have a tutorial about HttpsTransportSE? Any useful link?

like image 759
user959571 Avatar asked Dec 17 '22 09:12

user959571


1 Answers

This code from the HttpsTransportSE should help:

public HttpsTransportSE (String host, int port, String file, int timeout) {
    super(HttpsTransportSE.PROTOCOL + "://" + host + ":" + port + file);
    this.host = host;
    this.port = port;
    this.file = file;
    this.timeout = timeout;
}

So to hit https://MyServer:8080/MyService You call:

HttpsTransportSE("MyServer", 8080, "/MyService", timeout);
like image 199
Marty Cullen Avatar answered Jan 11 '23 21:01

Marty Cullen