on 05-14-2020 12:33 AM
Hello Experts,
I´m trying to consume this API https://www.banxico.org.mx/SieAPIRest/service/v1/series/SF43718/datos/oportuno?token=afb1ff06d28de69...
as you can see I only provide the series SF43718 and the Token, i follow some examplos of consumme a Rest API and the example where i get the Api from here:
https://www.banxico.org.mx/SieAPIRest/service/v1/doc/ejemplos
I create my external Rest webservice in SDK:
My Scenario:
And the arregement:
My question is where and what info i have to send, as you can see I´m trying to complete the link to get the contect but i´m not getting anything and a HTTP destination error too.
Here is my code:
import ABSL;
// Communication details
var ScenarioName = "Cambio_CS";
var ServiceName = "Cambio";
var HttpMethod = "GET";
var HttpResource = "datos/oportuno"; //URL – File Name"
// not required for this example
var ContentType = "jsonp";
var Body = "";
var HeaderParameter : collectionof NameAndValue; // Set URL Parameter
var URLParameter : collectionof NameAndValue;
var URLParameterEntry : NameAndValue;
URLParameterEntry.Name = "token";
URLParameterEntry.Value = "afb1ff06d28de692af5b679906c7d722454412908c4cb29687ac857786c95493";
URLParameter.Add(URLParameterEntry);
// Execute webservice call
var ws_result = WebServiceUtilities.ExecuteRESTService(ScenarioName, ServiceName, HttpMethod,
HttpResource, URLParameter, HeaderParameter, ContentType, Body);
//Parse result of Web service and retrieve city name; you may have to adapt the logic to the Web service used
this.WeatherResult = ws_result.Content;
Hope you can help me.
Thank you for your time.
Regards.
Hello Carlos,
To get this REST Service to work simply remove the HttpResource (leaving it blank) and pass the URL inside the WSID as far as the /oportuno collection.
Hope this helps,
Piotr.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Piotr,
Thank you for your answer, I tried removint the HttpResource as you mention but I´m still getting the next error "HTTP destination error" and the webservice returns only empty values, I tried creating a new external webservice and arregement but I get always the same result.
¿Could be the datatype in XML or JSON the reason im getting this error?
Regards.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.