Skip to main content
gokul1242
Inspiring
October 30, 2013
Answered

Handle mulitple exceptions from xml in Coldfusion

  • October 30, 2013
  • 2 replies
  • 645 views

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 ??

This topic has been closed for replies.
Correct answer Upen1

@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.

2 replies

Upen1
Upen1Correct answer
Inspiring
November 1, 2013

@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.

Legend
October 31, 2013

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?