meta data de esta página
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| lenguaje_java [2021/06/15 02:19] – [PASO 1: Configurar la ruta de nuestro servicio web y tokens de prueba] jsojo | lenguaje_java [2022/08/29 19:34] (actual) – lmartinez | ||
|---|---|---|---|
| Línea 58: | Línea 58: | ||
| Cuenta demo para hacer pruebas | Cuenta demo para hacer pruebas | ||
| - | LINK: [[http://demoemision.thefactoryhka.com.pa/ | + | LINK: [[https://demointegracion.ebi-pac.com/ |
| Usuario: %%“SOLICITAR”; | Usuario: %%“SOLICITAR”; | ||
| Línea 64: | Línea 64: | ||
| Password: %%“SOLICITAR”; | Password: %%“SOLICITAR”; | ||
| - | Se instancia los objetos utilizados | + | <code -> |
| + | public class EnviarDocumentoElectronico { | ||
| - | String wsdl = " | ||
| - | < | + | // Se instancia los objetos utilizados |
| + | |||
| + | String wsdl = " | ||
| String tokenEmpresa = " | String tokenEmpresa = " | ||
| String tokenPassword = " | String tokenPassword = " | ||
| + | |||
| org.tempuri.Service service = new org.tempuri.Service(); | org.tempuri.Service service = new org.tempuri.Service(); | ||
| Línea 142: | Línea 146: | ||
| datosTransaccion.setCliente(factory.createCliente(cliente)); | datosTransaccion.setCliente(factory.createCliente(cliente)); | ||
| + | |||
| //Datos DatosTransaccion en documentoElectronico | //Datos DatosTransaccion en documentoElectronico | ||
| Línea 288: | Línea 293: | ||
| totalesSubTotales.setTotalTodosItems(factory.createTotalesSubTotalesTotalTodosItems(" | totalesSubTotales.setTotalTodosItems(factory.createTotalesSubTotalesTotalTodosItems(" | ||
| + | |||
| //Datos Entrada formaPago en totalesSubTotales | //Datos Entrada formaPago en totalesSubTotales | ||
| Línea 304: | Línea 310: | ||
| totalesSubTotales.setListaFormaPago(factory.createListaFormaPago(listaFormaPago)); | totalesSubTotales.setListaFormaPago(factory.createListaFormaPago(listaFormaPago)); | ||
| + | |||
| //Datos Entrada retencion en totalesSubTotales | //Datos Entrada retencion en totalesSubTotales | ||
| Línea 330: | Línea 337: | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | ===== PASO 3: Enviar el objeto documento electronico ===== | ||
| + | |||
| + | Este Método permite enviar al servicio web el objeto documentoElectronico mediante el método enviar() parámetros : | ||
| + | |||
| + | <code -> | ||
| + | public | ||
| + | |||
| + | EnviarResponse enviarResponse; | ||
| + | |||
| + | try { | ||
| + | |||
| + | bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, | ||
| + | |||
| + | //Se Construye el objeto DocumentoElectronico | ||
| + | |||
| + | buildDocumentoElectronico(); | ||
| + | |||
| + | //Se envía DocumentoElectronico | ||
| + | |||
| + | System.out.println(" | ||
| + | |||
| + | //return port.enviar(tokenEmpresa, | ||
| + | |||
| + | enviarResponse = port.enviar(tokenEmpresa, | ||
| + | </ | ||
| + | |||
| + | ===== PASO 4: Obtener la respuesta de nuestro servicio web ===== | ||
| + | |||
| + | Recibirás una respuesta de nuestro servicio web, Se mostrara el código recibido con el mensaje y el código qr. | ||
| + | |||
| + | <code -> | ||
| + | // Respuesta | ||
| + | System.out.println(" | ||
| + | System.out.println(" | ||
| + | |||
| + | // link | ||
| + | URL url = new URL(enviarResponse.getQr().getValue()); | ||
| + | System.out.println(url.toURI()); | ||
| + | // | ||
| + | | ||
| + | } | ||
| + | catch (MalformedURLException | URISyntaxException e) { | ||
| + | System.out.println(" | ||
| + | } | ||
| + | } | ||
| + | | ||
| </ | </ | ||