}
Document recordRetrievalRequestDocument = SSAFAdminUtility
.createRecordRetrievalRequest(recordURI);
RecordRetrievalResponse webServiceRetrieveResponse =null;
try
{
webServiceRetrieveResponse = recordRetrievalWebServiceClient
.retrieve(recordRetrievalRequestDocument.getDocumentElement());
}
catch (Exception e)
{
// This try/catch block is only to log message to log file.
// Once's it's logged re throw the exception so that it is handled in web flow.
log
.error("Caught exception when invoking record retrieval web service "
+ e.getMessage());
throw e;
}
if (webServiceRetrieveResponse == null)
{
throw new Exception("Unable to get response from Record Retrieval Service. Please try again later.");
}
Element reponseElement = (Element) webServiceRetrieveResponse.getAny();
// check if response is empty or payload, if it is later turn on the flag.
NodeList payloadNodeList = reponseElement
.getElementsByTagNameNS(SSAFNodes.payload.getNamespace(),
SSAFNodes.payload.getLocalName());