在android中调用webservice

发布于 2024-11-19 03:00:09 字数 165 浏览 4 评论 0原文

在不使用 Ksoap2 的情况下通过 android 应用程序调用 axis webservice(已经在我的机器上运行)的过程是什么?

我想使用 apache http 库中默认提供的 HttpClient 调用来实现 Web 服务调用。传递 Web 方法名称的过程是什么?

问候。

What is the procedure to call axis webservice(already running on my machine) through android application without using Ksoap2.

I want to implement the web service call using the HttpClient calls provided by default in apache http library. What is the procedure to pass the web method names.

Regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

儭儭莪哋寶赑 2024-11-26 03:00:09

在这种情况下,您应该实现简单的 Java 客户端(Android 之外)来调用 Axis 中托管的服务,并使用 Fiddler 或其他 HTTP 代理来捕获您需要调用 Axis 服务的确切请求以及您将获得的准确响应。基于这两个 XML,您可以在 android 中构建请求,还可以构建逻辑以从响应中提取数据。如果没有现有的请求和响应,如果您的 Axis 服务使用安全性,您可以去研究 WSDL、XSD、SOAP 1.1 或 1.2 以及其他一些规范(但在这种情况下,即使 kSoap2 也无法帮助您)。如果没有这些知识,您几乎无法从头开始构建正确的请求。

没有理由回避 kSoap2。如果不使用 kSoap2,您的代码只会更容易出错且更复杂。

In such case you should implement simple Java client (outside of Android) to call your service hosted in Axis and use Fiddler or other HTTP proxy to capture exact request you need to call on Axis service and exact response you will get. Base on these two XMLs you can build your request from in android and also build logic to extract data from response. Without existing request and response you can go and study WSDL, XSD, SOAP 1.1 or 1.2 and also some other specifications if your Axis service uses security (but in such case even kSoap2 will not help you). Without that knowledge you can hardly build correct request from scratch.

There is no reason to avoid kSoap2. Doing it without kSoap2 will make your code only more error prone and more complicated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文