コード例 #1
0
 @Override
 public OperationResult doOperation(Operation operation, ParameterContainer parameters)
     throws ExceptionReport, OXFException {
   try {
     XmlObject response = XmlFileLoader.loadXmlFileViaClassloader(file, getClass());
     return new OperationResult(response.newInputStream(), null, null);
   } catch (Exception e) {
     LOGGER.error("Could not load response file for testing: {}", file, e);
     fail("Failed to load response file.");
     return null;
   }
 }
コード例 #2
0
  @Override
  public InputStream generateStream(IData data, String mimeType, String schema) throws IOException {

    if (data instanceof GenericXMLDataBinding) {

      XmlObject xmlData = ((GenericXMLDataBinding) data).getPayload();

      XmlOptions xmlOptions = new XmlOptions();

      xmlOptions.setSaveNoXmlDecl();

      return xmlData.newInputStream(xmlOptions);
    }

    return XmlObject.Factory.newInstance().newInputStream();
  }