Ibrahim Bittar Posted August 14, 2014 Posted August 14, 2014 Hi all I'm writing this script: import wslite.soap.SOAPClient import groovy.xml.StreamingMarkupBuilder import groovy.xml.XmlUtil client = new SOAPClient(Server + '?wsdl') list = client.send(SOAPAction:Server + '.TimbradoHttpSoap11Endpoint/HTTP/1.1') { body{ buscar('xmlns':'http://utilerias.timbrado.ws.cfdi.solucionfactible.com') { usuario(Usuario) password(Password) parametros{ cancelada(cancelada) emisorNombre(emisorNombre) emisorRFC(emisorRFC) fechaEmisionFin(fechaEmisionFin) fechaEmisionInicio(fechaEmisionInicio) fechaTimbradoFin(fechaTimbradoFin) fechaTimbradoInicio(fechaTimbradoInicio) folio(folio) offset(offset) receptorNombre(receptorNombre) receptorRFC(receptorRFC) serie(serie) uuid(uuid) } } } } x = list.getBody().buscarResponse // uncomment each of these in turn to see the specific result m = x.return.toString() me = x.return.mensaje.toString() st = x.return.status.toString() cancelado = x.return.cfdis.cancelado.toString() emisorNombre = x.return.cfdis.emisorNombre.toString() emisorRFC = x.return.cfdis.emisorRFC.toString() fechaCancelacion = x.return.cfdis.fechaCancelacion.toString() fechaEmision = x.return.cfdis.fechaEmision.toString() fechaTimbrado = x.return.cfdis.fechaTimbrado.toString() folio = x.return.cfdis.folio.toString() receptorNombre = x.return.cfdis.receptorNombre.toString() receptorRFC = x.return.cfdis.receptorRFC.toString() selloDigital = x.return.cfdis.selloDigital.toString() selloSAT = x.return.cfdis.selloSAT.toString() serie = x.return.cfdis.serie.toString() total = x.return.cfdis.total.toString() uuid = x.return.cfdis.uuid.toString() smb = new StreamingMarkupBuilder() smb.encoding = 'UTF-8' def req = { mkp.xmlDeclaration() result{ mensaje(me) status(st) cancelado(cancelado) emisorNombre(emisorNombre) emisorRFC(emisorRFC) fechaCancelacion(fechaCancelacion) fechaEmision(fechaEmision) fechaTimbrado(fechaTimbrado) folio(folio) receptorNombre(receptorNombre) receptorRFC(receptorRFC) selloDigital(selloDigital) selloSAT(selloSAT) serie(serie) total(total) uuid(uuid) } } xms = smb.bind(req) //uncomment this to see as XML return XmlUtil.serialize(xms) START = '$' JOIN = ' = "' MID = '" ;n$' END = '" ;n' return START + 'mensaje' + JOIN + me + MID + 'status' + JOIN + st + '"' + MID + 'cancelado' + JOIN + cancelado + '"' + MID + 'emisorNombre' + JOIN + emisorNombre + '"' + MID + 'emisorRFC' + JOIN + emisorRFC + '"' + MID + 'fechaCancelacion' + JOIN + fechaCancelacion + '"' + MID + 'fechaEmision' + JOIN + fechaEmision + '"' + MID + 'fechaTimbrado' + JOIN + fechaTimbrado + '"' + MID + 'folio' + JOIN + folio + '"' + MID + 'receptorNombre' + JOIN + receptorNombre + '"' + MID + 'receptorRFC' + JOIN + receptorRFC + '"' + MID + 'selloDigital' + JOIN + selloDigital + '"' + MID + 'selloSAT' + JOIN + selloSAT + '"' + MID + 'serie' + JOIN + serie + '"' + MID + 'total' + JOIN + total + '"' + MID + 'uuid' + JOIN + uuid + '"' And not matter what i do, during runtime I get this error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 10: unexpected char: 0xA0 @ line 10, column 1. buscar('xmlns':'http://utilerias.timbrado.ws.cfdi.solucionfactible.com') ^ 1 error Can you please tell me where the error is?. Thanks in advance. Ibrahim
john renfrew Posted August 14, 2014 Posted August 14, 2014 Its an invisible character that you have copied from the internet... somewhere in line 10 delete every space then put them back- - it will be hiding somewhere in there...
Recommended Posts
This topic is 3765 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now