project-openubl / xhandler Goto Github PK
View Code? Open in Web Editor NEWJava library for creating and sending XML files through SOAP - SUNAT
Home Page: https://project-openubl.github.io/
License: Apache License 2.0
Java library for creating and sending XML files through SOAP - SUNAT
Home Page: https://project-openubl.github.io/
License: Apache License 2.0
Estoy intentando ejecutar el metodo getStatusCDR de la clase BillConsultServiceManager pero obtengo una excepcion SOAPFaultException
El metodo que estoy empleando para ejecutarlo es el siguiente:
public void assertConsultToSunat(String ruc, String documentType , String serie, Integer numero, BillServiceModel.Status estado) throws Exception{ ServiceConfig serviceConfig = new ServiceConfig.Builder() .url(WEBSERVICE_URL) .username(WEBSERVICE_USERNAME) .password(WEBSERVICE_PASSWORD) .build(); BillConsultModel consulta = new BillConsultModel.Builder() .ruc(ruc) .serie(serie) .numero(numero) .tipo(documentType) .build(); StatusResponse statusResponse = BillConsultServiceManager.getStatusCdr(consulta, serviceConfig); assertEquals(statusResponse.getStatusCode(),estado); }
Lo cual me deberia devolver una instancia de la clase StatusResponse
sin embargo obtengo el error:
`
javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"", local:"rucComprobante"). Expected elements are <{}statusCdr>
at org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:195)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
at com.sun.proxy.$Proxy193.getStatusCdr(Unknown Source)
at io.github.project.openubl.xmlsenderws.webservices.wrappers.BillConsultServiceWrapper.getStatusCdr(BillConsultServiceWrapper.java:44)
at io.github.project.openubl.xmlsenderws.webservices.managers.BillConsultServiceManager.getStatusCdr(BillConsultServiceManager.java:34)
Caused by: org.apache.cxf.binding.soap.SoapFault: Unmarshalling Error: unexpected element (uri:"", local:"rucComprobante"). Expected elements are <{}statusCdr> `
Adjunto el soap response del servidor
ID: 1 Response-Code: 500 Encoding: UTF-8 Content-Type: text/xml;charset=UTF-8 Headers: {Content-Length=[308], content-type=[text/xml;charset=UTF-8], Date=[Mon, 21 Sep 2020 20:51:39 GMT], Server=[JBoss-EAP/7], X-Powered-By=[Undertow/1]} Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Unmarshalling Error: unexpected element (uri:"", local:"rucComprobante"). Expected elements are <{}statusCdr> </faultstring></soap:Fault></soap:Body></soap:Envelope>
Al momento de capturar la excepción del rechazo de un comprobante no esta incluido algunos códigos de error.
Debería existir una forma de incluir códigos de error adicional.
Screenshots
If applicable, add screenshots to help explain your problem.
Esta la descripción del código de error "Si tiene operaciones de un tributo en alguna linea, debe consignar el tag del total del tributo."
Pregunta copiada de otra fuente:
"Estoy intentanto usar libreria xml-sender-ws-2.1.1.Final.jar pero me sale el siguiente error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean
at io.github.project.openubl.xmlsenderws.webservices.wrappers.SunatServiceFactory.initInstance(SunatServiceFactory.java:67)
at io.github.project.openubl.xmlsenderws.webservices.wrappers.SunatServiceFactory.getInstance(SunatServiceFactory.java:59)
at io.github.project.openubl.xmlsenderws.webservices.wrappers.BillServiceWrapper.sendBill(BillServiceWrapper.java:32)
at io.github.project.openubl.xmlsenderws.webservices.providers.DefaultBillServiceProvider.sendBill(DefaultBillServiceProvider.java:136)
at io.github.project.openubl.xmlsenderws.webservices.managers.BillServiceManager.sendBill(BillServiceManager.java:63)
at io.github.project.openubl.xmlsenderws.webservices.managers.BillServiceManager.sendBill(BillServiceManager.java:53)
at io.github.project.openubl.xmlsenderws.webservices.managers.BillServiceManager.sendBill(BillServiceManager.java:45)
at key_jsic.Key_jsic_envio.main(Key_jsic_envio.java:35)
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxws.JaxWsProxyFactoryBean
Y me gustaria saber cómo resolverlo. Descargué la librería de este link https://github.com/project-openubl/xml-sender-ws/tree/2.1.1.Final"
Puedes poner descripción del funcionamiento y como podemos usarlo, Gracias
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.