views:

50

answers:

1

Hi,

I would like to call a webservice from javascript.

I tried:

var locator = new Service1Locator();
var wsdlURL = new URL(address);
var proxy = locator.getBasicHttpBinding_IService1(wsdlURL);
var result = proxy.execute("John Doe");

taken from : http://stackoverflow.com/questions/2147983/mirth-connect-javascript-to-call-a-webservice but it neither works nor do I understand it.

Can anyone help me please?

Lily

+2  A: 

If you want to call a web-service in the easiest way possible, it probably won't get much easier than using the jQuery ajax API. The documentation has some excellent examples (most are 1 to 3 lines of javascript). You just need to make sure to include the jQuery library in the page header and all that fun stuff.

R0MANARMY