login about faq

Hello I am trying to execute a method in a web service which I need to send a request like this:

POST /pruebastimbradofe/timbrado.asmx HTTP/1.1
Host: app.facturadorelectronico.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://facturadorelectronico.com/timbrado/obtenerTimbrado"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <obtenerTimbrado xmlns="http://facturadorelectronico.com/timbrado/">
      <CFDIcliente>string</CFDIcliente>
      <Usuario>string</Usuario>
      <password>string</password>
    </obtenerTimbrado>
  </soap:Body>
</soap:Envelope>

I can not get a correct answer, the source code is as follows:

loHttp = CreateObject('Chilkat.Http')
lnSuccess = loHttp.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loHttp.LastErrorText)
    QUIT
ENDIF
Use BDSoap In 0
 Select BDSoap
 lcStrXml = Cmp4

loHttp.Accept = ""
loHttp.AcceptCharset = ""
loHttp.UserAgent = ""
loHttp.AcceptLanguage = ""
loHttp.AllowGzip = .F.
loHttp.SetRequestHeader("SOAPAction",'http://facturadorelectronico.com/timbrado/obtenerTimbrado')
loHttp.SetRequestHeader("Content-Type",'text/xml; charset=utf-8')
lcEndPoint = "https://app.facturadorelectronico.com/pruebastimbradofe/timbrado.asmx"
loResp = loHttp.PostXml(lcEndPoint,lcStrXml,"utf-8")
IF IsNull(loResp) THEN
    ? loHttp.LastErrorText
    ? "LastHeader:"
    ? loHttp.LastHeader
ELSE
    *  You may examine the exact HTTP header sent with the POST like this:
    Replace Cmp1 With "LastHeader:" + Chr(13) + loHttp.LastHeader
    *  Examine the XML returned by the web service:
    loXmlResp = CreateObject('Chilkat.Xml')
    lnSuccess = loXmlResp.LoadXml(loResp.BodyStr)
    Replace Cmp2 With "XML Response:" + Chr(13) + loXmlResp.GetXml()

 *  The actual XML response is the data within GetQuoteResult:
    loXmlResp = CreateObject('Chilkat.Xml')
    loXmlResp.LoadXml(loXmlResp.Content)

    Replace Cmp3 With loXmlResp.GetXml()
    Browse
ENDIF
Use In BDSoap

I think the problena was how to fill the post as I need to send post an xml <cfdicliente> in a string as well as the user name <usuario> and password <password>.

xml file to add like string in the post is this:

<?xml version="1.0" encoding="utf-8"?>
<cfdi:Comprobante xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:donat="http://www.sat.gob.mx/donat" xmlns:implocal="http://www.sat.gob.mx/implocal" xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv3.xsd http://www.sat.gob.mx/donat http://www.sat.gob.mx/sitio_internet/cfd/donat/donat.xsd http://www.sat.gob.mx/implocal http://www.sat.gob.mx/sitio_internet/cfd/implocal/implocal.xsd" version="3.0" serie="Sin Serie" folio="1502" fecha="2012-03-13T11:47:39" sello="08Ra3QklxfnPvGlZQRwKWY0BfVNuU8CtKJJj2ZWZ1+fHLipDWoJEz+2DfRMvI60u9TDMqgR828FV900Q9QyvJDGN8ctp+P9aZc8x5SfudLi+kqpZtqidCZnhggOP8w6F1cD1eET1uDupex0aI32CdOB7M/Wb9nJ2F5leeQhYnvY=" formaDePago="PAGO EN UNA SOLA EXHIBICION" noCertificado="20001000000100001708" certificado="MIIFGDCCBACgAwIBAgIUMjAwMDEwMDAwMDAxMDAwMDE3MDgwDQYJKoZIhvcNAQEFBQAwggFvMRgwFgYDVQQDDA9BLkMuIGRlIHBydWViYXMxLzAtBgNVBAoMJlNlcnZpY2lvIGRlIEFkbWluaXN0cmFjacOzbiBUcmlidXRhcmlhMTgwNgYDVQQLDC9BZG1pbmlzdHJhY2nDs24gZGUgU2VndXJpZGFkIGRlIGxhIEluZm9ybWFjacOzbjEpMCcGCSqGSIb3DQEJARYaYXNpc25ldEBwcnVlYmFzLnNhdC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MAoGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQCI6Br/9uOa0XpsjYKpq6X5A1PSQ8AsrwpukmnF89oGwr7NkccFZs8cIlX9cbaUsb63vaCK6g2EDuJDmlFco57+I+Wx0RqduRVVcoOc5odmpQJHP0tLE++UK/fUjbJvkGogYzwOQ8x/qJgkrI8StEvwzAUBAuQXCU0W5Unhg/dLyR7DcmEWmRwQkKJMnOEQ6RTiALmY2QIOIEIk6QJ7xmu1V1jLN8A/q9I54+0HZRV8FjoAG5iGEk7P/Mxgyc8btwNOROu3ZL5p2TvoXrb7CAF3sZpTf0FdtpIc/335H0zqS2m6ASk9d+HlA1TWN/I9XTssrHv0nmbtB5CRS8HOS4BR" subTotal="900.0000" TipoCambio="1.0000" Moneda="PESOS" total="1044.0000" tipoDeComprobante="ingreso">
  <cfdi:Emisor rfc="GOYA780416GM0" nombre="DISEÑO Y FABRICACION DE CARROCERIAS TREMISA SA DE CV">
    <cfdi:DomicilioFiscal calle="CALL 79" noExterior="676 X 101 Y 106" colonia="COL SAMBULA" municipio="MERIDA" estado="Yucatán" pais="México" codigoPostal="97259" />
    <cfdi:ExpedidoEn calle="Insurgentes" noExterior="2" noInterior="5" colonia="Las villas" localidad="Localidad" referencia="Referencia" municipio="Monterrey" estado="Nuevo Leon" pais="MEXICO" codigoPostal="77646" />
  </cfdi:Emisor>
  <cfdi:Receptor rfc="AVV880912DQ4" nombre="A.V. VACACIONES FANTASTICAS S.A DE C.V">
    <cfdi:Domicilio calle="INSURGENTES" noExterior="10" colonia="LA MORENA" municipio="MONTERREY" estado="NUEVO LEON" pais="MEXICO" codigoPostal="77646" />
  </cfdi:Receptor>
  <cfdi:Conceptos>
    <cfdi:Concepto cantidad="1.00" unidad="Servicio" noIdentificacion="0103" descripcion="Habitacion Paquete" valorUnitario="900.0000" importe="900.0000" />
  </cfdi:Conceptos>
  <cfdi:Impuestos totalImpuestosTrasladados="144.0000" totalImpuestosRetenidos="0.0000">
    <cfdi:Traslados>
      <cfdi:Traslado impuesto="IVA" tasa="16.0000" importe="144.0000" />
    </cfdi:Traslados>
  </cfdi:Impuestos>
  <cfdi:Complemento />
</cfdi:Comprobante>

asked Sep 06 '12 at 11:42

Benjam%C3%ADn's gravatar image

Benjamín
1111


I don't exactly know how to answer this question.

You state the desire to send an HTTP request that contains some specific XML in the request body. The answer is to simply pass a string containing that XML to the PostXml method. I must be missing something?

link

answered Sep 10 '12 at 12:27

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

hola, yo intento hacer lo mismo de mandar a timbrar consumiendo el servicio, Uso las librerias de chilkat pero con otro lenguaje y me ha funcionado bien pero apenas me veo en la necesidad de hacer lago con access. Igual podemo hacer algo lo de consumir web services con otro lenguaje y mandarlo a timbrar ya lo he hecho si quieres responde y nos ponemos de acuerdo mi correo es pacosoriano arroba msn punto com

saludos

link

answered Sep 14 '12 at 19:33

pacosoriano's gravatar image

pacosoriano
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×186

Asked: Sep 06 '12 at 11:42

Seen: 5,477 times

Last updated: Sep 14 '12 at 19:33

powered by OSQA