问题标签 [android-ksoap2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
678 浏览

android - ksoap2-android 客户端在 [KeepAlive]HttpsTransportSE.call() 内抛出 FileNotFoundException

我正在尝试创建一个 Android (2.2) SOAP 客户端以连接到 SQL Server 2005 XML Web 服务端点(当然这需要身份验证)。我的 SQL Server 端点似乎已启动并正在运行(这是一个简单的函数,它接受一个字符串 (varchar(20)) 并返回另一个字符串;URL "https://10.1.1.20:444/dt2?wsdl" 正确返回WSDL XML。(我没有在我的连接字符串中使用 URL 的“?wsdl”部分;我只是提到它来表明 Web 服务工作正常。)

一切似乎都运行良好,直到我在对 KeepAliveHttpsTransportSE.call() 的调用中(使用 ksoap2-android 2.5.4),并到达 HttpTransportSE.class:150,其中调用了 (ServiceConnection)connection.openInputStream(),进而调用 connection.getInputStream() - 这就是引发 FileNotFoundException 的原因。

知道这里发生了什么吗?什么是好的下一个调试步骤?感谢您的任何意见。

0 投票
1 回答
1337 浏览

serialization - 使用 ksoap2-Android 发送复杂对象、附件

我在 Android 项目上使用 ksoap2-Android 来上传文件。它不工作。

首先,我的 wsdl 看起来像这样:

“tns:Attachment”的定义如下:

我正在创建一个SoapSerializationEnvelope并添加具有名称date和值的属性作为当前日期的字符串表示形式。即使我不添加文件(注意minOccurs="0"),这也可以成功。但是,当我尝试添加文件时,它会严重失败:

首先,我Attachment通过创建一个分别具有类型和SoapObject的属性file和来代表类型。 filenamebyte[].classString.class

然后我将这些对象添加到通用 Vector(以表示imgFile项目的多样性)并将 Vector 作为属性附加到信封。这成功创建了一条 SOAP 消息,并且来自服务器的响应引发了异常(因为它是一条错误消息,而不是正确的响应,因为不知何故我的输入不好......):

好吧,那我做错了什么?有没有办法查看我发送的请求 SOAP 信封?

0 投票
2 回答
3293 浏览

android - Complex Object hosting Array of Complex Objects to .NET Web Service

I am getting a "casting" error on a property of complex object that is sent to a .NET web service using KSOAP2 from an Android device. The property is an array of complex objects. The documentation on the internet has helped me send and receive simple data types (strings, ints, dates, etc). I can even read an array of complex objects from a .NET web service. I just cannot send back an array of complex objects to the web service. Please help. Here is what I have:

Environment: Client = Android Development using the latest KSOAP lib for communication. Server = .NET Web Service (Visual Studio 2008). Note: this is NOT WCF.

.NET Web Service:


ANDROID CLIENT CODE:

Parent Class Sent as Complex Parameter:

}

Note: If I remove the SiteListItems property from the client code and the web service, everything works.


Complex Class used in Array within the above object:


Code to Send object as a Parameter to the .Net Web Service:

Request Dump from KSOAP:

Note: What I think the issue is, is that the array is defined as "anyTyp" and not MultiPartDataElement -> ... the question is what am I doing wrong here??

Response Dump from KSOAP (After Call):

SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 828). ---> System.InvalidCastException: Cannot assign object of type System.Object[] to an object of type Draeger.IT.Platform.Web.WebServices.MultiPartDataElement[]

0 投票
1 回答
4726 浏览

android - 复杂对象的 KSOAP2 元帅数组

我想将一组复杂对象作为参数发送到 .NET Web 服务。我拥有的类是 ksoap2 可序列化的。拨打电话后,SoapRequest 属性将我的数组显示为 AnyType。这会产生一个转换错误,因为服务器不知道如何转换它。

理论:
我觉得这个问题可以通过Marshalling来解决。我已经看过 See Sharp Geers 上的示例,但这些示例是针对原始类型的。你如何做一个数组并在 WriteInstance 方法中包含类型?

任何人都可以提供用于编组复杂对象数组的示例代码吗?

提前致谢,

克雷格

0 投票
3 回答
13378 浏览

android - 如何在android中发送soap请求?

我是 WSDL webservices 的新手,使用 KSoap2 库在 android 中调用 wsdl webservices。

这是我的肥皂请求转储

我通过这个 SopaObject 喜欢:

这里将纬度和经度值直接传递给 OffersByLocation ,我应该通过元素 Location 。请任何人帮助如何通过 Location 传递参数。

我已经尝试过上述程序,但收到错误消息

请任何人都可以告诉我如何在肥皂对象中通过上述肥皂请求转储?

问候, 斯里尼瓦斯

0 投票
1 回答
3771 浏览

android - 使用 Web 服务将 Sql Server 数据库连接到 Android 应用程序

我想使用 android 应用程序连接到 Sql Server 数据库,以便我可以使用一些用 Java 为 Android 应用程序编写的代码在 Sql Sever 中存储数据和检索数据......我该怎么做......任何教程或链接将不胜感激..

0 投票
1 回答
5675 浏览

android - 需要 Android kSOAP2 2.5.X

我尝试了超过 2 天的时间来下载适用于 android 的 kSOAP2,但没有成功。这里的任何人都可以给我发jar文件吗?谢谢,埃亚尔。

0 投票
1 回答
2279 浏览

android - Android ksoap2 javadoc - 如何下载

我正在尝试在这里下载 ksoap2-android 2.5.6 的 javadoc:

http://code.google.com/p/ksoap2-android/source/browse/#svn%2Fm2-repo%2Fcom%2Fgoogle%2Fcode%2Fksoap2-android%2Fksoap2-android-assembly%2F2.5.6%253Fstate%253Dclose

但下载后的文件只包含清单。我正在按照 wiki 页面上“如何使用”的说明进行操作:“要从那里下载文件,请右键单击“查看原始文件”并选择“将链接另存为”(此标签因浏览器而异),然后您将下载完整的 jar。”

我已经用多个浏览器试过这个。

有谁知道在哪里/如何获得 ksoap2-android javadoc?

0 投票
1 回答
4136 浏览

android - 使用 KSOAP2 和 HTTPS 的 Android 网络服务

我正在尝试使用 JAVA 和 KSOAP2 为 android 编写 web 服务。SOAP 是我可以使用的唯一协议,而 ReST 不是一个选项。

因此,我成功创建了 SOAP 请求并使用 HTTP 连接到服务器。但是,我需要 HTTPS,因为敏感信息会被传输。禁用证书检查不是一个选项,因为数据很敏感,我必须使用 SSL。

由于 Android 在 HTTPS 中引发了认证错误,因此我创建了自己的密钥库

1- http://blog.antoine.li/index.php/2010/10/android-trusting-ssl-certificates/

并将其添加到项目中。

我的代码类似于
2- http://www.techques.com/question/1-4646121/Not-trusted-certificate-using-ksoap2-android

我也经历过

3 - HTTPS 连接安卓

4 - Android 上的 Apache HttpClient 产生 CertPathValidatorException (IssuerName != SubjectName)

但不能直接使用它们。

非常感谢使用 HTTPS 显示 1 中的代码与 2 中的代码相关的伪代码。

2中的最后一条评论实际上是什么意思?他在代码中使用了 HttpsTransportSE,但表示他扩展了 HttpsServiceConnectionSE。你能在伪代码中显示这个吗?

另外,我应该使用 HttpsTransportSE 还是 HttpsServiceConnectionSE 来提供我将要连接的 URL。

0 投票
1 回答
983 浏览

android-ksoap2 - requestdump中的“<”和“>”变成了“>”和“<”,我想传递xml格式参数时如何避免这种情况

requestdump中的“<”和“>”变成了“>”和“<”,我想传递xml格式参数时如何避免这种情况?

请求转储:

服务器端需求的格式:

ps:

xml