如何解析Android的一个复杂的SOAP响应复杂、Android、SOAP

2023-09-06 22:26:47 作者:我为你倾心

由于这两天我正在尝试消耗WCF(.NET)SOAP服务和序列化它的反应都没有成功。我得到一个正确的响应(我不得不把它放在引擎收录: SOAP响应示例),但KSOAP2不能要正确处理.NET数据集。 我已经consultated这个特定问题的各种物品,但没有一个是.NET数据集处理。这给了guideance文章主要是一个 由IBM的使用XML在Android上工作文章

Since two days I am trying to consume a WCF (.NET) Soap Service and serialize it's response without success. I am getting a correct response (I had to put it on pastebin: SOAP Response Example), but KSOAP2 is not able to handle .NET Datasets correctly. I already consultated various articles about this specific problem, but none has a .NET Dataset to handle. The main article which gave guideance was an article by IBM "Working with XML on Android"

我尝试下面的步骤来分析我的数据没有成功:

I tried following steps to parse my data without success:

在使用SAX(机器人)解析 - >好像不是这个复杂的文档,因为不同的命名空间的工作。 与DOM对象(安卓) - > NullPointerExeption(!DOOH) 在用沼气池(dom4j中) - > NullPointerException异常(!arggh) 方法建议的helloandroid.com使用kso​​ap2为Android和解析,并输出数据

几个问题: - 返回的响应是一个正常的XML,但实际上它包含了.NET数据集。有没有人有成功解析出数据这样的反应呢? - 有没有一种方法,使KSOAP2不要试图分析这些数据?它返回一个垃圾SoapObject,这是无法读取。我想SOAP体的内容之外。有没有办法拦截呢? - 你还有什么其他的提示

Some questions: - The returned response is a normal XML, but actually it includes a .NET Dataset. Has anyone had success to parse data out of such a response? - Is there a way to make KSOAP2 not to trying to parse the data? It returns a rubbish SoapObject, which is unreadable. I would like just the contents of the SOAP body. Is there a way to intercept that? - Do you have any other hint?

推荐答案

我的一个解决方案是: HTTP:/ /vtd-xml.sourceforge.net/

One of my solutions was: http://vtd-xml.sourceforge.net/

我希望有人会找到更合适的。

I hope someone will find something more suitable.