我开发一个Android应用程序与要求SSL连接的Web服务进行通信。为了做到这一点,我想用HttpsTransportSE,但我找不到有关如何使用该类教程。 我想建立一个新的实例,但我不知道确切的信息,我要传递给构造函数。 A线我的code:
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 =新HttpsTransportSE(地址,端口,????,超时);
HttpsTransportSE httpsTransport = new HttpsTransportSE("address", port, ????, timeout);
应该在什么字符串????地方?
What string should be at ???? place?
如果我更换????通过或为空,一个IOException发生。 我想 ????应客户端证书。是对的吗? 没有任何人有一个关于HttpsTransportSE教程?任何有用的链接?
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?
推荐答案从HttpsTransportSE这code应该帮助:
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; }
所以打 https://开头要播:8080 /为MyService 你叫:
HttpsTransportSE("MyServer", 8080, "/MyService", timeout);更多推荐
KSOAP2:如何使用HttpsTransportSE?
发布评论