KSOAP2:如何使用HttpsTransportSE?

use*_*571 4 android ksoap2

我正在开发一个Android应用程序来与需要SSL连接的Web服务进行通信.要做到这一点,我想使用HttpsTransportSE,但我找不到有关如何使用该类的教程.我正在尝试构建一个新实例,但我不确切知道我必须传递给构造函数的信息.我的代码行:

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

什么字符串应该在???? 地点?

如果我更换???? 通过""或null,发生IOException.我认为 ????应该是客户证书.是对的吗?有人有关于HttpsTransportSE的教程吗?任何有用的链接?

小智 12

来自HttpsTransportSE的代码应该有所帮助:

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;
}
Run Code Online (Sandbox Code Playgroud)

所以点击https:// MyServer:8080/MyService 你打电话:

HttpsTransportSE("MyServer", 8080, "/MyService", timeout);
Run Code Online (Sandbox Code Playgroud)