Forum Discussion

AnandD's avatar
AnandD
Occasional Contributor
12 years ago

Unable to access child nodes in SOAP response using XPATH

Below is my SOAP response. I am try to retrieve the text values of the child nodes ns1:busnsOrgLocAddr. However i am not able to traverse using XPATH beyond soapenv:Body
Any suggestions on what can be done ?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<read_DnBEnrichedDataByIDResponse xmlns="http://service.intel.com">
<read_DnBEnrichedDataByIDReturn>
<ns1:busnsOrgLocAddr xmlns:ns1="http://res.readdnbenricheddatabyid.com">
<ns1:addrUsgTypeCd>Mailing</ns1:addrUsgTypeCd>
<ns1:busnsOrgAddrTypeCd>ORGALTADDR</ns1:busnsOrgAddrTypeCd>
</ns1:busnsOrgLocAddr>
<ns2:busnsOrgNm xmlns:ns2="http://res.readdnbenricheddatabyid.com">
<ns2:busnsOrgNm>Artus Beteiligungsverwaltungsges. mbH</ns2:busnsOrgNm>
<ns2:busnsOrgNmTypeCd>HDQPRNTNM</ns2:busnsOrgNmTypeCd>
</ns2:busnsOrgNm>
<ns3:busnsOrgNm xsi:nil="true" xmlns:ns3="http://res.readdnbenricheddatabyid.com"/>
<ns4:ceoNm xmlns:ns4="http://res.readdnbenricheddatabyid.com">Friedrich Ganz</ns4:ceoNm>
<ns5:sic xmlns:ns5="http://res.readdnbenricheddatabyid.com">
<ns5:stdIndusClassCd>6719</ns5:stdIndusClassCd>
<ns5:stdIndusClassDsc>Holding companies, nec, nsk</ns5:stdIndusClassDsc>
<ns5:sicTypeCd>SIC1</ns5:sicTypeCd>
</ns5:sic>
<ns6:sic xmlns:ns6="http://res.readdnbenricheddatabyid.com">
<ns6:stdIndusClassCd>6411</ns6:stdIndusClassCd>
<ns6:stdIndusClassDsc>Insurance agents, brokers, and service</ns6:stdIndusClassDsc>
<ns6:sicTypeCd>SIC2</ns6:sicTypeCd>
</ns6:sic>
<ns7:orgStrtYr xmlns:ns7="http://res.readdnbenricheddatabyid.com">2009</ns7:orgStrtYr>
<ns8:slsVolUsd xmlns:ns8="http://res.readdnbenricheddatabyid.com">0</ns8:slsVolUsd>
<ns9:totEmpCnt xmlns:ns9="http://res.readdnbenricheddatabyid.com">4</ns9:totEmpCnt>
</read_DnBEnrichedDataByIDReturn>
</read_DnBEnrichedDataByIDResponse>
</soapenv:Body>
</soapenv:Envelope>


In Property Transfer Step, the below works

declare namespace ns1='http://res.createaccountcoverage.com';
declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//soapenv:Envelope/soapenv:Body


However further traversal does not work (result is null), such as

declare namespace ns1='http://res.createaccountcoverage.com';
declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//soapenv:Envelope/soapenv:Body/read_DnBEnrichedDataByIDResponse

2 Replies