Domanda

So che utilizzano DataSet sono un grande male, ma come il servizio non è sotto il mio controllo e la prospettiva della creazione di un servizio di proxy è un no go ....

Quello che sto cercando di vedere è se qualcuno ha creato la struttura di classe che può essere deserializzato utilizzando il serializzatore kSoap, o sono io fumando la roba sbagliata.

Andando per avviarlo nel frattempo e vedere se è possibile.

Di seguito è riportato i dati risultanti come previsto (Schema e 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>
È stato utile?

Soluzione

L'insieme di dati viene trattato come un array di oggetti, per quanto posso vedere, per cui si potrebbe prendere in considerazione un tutorial su come restituire array di oggetti complessi con KSOAP. Potrebbe essere necessario creare una classe Tavolo in Android e implementare l'interfaccia KVMSerializable.

http: //seesharpgears.blogspot. com / 2010/10 / web-servizio-che-torna-array-of.html

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top