KSOAP和.Net Web服务返回数据集
-
26-09-2019 - |
题
我知道,使用数据集是一个大奸大恶,但服务不是我的控制之下,并创建一个代理服务的前景是一个没有去....
如果有人已经创建了可以使用KSOAP串行反序列化,还是我吸烟了错误的东西类结构我想要看到的是。
要开始它的平均时间,看看它是否是可能的。
下面是所得到的数据按预期(Schema和的DiffGram):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SearchCustomerResponse xmlns="http://NCBI/WS/CRM">
<SearchCustomerResult>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="cussurKey" type="xs:int" minOccurs="0" />
<xs:element name="cusKey" type="xs:int" minOccurs="0" />
<xs:element name="FullName" type="xs:string" minOccurs="0" />
<xs:element name="CIS" type="xs:long" minOccurs="0" />
<xs:element name="DCARKey" type="xs:int" minOccurs="0" />
<xs:element name="empBM" type="xs:string" minOccurs="0" />
<xs:element name="IDRegNo" type="xs:string" minOccurs="0" />
<xs:element name="RankCount" type="xs:long" minOccurs="0" />
<xs:element name="Source" type="xs:string" minOccurs="0" />
<xs:element name="GOICategory" type="xs:string" minOccurs="0" />
<xs:element name="cusperbanKey" type="xs:int" minOccurs="0" />
<xs:element name="GOIAmount" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<cussurKey>211806</cussurKey>
<cusKey>0</cusKey>
<FullName>*AMA WIESE H/A PLANTWISE SHADENET </FullName>
<CIS>191004669827</CIS>
<DCARKey>3171</DCARKey>
<empBM>0007974 - Scott, Sean John</empBM>
<IDRegNo>0</IDRegNo>
<RankCount>1</RankCount>
<Source>Local</Source>
<GOICategory>Zero</GOICategory>
<cusperbanKey>7</cusperbanKey>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<cussurKey>115457</cussurKey>
<cusKey>0</cusKey>
<FullName>*C H WIESE EN J A BAARD </FullName>
<CIS>110587519304</CIS>
<DCARKey>33351</DCARKey>
<empBM>0135570 - Kriel, Werner</empBM>
<IDRegNo>0</IDRegNo>
<RankCount>2</RankCount>
<Source>Local</Source>
<GOICategory>Zero</GOICategory>
<cusperbanKey>7</cusperbanKey>
</Table>
</NewDataSet>
</diffgr:diffgram>
</SearchCustomerResult>
</SearchCustomerResponse>
</soap:Body>
</soap:Envelope>
解决方案
在数据集被当作对象的数组,就我所看到的,所以你可能要考虑如何与KSOAP返回复杂对象的数组的教程。您可能需要创建在Android上表类,并实现KVMSerializable接口。
HTTP://seesharpgears.blogspot。 COM / 2010/10 / Web的服务 - 即-返回阵列-of.html
不隶属于 StackOverflow