Hi Team,
I have one user case to extract the error message from a SOAP web servie response. The XML is below and my question is how to retrieve the error message from "<ns3:tt_msg_desc>ERROR: Invalid User ID/Password.</ns3:tt_msg_desc>"? I have tried the get XML element attribute and value, but I met problem with the name space in XPATH. Appreciate some one can shed some light.
<?xml version="1.0" encoding="utf-8"?>
<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:Header>
<wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing" soapenv:actor="" soapenv:mustUnderstand="0">urn:services-qad-com:</wsa:To>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing" soapenv:actor="" soapenv:mustUnderstand="0"></wsa:Action>
<wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing" soapenv:actor="" soapenv:mustUnderstand="0">urn:messages-qad-com:2022-10-09T22:45:17-0500</wsa:MessageID>
<wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing" soapenv:actor="" soapenv:mustUnderstand="0">urn:services-qad-com::QADERP</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body>
<ns1:maintainDailyLeadPriceResponse xmlns:ns1="urn:schemas-qad-com:xml-services" xmlns="urn:schemas-qad-com:xml-services">
<ns1:result>error</ns1:result>
<ns2:dsSessionContext xmlns:ns2="urn:schemas-qad-com:xml-services:common">
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>domain</ns2:propertyName>
<ns2:propertyValue>PSCN</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>scopeTransaction</ns2:propertyName>
<ns2:propertyValue>false</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>version</ns2:propertyName>
<ns2:propertyValue>ERP3_1x</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>mnemonicsRaw</ns2:propertyName>
<ns2:propertyValue>false</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>username</ns2:propertyName>
<ns2:propertyValue>xxxx</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>password</ns2:propertyName>
<ns2:propertyValue>******</ns2:propertyValue>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>action</ns2:propertyName>
<ns2:propertyValue/>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>entity</ns2:propertyName>
<ns2:propertyValue/>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>email</ns2:propertyName>
<ns2:propertyValue/>
</ns2:ttContext>
<ns2:ttContext>
<ns2:propertyQualifier>QAD</ns2:propertyQualifier>
<ns2:propertyName>emailLevel</ns2:propertyName>
<ns2:propertyValue/>
</ns2:ttContext>
</ns2:dsSessionContext>
<ns3:dsExceptions xmlns:ns3="urn:schemas-qad-com:xml-services:common">
<ns3:temp_err_msg>
<ns3:tt_level xsi:nil="true"/>
<ns3:tt_msg_context/>
<ns3:tt_msg_data/>
<ns3:tt_msg_datetime>2022-10-09T22:45:16-0500</ns3:tt_msg_datetime>
<ns3:tt_msg_desc>ERROR: Invalid User ID/Password.</ns3:tt_msg_desc>
<ns3:tt_msg_field/>
<ns3:tt_msg_index>0</ns3:tt_msg_index>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_nbr>MfgProErrorMessage</ns3:tt_msg_nbr>
<ns3:tt_msg_processed>false</ns3:tt_msg_processed>
<ns3:tt_msg_sev>error</ns3:tt_msg_sev>
</ns3:temp_err_msg>
<ns3:temp_err_msg>
<ns3:tt_level xsi:nil="true"/>
<ns3:tt_msg_context/>
<ns3:tt_msg_data/>
<ns3:tt_msg_datetime>2022-10-09T22:45:16-0500</ns3:tt_msg_datetime>
<ns3:tt_msg_desc>ERROR: Unable to initialize session.</ns3:tt_msg_desc>
<ns3:tt_msg_field/>
<ns3:tt_msg_index>1</ns3:tt_msg_index>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_keys/>
<ns3:tt_msg_nbr>MfgProErrorMessage</ns3:tt_msg_nbr>
<ns3:tt_msg_processed>false</ns3:tt_msg_processed>
<ns3:tt_msg_sev>error</ns3:tt_msg_sev>
</ns3:temp_err_msg>
</ns3:dsExceptions>
</ns1:maintainDailyLeadPriceResponse>
</soapenv:Body>
</soapenv:Envelope>