strong-soap

How to stub SOAP client request with sinon in Node JS?

左心房为你撑大大i 提交于 2019-12-25 17:03:26
问题 I am using strong-soap module to get data from SOAP request. var soap = require('strong-soap').soap; soap.createClient(url, options, function (err, client) { var method = client.GetInfoSOAP; method(requestQuery, function (err, info) { // bla bla } } I am getting the required data. Now I want to write unit test case to mock the SOAP request using sinon stub, but didn't get any success. Any help would be appreciated. 回答1: What you want is controlling the soap object's createClient . You can do

How to stub SOAP client request with sinon in Node JS?

我的梦境 提交于 2019-12-25 17:03:15
问题 I am using strong-soap module to get data from SOAP request. var soap = require('strong-soap').soap; soap.createClient(url, options, function (err, client) { var method = client.GetInfoSOAP; method(requestQuery, function (err, info) { // bla bla } } I am getting the required data. Now I want to write unit test case to mock the SOAP request using sinon stub, but didn't get any success. Any help would be appreciated. 回答1: What you want is controlling the soap object's createClient . You can do

How to send a SOAP1.2 request from node.js strong soap?

别来无恙 提交于 2019-12-11 18:32:18
问题 I am using this library https://github.com/strongloop/strong-soap#client to send a SOAP1.2 request. Using SOAPUI I can send this (I omitted the api key here) <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="urn:IQTrack/WebServices/v1"> <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:To>https://webservices.iqtrack.com/RequesterSync.svc</wsa:To> </soap:Header> <soap:Body> <v1:VerifyApiKey> <!--Optional:--> <v1:apiKey>API KEY</v1:apiKey> </v1

How do you get the server url to give to the client when using Node-soap or Strong-soap

六眼飞鱼酱① 提交于 2019-12-11 07:35:40
问题 I am writing a service with node.js' node-soap package. The service seem to run okay when I do "node myService.js". Now, how do I get the url that would be given to the client? If you want my wsdl file, "myservice.wsdl" as per the code below please let me know. here is my code var http = require('http'); var soap = require('soap'); var express = require('express'); var bodyParser = require('body-parser'); var myService = { MyService: { MyPort: { post_csvDoc: function(csvDoc) { return 200; },