Copy link to clipboard
Copied
Hi All
How to handle the multiple exceptions in the SOAP Response block as shown below
currently i can the handle the description of the first exception by
['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception']['description']['XmlText']
How to access both the exception description in the same manner ??
@gokul,
If you dump ['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'] . You will find an array object. So simply looping over the array object you can get your attribute values.
Example:
['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'][1]
['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'][2]
Will give you first and second exception object.
Copy link to clipboard
Copied
You should be able to loop through the structure when using XMLSearch() to access the parent object, only processing the "exception" items. Can you post the entire XML fragment?
Copy link to clipboard
Copied
@gokul,
If you dump ['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'] . You will find an array object. So simply looping over the array object you can get your attribute values.
Example:
['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'][1]
['soapenv:Envelope']['soapEnv:Body']['maintainUserResponse']['exception'][2]
Will give you first and second exception object.