I am using the KSoap2 for communicating with the server. The communication is fine and returns a set of values that i have mentioned below. I am not sure with the way i am handling the response. I wrote a separate java class that implements KvmSerializable for mapping the XML objects with the java objects. After a long research in the web, i found the use of the parser like SAX, DOM ..etc is more standard and flexible.
Is there any way i can bring the SAX for parsing the following response… if so,please provide some references..
This is the response that i got after i send a request to the server from my android client app. Please note, This response is not ended with .xml / returns as a .xml file.
This is the webclient response :
http://134.1.10.5/Maxima/MaximaSystem.asmx/ValidateLogin
<DataSet>
<xs:schema id="NewDataSet">
<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="Name" type="xs:string" minOccurs="0"/>
<xs:element name="UserIcode" type="xs:int" minOccurs="0"/>
<xs:element name="UserUserName" type="xs:string" minOccurs="0"/>
<xs:element name="UserPassword" type="xs:string" minOccurs="0"/>
<xs:element name="UserTypeICode" type="xs:int" minOccurs="0"/>
<xs:element name="ProfileTable" type="xs:string" minOccurs="0"/>
<xs:element name="UserTypeDesc" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram>
<NewDataSet>
<Table diffgr:id="Table1" msdata:rowOrder="0">
<Name>Frecan </Name>
<UserIcode>634</UserIcode>
<UserUserName>dairy</UserUserName>
<UserPassword>dairy123</UserPassword>
<UserTypeICode>632</UserTypeICode>
<ProfileTable/>
<UserTypeDesc>Dentist</UserTypeDesc>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>
This is the response. No XML Tags …anything…Please suggest the best way that i can parse it using the native parser of Android. If so, Please provide some references.
This is the sample of the response that i get, when i ping server through Android Client
anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=an
yType{complexType=anyType{sequence=anyType{element=anyType{....
// some values ........
};
element=anyType{};
element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{};
element=anyType{}; }; }; }; }; };unique=anyType{selector=anyType{};
field=anyType{};}; }; }; diffgram=anyType{}; }
Please let me know, is it possible to use native parsers in Android.
Thanks in Advance.
First you have to get a soap response in soapObject and then after that count the total property.
After getting count, please check one by one in which property you have your data ,
you can also implement an inner loop.