Parsing Complex Soap Response with diffgram

I am not able to parse below soap response from a .net webservice,i am getting two type of response one is of anytype format which i have parsed it,but now i need to parse the below xml

<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
      <GetReminderResponse xmlns="">
            <xs:schema id="NewDataSet" xmlns="" xmlns:xs="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
               <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
                     <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="Table">
                                 <xs:element name="RemMessage" type="xs:string" minOccurs="0"/>
                                 <xs:element name="InvM_Id" type="xs:int" minOccurs="0"/>
                                 <xs:element name="DocType" type="xs:int" minOccurs="0"/>
                                 <xs:element name="PrmR_TypeId" type="xs:int" minOccurs="0"/>
                                 <xs:element name="PrmR_Id" type="xs:int" minOccurs="0"/>
            <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">
                     <RemMessage>Exeed Discount Limit on Invoice dated on 04/05/2015 for  ANDREA NORONHA , from 3 - Lokhandwala Showroom</RemMessage>
                  <Table diffgr:id="Table2" msdata:rowOrder="1">
                     <RemMessage>Exeed Discount Limit on Invoice dated on 04/05/2015 for ADITI SHAH , from 3 - Lokhandwala Showroom</RemMessage>


there is schema of data types in Your Soap-response wchich is completly weird for me. But i've built code that ignores xs:schema part and creates array of GetReminder objects (type taken from Your previous post: How to parse diffgram anytype response from .net webservice). I think, that better idea would be creating KVMSerializables for the structure but the way below it works great too ;)

   ArrayList<GetReminder> lst = new ArrayList<GetReminder>();
   if(envelope.bodyIn instanceof SoapObject && envelope.bodyIn!=null){
       SoapObject so=(SoapObject)envelope.bodyIn;
            SoapObject so1 = (SoapObject) so.getProperty("GetReminderResult");
                SoapObject soDiffg = (SoapObject) so1.getProperty("diffgram");
                    SoapObject soNDSet = (SoapObject) soDiffg.getProperty("NewDataSet");

                    for (int i = 0; i < soNDSet.getPropertyCount(); i++) {
                        SoapObject soRem = (SoapObject) soNDSet.getProperty(i);
                        GetReminder reminder = new GetReminder();

                        if (soRem.hasProperty("RemMessage")) {
                        if (soRem.hasProperty("InvM_Id")) {
                        if (soRem.hasProperty("DocType")) {
                        if (soRem.hasProperty("PrmR_TypeId")) {
                        if (soRem.hasProperty("PrmR_Id")) {



Regards, Marcin

Need Your Help

std::hash specialization remains unused by std::unordered_map

c++ templates c++11 std unordered-map

I am trying to extend std::hash&lt;T&gt; by supplying a specialization for const char, so that I can use const char* as key type in std::unordered_map.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.