io.github.carlosthe19916.webservices.wrappers.BillServiceWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sunat-web-services Show documentation
Show all versions of sunat-web-services Show documentation
Sunat Web Services Endpoints
package io.github.carlosthe19916.webservices.wrappers;
import io.github.carlosthe19916.webservices.factories.ServiceFactory;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.util.ByteArrayDataSource;
public class BillServiceWrapper {
private BillServiceWrapper() {
// Just static methods
}
public static byte[] sendBill(ServiceConfig config, String fileName, byte[] zipFile, String partyType) {
service.sunat.gob.pe.billservice.BillService billService = ServiceFactory.getInstance(service.sunat.gob.pe.billservice.BillService.class, config);
DataSource dataSource = new ByteArrayDataSource(zipFile, "application/zip");
DataHandler dataHandler = new DataHandler(dataSource);
return billService.sendBill(fileName, dataHandler, partyType);
}
public static service.sunat.gob.pe.billservice.StatusResponse getStatus(ServiceConfig config, String ticket) {
service.sunat.gob.pe.billservice.BillService billService = ServiceFactory.getInstance(service.sunat.gob.pe.billservice.BillService.class, config);
return billService.getStatus(ticket);
}
public static String sendSummary(ServiceConfig config, String fileName, byte[] zipFile, String partyType) {
service.sunat.gob.pe.billservice.BillService billService = ServiceFactory.getInstance(service.sunat.gob.pe.billservice.BillService.class, config);
DataSource dataSource = new ByteArrayDataSource(zipFile, "application/zip");
DataHandler dataHandler = new DataHandler(dataSource);
return billService.sendSummary(fileName, dataHandler, partyType);
}
public static String sendPack(ServiceConfig config, String fileName, byte[] zipFile, String partyType) {
service.sunat.gob.pe.billservice.BillService billService = ServiceFactory.getInstance(service.sunat.gob.pe.billservice.BillService.class, config);
DataSource dataSource = new ByteArrayDataSource(zipFile, "application/zip");
DataHandler dataHandler = new DataHandler(dataSource);
return billService.sendPack(fileName, dataHandler, partyType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy