cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
706
Views
1
Helpful
2
Replies

Call an external web service from a finesse gadget

Telecom Team
Level 1
Level 1

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!

2 Replies 2

ewindgat
Level 5
Level 5

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);

Nice, I'll give it a try

Thank you