Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML, send and receive
Message
De
25/07/2016 12:06:42
 
 
À
25/07/2016 10:57:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01638597
Message ID:
01638599
Vues:
123
This message has been marked as the solution to the initial question of the thread.
>Hi friends:
>
>I need to send a XML string to an IP, actually is a fiscal printer. Then I need to receive the XML response from it...
>
>It is written easy, but I've been all the morning searching on the web and just found tones of explanations about consuming web services and xmladapters, and xmltocursor and so... and it is not what I'm looking for.
>
>Anyone knows how this can become a wonderful reality?
>
>Thank you.
>
> Héctor

I assume that you already took care of preparing the XML data to send, so you only need to send it and get the response, right? So, here are the basics...
LOCAL TargetURL AS String
LOCAL XMLToSend AS String
LOCAL Transporter AS MSXML2.ServerXMLHTTP60

m.TargetURL = "http://fiscal.printer.ip"

TEXT TO m.XMLToSend NOSHOW FLAGS 1
<?xml version="1.0" encoding="utf-8"?>
<root />
ENDTEXT

m.Transporter = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")

m.Transporter.Open("POST", m.TargetURL, .F.)
m.Transporter.Setrequestheader("Content-type", "text/xml")
m.Transporter.Send(m.XMLToSend)

STRTOFILE(m.Transporter.Responsexml.xml, PUTFILE("Response:","response.xml","xml"))
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform