Página 1 de 7

(Nuevo) Web Service para Validar del SAT

Publicado: Vie Ene 10, 2014 3:32 pm
por angreyes
No vi donde ponerlo en el foro pero si ya existe uno comentar por favor ......

la pregunta es si alguien de ustedes ya implemento lo que esta en esta liga.


ftp://ftp2.sat.gob.mx/asistencia_servic ... taCFDI.pdf

saludos.

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Vie Ene 10, 2014 3:43 pm
por Dado
angreyes escribió:No vi donde ponerlo en el foro pero si ya existe uno comentar por favor ......

la pregunta es si alguien de ustedes ya implemento lo que esta en esta liga.


ftp://ftp2.sat.gob.mx/asistencia_servic ... taCFDI.pdf

saludos.
Orale, no estaba enterado de ese nuevo servicio, este fin de semana ya tengo (otra) cosa mas que hacer

Gracias por la informacion


__________________________________
pd. separe este tema de donde lo habias publicado originalmente ya que me parece que vale la pena que tenga su propio hilo de mensajes

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Lun Ene 13, 2014 10:24 am
por s3cr3to
Buen día DADO,
¿No te dió problema en Delphi7 usar los wsdl que define el servicio?
Intente con Delphi7 usando los url que indca el pdf

Código: Seleccionar todo

https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc

a) https://consultaqr.facturaelectronica.sat.gob.mx/consultacfdiservice.svc?wsdl
b) https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?singleWsdl

https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd0
https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd1
https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc?xsd=xsd2
Pero en D7, me pone en codigo ciertos comentarios que me hacen dudar que este bien el wsdl.
Usando a) https://consultaqr.facturaelectronica.s ... e.svc?wsdl

Código: Seleccionar todo

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:Consulta        - "http://tempuri.org/"
  // !:ConsultaResponse - "http://tempuri.org/"
Y algo semejante usando b) https://consultaqr.facturaelectronica.s ... singleWsdl

Código: Seleccionar todo

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file.  ... ... , they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
No quiero hecharle la culpa a D7 antes que a mi ignorancia, aunque no es el primer wsdl balín (y/o que no he sabido procesar desde D7)...
¿Tendrás algún tipo que compartir al respecto?
Saludos

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Ene 23, 2014 2:24 pm
por s3cr3to
Curioso, al importar el wsdl en Delphi7 parece generar incompleto el código, pero en Lazarus(CodeTyphon) se genera mucho más completo.

Lazarus utiliza este paquete (intentare usarlo en D7):
“Web Service Toolkit” is a web services package for FPC, Lazarus and Delphi; “Web Service Toolkit” is meant to ease web services consumption and Creation by FPC, Lazarus and Delphi users.
https://sites.google.com/site/inoussa12 ... %26lazarus

Tendré que aprender a usar Lazarus (CodeTyphon), no es el primer webservices que en D7 se importa de manera extraña.

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 11:34 am
por MaltrakS
Hola yo e intentado SOAPUI para hacer pruebas pero me manda error, en realidad no se como mandar los parametros exactamente,
Alguien tiene idea?

le mando este parametro
<tem:expresionImpresa>"?re=XAXX010101000&rr=XAXX010101000&tt=1234567890.123456&id=ad662d33-6934-459c-a128-BDf0393f0f44"
</tem:expresionImpresa>

y me devuelve este error
<Message>Unexpected end of file. Following elements are not closed: expresionImpresa, Consulta, Body, Envelope. Line 10, position 20.</Message>
<StackTrace>at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
at System.Xml.XmlBufferReader.GetByteHard()
at System.Xml.XmlUTF8TextReader.ReadCharRef()
at System.Xml.XmlUTF8TextReader.ReadEscapedText()
at System.Xml.XmlUTF8TextReader.Read()
at System.Xml.XmlDictionaryReader.ReadContentAsString(Int32 maxStringContentLength)
at System.Xml.XmlBaseReader.ReadContentAsString()
at System.Xml.XmlBaseReader.ReadElementContentAsString()
at System.Runtime.Serialization.StringDataContract.ReadXmlValue(XmlReaderDelegator reader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)</StackTrace>
<Type>System.Xml.XmlException</Type>
</InnerException>
<Message>There was an error deserializing the object of type System.String. Unexpected end of file. Following elements are not closed: expresionImpresa, Consulta, Body, Envelope. Line 10, position 20.</Message>

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 11:44 am
por Dado
yo tampoco he podido avanzar en el uso de este servicio

pero si me permites aconsejarte.....quitale las comillas, como que tengo la espina que no deberian ir :

<tem:expresionImpresa>"?re=XAXX010101000&rr=XAXX010101000&tt=1234567890.123456&id=ad662d33-6934-459c-a128-BDf0393f0f44"
</tem:expresionImpresa>

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 12:20 pm
por MaltrakS
Ya lo hice y no, des pues lo intente como un array
<tem:expresionImpresa>{re=XAXX010101000,rr=XAXX010101000,tt=1234567890.123456,id=ad662d33-6934-459c-a128-BDf0393f0f44}
</tem:expresionImpresa>

ahora me manda otro mensaje.
<a:CodigoEstatus>N - 601: La expresión impresa proporcionada no es válida.</a:CodigoEstatus>
<a:Estado>No Encontrado</a:Estado>

Re: (BINGO!!!) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 12:26 pm
por MaltrakS
Listo ya funciono Camaradas.

<tem:expresionImpresa>
<![CDATA[?re=BEN9501023I0&rr=SARM8209281F1&tt=440.000000&id=EC609EC1-5F63-4333-A2B8-2EDC10B68075]]>
</tem:expresionImpresa>

<ConsultaResult xmlns:a="http://schemas.datacontract.org/2004/07 ... i.Servicio" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CodigoEstatus>S - Comprobante obtenido satisfactoriamente.</a:CodigoEstatus>
<a:Estado>Vigente</a:Estado>
</ConsultaResult>

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 12:29 pm
por Dado
Wow! esa informacion es oro, ya tengo para seguir probando

Uh! casi lo olvido......gracias :P

Re: (Nuevo) Web Service para Validar del SAT

Publicado: Jue Feb 06, 2014 12:43 pm
por MaltrakS
Aqui les tengo un ejemplo hecho en c#
http://maltrak.blogspot.mx/2014/02/vali ... l-sat.html