Hi I am trying to fetch the value of the XMLMessage inside orchestration using xpath.
The code, I wrote in message assignment is as under:
//Get the path of the the first VoidedInfo Element
VoidInfoPath = System.String.Format(“//IRPVoidedInfo[{0}]”,1);
XmlDoc = xpath(ReceiveIRPVoidedMSG,VoidInfoPath);
//Construct Message
XmlDocMSG = XmlDoc;
//Fetch the data from the message
Unit = xpath(XmlDocMSG, “string(/IRPVoidedInfo/UNIT)”);
Whenever there is 1 or more IRPVoidedInfo element in the received MSG, it works fine. But if an XML comes with no IRPVoidedInfo element, than the orchestration throws “NULL REFERENCE EXCEPTION”. Can anyone please tell me what changes shall I make to avoid this, other than introducing Exception Shape?
Thanks and regards,
Kunal