locked
How to parse SOAP response to dataset/datatable RRS feed

  • Question

  • User-2031591403 posted

    I have the following SOAP response. How can i convert this to the dataset using C# code??

    There are lot of codes available in internet which could read a particular node only. I want to read all the nodes and need to construct a dataset. Please share your thoughts and code

    <?xml version="1.0" encoding="UTF-8"?> -<soap:Envelope xmlns:page="http://test.com/CareAdvance/DataContracts/Page" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:mem="http://test.com/CareAdvance/DataContracts/Member" xmlns:prov="http://test.com/CareAdvance/DataContracts/Provider" xmlns:cus="http://test.com/CareAdvance/DataContracts/CustomFields" xmlns:sys="http://test.com/CareAdvance/DataContracts/SystemSpecificValue" xmlns:triz="http://schemas.datacontract.org/2004/07/Trizetto.CareAdvance.Service.DataContracts.AppealsGrievances" xmlns:umc1="http://test.com/CareAdvance/DataContracts/UMCase" xmlns:dat="http://test.com/CareAdvance/DataContracts" xmlns:umc="http://test.com/CareAdvance/UMCaseService/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header/> -<soap:Body> -<umc:SearchCasesResponse> -<umc:SearchCasesResult> <dat:Success>Success</dat:Success> <dat:ReturnId>R123</dat:ReturnId> -<dat:Errors> -<dat:ServiceError> <dat:Code>C123</dat:Code> <dat:Message>Msg</dat:Message> </dat:ServiceError> </dat:Errors> <dat:ReturnMessage>Rmsg</dat:ReturnMessage> -<dat:Warnings> -<dat:ServiceError> <dat:Code>C123</dat:Code> <dat:Message>Hi</dat:Message> </dat:ServiceError> </dat:Warnings> -<umc:Cases> -<umc1:CaseOverview> -<umc1:Appeals> -<triz:Appeal> <triz:CompleteDateTime>10.1.2013</triz:CompleteDateTime> -<triz:CreatedBy> <umc1:ExternalId>E123</umc1:ExternalId> </triz:CreatedBy> <triz:DueDate>10.5.2013</triz:DueDate> <triz:Expedited>10</triz:Expedited> <triz:ExternalAppealId>E123</triz:ExternalAppealId> <triz:IsOpen>Y</triz:IsOpen> -<triz:Level> <sys:Description>Desc</sys:Description> <sys:Id>S1234</sys:Id> </triz:Level> <triz:Module>Module</triz:Module> -<triz:Outcome> <sys:Description>Desc</sys:Description> <sys:Id>S123</sys:Id> </triz:Outcome> <triz:Rationale>Rat</triz:Rationale> <triz:ReceivedDate>10.6.2013</triz:ReceivedDate> <triz:Requester>S</triz:Requester> <triz:Reviewer>r1</triz:Reviewer> -<triz:Type> <sys:Description>Desc3</sys:Description> <sys:Id>S123</sys:Id> </triz:Type> </triz:Appeal> </umc1:Appeals> -<umc1:AuthStatusSummary> <sys:Description>Desc4</sys:Description> <sys:Id>S333</sys:Id> </umc1:AuthStatusSummary> -<umc1:Authorizations> -<umc1:AuthorizationOverview> -<umc1:AuthRequestCustomFields> <cus:MetaDataGuid>Guide</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2>uf2</cus:UserField2> <cus:UserField3>uf2</cus:UserField3> <cus:UserField4>uf2</cus:UserField4> <cus:UserField5>uf2</cus:UserField5> <cus:UserField6> uf2</cus:UserField6> <cus:UserField7> uf2</cus:UserField7> <cus:UserField8> uf2</cus:UserField8> <cus:UserField9> uf2</cus:UserField9> <cus:UserField10> uf2</cus:UserField10> </umc1:AuthRequestCustomFields> -<umc1:Diagnosis> <umc1:Code>1000</umc1:Code> <umc1:CodeSetId>?</umc1:CodeSetId> <umc1:Description>DiagnosisDesc1</umc1:Description> -<umc1:PoaIndicator> <sys:Description>DiagnosisDesc2</sys:Description> <sys:Id>1002</sys:Id> </umc1:PoaIndicator> </umc1:Diagnosis> -<umc1:Facility> <prov:ExternalId>200</prov:ExternalId> <prov:ExternalSystemId>?</prov:ExternalSystemId> <prov:Name>Sathya</prov:Name> <prov:Npi>NPi</prov:Npi> <prov:TaxId>T1001</prov:TaxId> -<prov:NetworkStatus> <sys:Description>Desc</sys:Description> <sys:Id>I101</sys:Id> </prov:NetworkStatus> </umc1:Facility> <umc1:FromDate>10.3.2014</umc1:FromDate> <umc1:IsLos>Y</umc1:IsLos> <umc1:IsPrimary>Y</umc1:IsPrimary> -<umc1:LineItemCustomFields> <cus:MetaDataGuid>Metadatagrid</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2>uf3</cus:UserField2> <cus:UserField3> uf3</cus:UserField3> <cus:UserField4> uf3</cus:UserField4> <cus:UserField5> uf3</cus:UserField5> <cus:UserField6> uf3</cus:UserField6> <cus:UserField7> uf3</cus:UserField7> <cus:UserField8> uf3</cus:UserField8> <cus:UserField9> uf3</cus:UserField9> <cus:UserField10> uf3</cus:UserField10> </umc1:LineItemCustomFields> -<umc1:Procedure> <umc1:Code>Code</umc1:Code> <umc1:CodeSetId>set</umc1:CodeSetId> <umc1:Description>desc</umc1:Description> <umc1:ProcedureDate>10.3.2014</umc1:ProcedureDate> </umc1:Procedure> -<umc1:RequestingProvider> <prov:ExternalId>e1010</prov:ExternalId> <prov:ExternalSystemId>es1001</prov:ExternalSystemId> <prov:Name>ename</prov:Name> <prov:Npi>enpi</prov:Npi> <prov:TaxId>t1011</prov:TaxId> -<prov:NetworkStatus> <sys:Description>desc</sys:Description> <sys:Id>s123</sys:Id> </prov:NetworkStatus> </umc1:RequestingProvider> -<umc1:ServiceType> <sys:Description>ServiceDesc</sys:Description> <sys:Id>SID1234</sys:Id> </umc1:ServiceType> -<umc1:Status> <sys:Description>desc</sys:Description> <sys:Id>i1234</sys:Id> </umc1:Status> <umc1:ToDate>10.3.2013</umc1:ToDate> -<umc1:TreatingProvider> <prov:ExternalId>e1023</prov:ExternalId> <prov:ExternalSystemId>I2234</prov:ExternalSystemId> <prov:Name>pname</prov:Name> <prov:Npi>npi</prov:Npi> <prov:TaxId> taxid </prov:TaxId> -<prov:NetworkStatus> <sys:Description>desc</sys:Description> <sys:Id>sid</sys:Id> </prov:NetworkStatus> </umc1:TreatingProvider> <umc1:Units>12</umc1:Units> </umc1:AuthorizationOverview> </umc1:Authorizations> -<umc1:CasePriority> <sys:Description>desc</sys:Description> <sys:Id>s1234</sys:Id> </umc1:CasePriority> -<umc1:CaseSetting> <sys:Description>desc</sys:Description> <sys:Id>i12344</sys:Id> </umc1:CaseSetting> -<umc1:CaseType> <sys:Description>desc</sys:Description> <sys:Id>i344</sys:Id> </umc1:CaseType> -<umc1:CustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </umc1:CustomFields> -<umc1:DelegateSystem> <sys:Description>desc</sys:Description> <sys:Id>asw34434</sys:Id> </umc1:DelegateSystem> <umc1:ExternalId>e2333</umc1:ExternalId> -<umc1:Facility> <prov:ExternalId>et344</prov:ExternalId> <prov:ExternalSystemId>e3455</prov:ExternalSystemId> <prov:Name>name</prov:Name> <prov:Npi>npi</prov:Npi> <prov:TaxId>taxid</prov:TaxId> -<prov:NetworkStatus> <sys:Description>desc</sys:Description> <sys:Id>s3390</sys:Id> </prov:NetworkStatus> </umc1:Facility> <umc1:FromDate>1.1.2012</umc1:FromDate> <umc1:HasCriteria>y</umc1:HasCriteria> <umc1:HasGuideline>y</umc1:HasGuideline> <umc1:HasProviderActions>n</umc1:HasProviderActions> <umc1:HasProviderCommunication>n</umc1:HasProviderCommunication> <umc1:HasProviderCommunicationAttachments>s</umc1:HasProviderCommunicationAttachments> <umc1:HasQuestionnaire>n</umc1:HasQuestionnaire> <umc1:HasRulesBasedCommunication>d</umc1:HasRulesBasedCommunication> <umc1:LastUpdateDate>10.1.2012</umc1:LastUpdateDate> -<umc1:Member> <mem:ExternalMemberId>233</mem:ExternalMemberId> <mem:ExternalSystemId>3434</mem:ExternalSystemId> <mem:FirstName>name</mem:FirstName> <mem:LastName>lname</mem:LastName> -<mem:Eligibility> -<mem:Eligibility> <mem:SubscriberId>s2324</mem:SubscriberId> <mem:Suffix>s</mem:Suffix> <mem:EffectiveDate>11.2.2014</mem:EffectiveDate> <mem:TerminationDate>10.3.2015</mem:TerminationDate> <mem:GroupName>gname</mem:GroupName> <mem:Employer>emp</mem:Employer> <mem:PlanName>pname</mem:PlanName> <mem:ProductName>pdname</mem:ProductName> <mem:IsPrimary>y</mem:IsPrimary> <mem:ProductId>p3424</mem:ProductId> <mem:GroupId>g3424</mem:GroupId> <mem:PlanId>p345</mem:PlanId> -<mem:EligibilityCustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </mem:EligibilityCustomFields> -<mem:CoverageCustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </mem:CoverageCustomFields> </mem:Eligibility> </mem:Eligibility> -<mem:Address> -<mem:Address> <mem:Street>street</mem:Street> <mem:Street2> street </mem:Street2> <mem:City> City </mem:City> <mem:State> State </mem:State> <mem:Zip> Zip </mem:Zip> <mem:Country> Country </mem:Country> </mem:Address> </mem:Address> <mem:Gender> Gender </mem:Gender> <mem:DateOfBirth>30.3.1991</mem:DateOfBirth> <mem:IsActive>Y</mem:IsActive> <mem:IsTempMember>Y</mem:IsTempMember> -<mem:Relationship> <sys:Description>desc</sys:Description> <sys:Id>s1234</sys:Id> </mem:Relationship> -<mem:CustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </mem:CustomFields> <mem:HCID>ftgfdg</mem:HCID> -<mem:Employer> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </mem:Employer> <mem:MedicareNumber> MedicareNumber </mem:MedicareNumber> <mem:MedicaidNumber> MedicaidNumber </mem:MedicaidNumber> <mem:SubscriberId> SubscriberId </mem:SubscriberId> <mem:SSN> SSN </mem:SSN> -<mem:CoverageAsOfInquiryDate> -<mem:Eligibility> <mem:SubscriberId>s2324</mem:SubscriberId> <mem:Suffix>s</mem:Suffix> <mem:EffectiveDate>11.2.2014</mem:EffectiveDate> <mem:TerminationDate>10.3.2015</mem:TerminationDate> <mem:GroupName>gname</mem:GroupName> <mem:Employer>emp</mem:Employer> <mem:PlanName>pname</mem:PlanName> <mem:ProductName>pdname</mem:ProductName> <mem:IsPrimary>y</mem:IsPrimary> <mem:ProductId>p3424</mem:ProductId> <mem:GroupId>g3424</mem:GroupId> <mem:PlanId>p345</mem:PlanId> -<mem:EligibilityCustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </mem:EligibilityCustomFields> -<mem:CoverageCustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </mem:CoverageCustomFields> </mem:Eligibility> </mem:CoverageAsOfInquiryDate> -<mem:PrimaryCarePhysician> <prov:ExternalId> ExternalId </prov:ExternalId> <prov:ExternalSystemId> ExternalSystemId </prov:ExternalSystemId> -<prov:Title> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:Title> <prov:Name> Name </prov:Name> <prov:FirstName> FirstName </prov:FirstName> <prov:LastName> LastName </prov:LastName> <prov:NetworkStatus> NetworkStatus </prov:NetworkStatus> <prov:Npi> Npi </prov:Npi> -<prov:Role> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:Role> <prov:TaxId> TaxId </prov:TaxId> -<prov:Type> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:Type> -<prov:SpecialtyList> -<sys:SystemSpecificValueOption> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </sys:SystemSpecificValueOption> </prov:SpecialtyList> <prov:EffectiveDate> EffectiveDate </prov:EffectiveDate> <prov:TerminationDate> TerminationDate </prov:TerminationDate> -<prov:MedicareIds> <arr:string> string </arr:string> </prov:MedicareIds> -<prov:AddressList> -<prov:ProviderAddress> <prov:ExternalId> ExternalId </prov:ExternalId> <prov:Street> Street </prov:Street> <prov:City> City </prov:City> <prov:State> State </prov:State> <prov:Zip> Zip </prov:Zip> <prov:Country> Country </prov:Country> <prov:County> Country </prov:County> <prov:Phone>Phone</prov:Phone> <prov:PhoneExtension> PhoneExtension </prov:PhoneExtension> <prov:Fax> Fax </prov:Fax> <prov:FaxExtension> FaxExtension </prov:FaxExtension> <prov:Email> Email </prov:Email> -<prov:Type> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:Type> <prov:EffectiveDate> EffectiveDate </prov:EffectiveDate> <prov:TerminationDate> TerminationDate </prov:TerminationDate> -<prov:CustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </prov:CustomFields> <prov:IsTemporary>Y</prov:IsTemporary> </prov:ProviderAddress> </prov:AddressList> -<prov:CustomFields> <cus:MetaDataGuid>mdu</cus:MetaDataGuid> <cus:UserField1>uf1</cus:UserField1> <cus:UserField2> uf1</cus:UserField2> <cus:UserField3> uf1</cus:UserField3> <cus:UserField4> uf1</cus:UserField4> <cus:UserField5> uf1</cus:UserField5> <cus:UserField6> uf1</cus:UserField6> <cus:UserField7> uf1</cus:UserField7> <cus:UserField8> uf1</cus:UserField8> <cus:UserField9> uf1</cus:UserField9> <cus:UserField10> uf1</cus:UserField10> </prov:CustomFields> -<prov:NetworkStatusType> <sys:Description> Description </sys:Description> <sys:Id>ID</sys:Id> </prov:NetworkStatusType> </mem:PrimaryCarePhysician> </umc1:Member> -<umc1:Phase> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </umc1:Phase> -<umc1:PlaceOfService> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </umc1:PlaceOfService> -<umc1:PrimaryCarePhysician> <prov:ExternalId> ExternalId </prov:ExternalId> <prov:ExternalSystemId> ExternalSystemId </prov:ExternalSystemId> <prov:Name> Name </prov:Name> <prov:Npi> Npi </prov:Npi> <prov:TaxId> TaxId </prov:TaxId> -<prov:NetworkStatus> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:NetworkStatus> </umc1:PrimaryCarePhysician> <umc1:PrimaryDiagnosisCode> PrimaryDiagnosisCode </umc1:PrimaryDiagnosisCode> <umc1:PrimaryDiagnosisDescription> PrimaryDiagnosisDescription </umc1:PrimaryDiagnosisDescription> <umc1:PrimaryProcedureCode> PrimaryProcedureCode </umc1:PrimaryProcedureCode> <umc1:PrimaryProcedureDescription> PrimaryProcedureDescription </umc1:PrimaryProcedureDescription> -<umc1:RequestingProvider> <prov:ExternalId> ExternalId </prov:ExternalId> <prov:ExternalSystemId> ExternalSystemId </prov:ExternalSystemId> <prov:Name> Name </prov:Name> <prov:Npi> Npi </prov:Npi> <prov:TaxId> TaxId </prov:TaxId> -<prov:NetworkStatus> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:NetworkStatus> </umc1:RequestingProvider> -<umc1:ReviewType> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </umc1:ReviewType> -<umc1:Source> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </umc1:Source> <umc1:StatusChangeDate> StatusChangeDate </umc1:StatusChangeDate> <umc1:ToDate> ToDate </umc1:ToDate> -<umc1:TreatingProvider> <prov:ExternalId> ExternalId </prov:ExternalId> <prov:ExternalSystemId> ExternalSystemId </prov:ExternalSystemId> <prov:Name> Name </prov:Name> <prov:Npi> Npi </prov:Npi> <prov:TaxId> TaxId </prov:TaxId> -<prov:NetworkStatus> <sys:Description> Description </sys:Description> <sys:Id> Id </sys:Id> </prov:NetworkStatus> </umc1:TreatingProvider> </umc1:CaseOverview> </umc:Cases> -<umc:Sort> -<umc1:CaseSort> <page:IsAscendingOrder> IsAscendingOrder </page:IsAscendingOrder> <umc1:SortBy> SortBy </umc1:SortBy> </umc1:CaseSort> </umc:Sort> -<umc:Pagination> <page:ItemsPerPage>12</page:ItemsPerPage> <page:CurrentPageNumber>1</page:CurrentPageNumber> <page:TotalNumberOfPages>1</page:TotalNumberOfPages> <page:TotalNumberOfRecords>10</page:TotalNumberOfRecords> </umc:Pagination> </umc:SearchCasesResult> </umc:SearchCasesResponse> </soap:Body> </soap:Envelope>

    Tuesday, April 8, 2014 6:16 AM

Answers

  • User-417640953 posted

    Hi vckumareshb,

    Thanks for your post.

    As know the soap response format based on xml, so we should try to use the XMLdocument to convert it to dataset.

    XmlDocument xd=new XmlDocument(); 
    xd.LoadXml("soap"); //soap message
    XmlNode xn = xd.DocumentElement; 
    XmlNode result = xn.SelectSingleNode("dd"); //you should give exact condition
    DataSet ds=new DataSet(); 
    ds.ReadXml(result.InnerXml());
    

    For how to use the XMLdocument, please refer to below.

    http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 9, 2014 10:47 PM

All replies