Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accesing a Web Service with VFP
Message
From
28/04/2020 12:44:25
 
 
To
28/04/2020 06:26:27
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
01674162
Message ID:
01674186
Views:
53
Hi Antonio, thank you very much for your time and help.

I guess I got connected to the WS. I see, in your example, that the "json" variable is empty, and the message that I retrieved from the WS was:
{"error":-1,"mensaje":"La variable \"json\" esta vacia"}
So, the only (and hardest part, I guess), is to convert the data into the json multidimensional array. I've learned that there is a tool to use Json from VFP, do you know it?

Again, thank you very much.


>Luis, this is the basics of the call to this service.
>
>
>LOCAL Usuario AS String
>LOCAL Seña AS String
>
>m.Usuario = "XX.XX01X3"
>m.Seña = "1ec44c2f7787fa1c7b7f47bf2c1f44a2bc18adee"
>
>LOCAL Parametros AS String
>
>* the parameters, in JSON format
>* check Marco's library at VFPX, for instance, to ease the parameter encoding process
>m.Parametros = "{}"
>
>LOCAL HTTP AS MSXML2.ServerXMLHTTP60
>
>m.HTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
>
>m.HTTP.Open("Post", "https://app.urbano.com.pe/ws/ue/ge/", .F.)
>
>m.HTTP.Setrequestheader("Content-type", "application/x-www-form-urlencoded")
>m.HTTP.Setrequestheader("user", m.Usuario)
>m.HTTP.Setrequestheader("pass", m.Seña)
>
>m.HTTP.Send("json=" + m.Parametros)
>
>? "" + m.HTTP.Responsebody
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform