Enterprise Integration Zone is brought to you in partnership with:

Madhuka is Software Engineer and currently works on the Jaggery, UES, WSO2 Gadget Server team. He holds a B.Sc (Hons) degree in Information Technology from the Faculty of Information Madhuka is a DZone MVB and is not an employee of DZone and has posted 50 posts at DZone. You can read more from them at their website. View Full User Profile

Calling SOAP Web Service From (JavaScript) Jaggery

02.20.2013
| 5729 views |
  • submit to reddit
Here I am going to call web services in http://localhost:9765/services/BAMToolboxDepolyerService?wsdl from jaggery (javascripte code). This sample is testing web services runnning in WSO2 BAM.

Thinks that i have know about the services before I am calling that from jaggery.

image

EXAMPLE CODE

<%
function invokeBasicToolBoxes() {
    var log = new Log();
     var ws = require("ws");

     var bam = new ws.WSRequest();
     var options = new Array();
     options.useSOAP = 1.2;
     options.action = "urn:getBasicToolBoxes";
     var payload =null;
     var result;

     try {
         bam.open(options,"https://10.100.3.27:9445/services/BAMToolboxDepolyerService", false);
         bam.send(payload);
         result = bam;
     } catch (e) {
         log.error(e.toString());
         return e.toString();
    }
     return result.responseText;
}

print(invokeBasicToolBoxes());
%>



Published at DZone with permission of Madhuka Udantha, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)