KSOAP2:如何使用HttpsTransportSE?

编程入门 行业动态 更新时间:2024-10-22 18:34:18
本文介绍了KSOAP2:如何使用HttpsTransportSE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开发一个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?

本文发布于:2023-10-09 06:15:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1474926.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   HttpsTransportSE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!