示例#1
0
  public Result submitInvoiceData(AdapterRequest request) {

    String documentGroup = request.getDocumentGroup();
    String documentNumber = request.getDocumentNumber();
    String documentType = request.getDocumentType();

    DMSextract dmsExtract = dmsService.buildDMS(documentType, documentNumber, documentGroup);

    Result result = Result.getInstance(request);
    return result;
  }
示例#2
0
  public Result verifyCar(AdapterRequest request) {
    CarInfo carInfo = carService.getCarInfoById(request.getCarId());

    VerifyCarRequest req =
        new VerifyCarRequest.Builder()
            .vin(carInfo.getVinString())
            .ecv(carInfo.getEcvString())
            .ico(icoString)
            .irisUser(irisUser)
            .irisPwd(irisPwd)
            .build();

    Document verifyCarResult = null;
    Result result = Result.getInstance(request);
    result.setXmlInput(req.getXmlString());
    try {
      StringWriter respWriter = new StringWriter();
      ispelService.sendSourceAndReceiveToResult(
          new StreamSource(new StringReader(req.getXmlString())), new StreamResult(respWriter));
      result.setXmlOutput(respWriter.toString());
      verifyCarResult = responseResolver.getVerifyCarResult(respWriter.toString());
      result.setXmlOutput(xmlOutputter.get().outputString(verifyCarResult));
      carService.processVerifyCar(carInfo, verifyCarResult);
    } catch (Exception e) {
      logger.error(e);
      result.setProcessed(Result.UNPROCESSED);
      result.setErrorText(e.getMessage());
    }

    try {
      logService.logResult(result);
    } catch (Exception e) {
      logger.error("Log result error.");
      logger.error(e);
    }
    return result;
  }