Monday, October 24, 2016

How to call SOAP Web service using NODEJS

Use below code to call SOAP Web service using Nodejs
var soap = require('soap');
var url = 'http://localhost:8181/ScrumProjectWebService/services/ExposeWebService?wsdl';

var args = {sprintId: '1'};
soap.createClient(url, function(err, client) {
//To find what would be the below line to call method of webservice use the url of SOAPUI Tool
client.ExposeWebService.ExposeWebServiceHttpSoap12Endpoint.getKPI(args, function(err, result) {
console.log(result);
});
});
image6


image7
Note: Make sure you have soap module installed in yout Project else install it using below command
npm install soap

No comments: