コード例 #1
0
 @POST
 @Path("/retention")
 @Consumes("application/json")
 @Produces("application/json")
 public Response processRetention(ComprobanteRetencion pRetention) {
   log.info("************ENTRA AL METODO POST RETENTION");
   ElectronicVoucherSender sender = new ElectronicVoucherSender();
   JSONObject response = sender.processVoucher(pRetention);
   return Response.status(200).entity(response.toString()).build();
 }
コード例 #2
0
  @POST
  @Path("/bill")
  @Consumes("application/json")
  @Produces("application/json")
  public Response processBilling(Factura pFactura) {
    log.info("************ENTRA AL METODO POST BILL");
    ElectronicVoucherSender sender = new ElectronicVoucherSender();
    JSONObject response = sender.processVoucher(pFactura);
    return Response.status(200).entity(response.toString()).build();

    /*Object obj = null;
    try{
    	obj = ((JSONObject)response.get("voucherReport")).get("generatedReport");
    }catch(Exception e){

    }
    ResponseBuilder responsew = Response.ok((Object) obj);
    responsew.header("Content-Disposition", "attachment; filename=\"COMPROBANTE\"");
    return responsew.build();*/
  }