07-13-2015 11:35 AM
Hi,
I'm interresed to know if its possible to call an external web service from a finesse gadget. The web service would be hosted on a different server than finesse. Will I have "cross domain" problem?
Thank you!
07-13-2015 05:38 PM
Yes, you could have a cross domain issue, unless the web service you are calling has a PJSON or equivalent method.
The good news, is Finesse has a feature that allows you to call a cross domain web service from a gadget. The WebServiceSample gadget has a good example.
Here is a code snippet showing the use of makeRequest...
params = params || {};
params[gadgets.io.RequestParameters.HEADERS] = params[gadgets.io.RequestParameters.HEADERS] || {};
// This is the url we want to get to:
// http://10.88.194.158:8080/userContent/HelloWorld.html
// TODO: Change the IP address to your server
gadgets.io.makeRequest(encodeURI("//10.88.194.158:8080") + url, handler, params);
07-14-2015 05:24 AM
Nice, I'll give it a try
Thank you
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide