예제 #1
0
 public String getXMLString(FolderType folder) throws Exception {
   StringWriter strWriter = new StringWriter();
   try {
     PatientSetJAXBUtil.getJAXBUtil().marshaller((Object) folder, strWriter);
   } catch (JAXBUtilException e) {
     log.error("Error marshalling Workplace folder");
     throw new JAXBUtilException(e.getMessage(), e);
   }
   return strWriter.toString();
 }
예제 #2
0
  public StatusType processResult(String response) {
    StatusType status = null;
    try {
      JAXBElement jaxbElement = PatientSetJAXBUtil.getJAXBUtil().unMashallFromString(response);
      respMessageType = (ResponseMessageType) jaxbElement.getValue();

      // Get response message status
      ResponseHeaderType responseHeader = respMessageType.getResponseHeader();
      status = responseHeader.getResultStatus().getStatus();
      String procStatus = status.getType();
      String procMessage = status.getValue();

      if (procStatus.equals("ERROR")) {
        log.error("Error reported by Workplace web Service " + procMessage);
      } else if (procStatus.equals("WARNING")) {
        log.error("Warning reported by Workplace web Service" + procMessage);
      }

    } catch (JAXBUtilException e) {
      log.error(e.getMessage());
    }
    return status;
  }