Over a million developers have joined DZone.

Calling SOAP Web Service From (JavaScript) Jaggery

· Java Zone

Learn more about the advantages of moving from a monolithic to microservices architecture.  Brought to you in partnership with IBM.

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



From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.

Topics:

Published at DZone with permission of Madhuka Udantha, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}