Tag: soap

NPM SOAP包 – 客户端单身?

我正在使用这个npm包: https ://www.npmjs.com/package/soap 我无法在文档中find答案,因为我想知道SOAP客户机的最佳实践是如何创build一个单独的客户机作为启动“并用于所有请求(类似于数据库客户机),或者为每个请求创build一个新的请求。

将Js节点作为服务器http来使用外部Web服务

我想要安装Node Js以在SOAP中使用外部Web服务。 这是架构: |Webshere application| —HTTP—> |Node Js| —-HTTPS–> ||External Web Service|| 这是我正在做的脚本: var http = require('http'); var httpntlm = require('httpntlm'); var options = { url: "https://serverexterno/WebServiceSOAP?wsdl" } const server = http.createServer( (req, res) => { let body = ''; let headers = req.headers let as400Response =''; req.setEncoding('ascii'); req.on('data', (chunk) => { body += chunk; […]

使用node-soap发送正确的soap请求

我正在面对一个非常恼人的问题发送肥皂请求。 如果我使用像SOAP-UI这样的工具,我可以轻松地在XML中构build适当的soap请求。 但是,如果我试图使用节点肥皂发送此肥皂请求我无法得到正确的xmlstring… 我不知道为什么,但node-soap插件将string“SoapIn”附加到方法名称(GetArrBoardWithDetail)。 看下面的代码片段: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://thalesgroup.com/RTTI/2017-02-02/ldb/" xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types" xmlns:ct2007="http://thalesgroup.com/RTTI/2007-10-10/ldb/commontypes" xmlns:ct2015="http://thalesgroup.com/RTTI/2015-11-27/ldb/commontypes" xmlns:ldbt2017="http://thalesgroup.com/RTTI/2017-02-02/ldb/types"> <soapenv:Header> <tok:AccessToken> <tok:TokenValue>asdf</tok:TokenValue> </tok:AccessToken> </soapenv:Header> <soapenv:Body> <tns:**GetArrBoardWithDetailsSoapIn**> <tns:numRows>50</tns:numRows> <tns:crs>ACY</tns:crs> <tns:filterCrs></tns:filterCrs> <tns:filterType>to</tns:filterType> <tns:timeOffset>0</tns:timeOffset> <tns:timeWindow>120</tns:timeWindow> </tns:**GetArrBoardWithDetailsSoapIn**> </soapenv:Body> </soapenv:Envelope> 外部工具SoapUI不会附加像“SoapIn”这样的string。 肥皂用户界面附加string“Request”(请参阅​​下面的代码片段)。 <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://thalesgroup.com/RTTI/2017-02-02/ldb/" xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types" xmlns:ct2007="http://thalesgroup.com/RTTI/2007-10-10/ldb/commontypes" xmlns:ct2015="http://thalesgroup.com/RTTI/2015-11-27/ldb/commontypes" xmlns:ldbt2017="http://thalesgroup.com/RTTI/2017-02-02/ldb/types"> <soapenv:Header> <tok:AccessToken> <tok:TokenValue>asdf</tok:TokenValue> </tok:AccessToken> </soapenv:Header> <soapenv:Body> <tns:**GetArrBoardWithDetailsRequest**> <tns:numRows>50</tns:numRows> <tns:crs>ACY</tns:crs> <tns:filterCrs></tns:filterCrs> <tns:filterType>to</tns:filterType> <tns:timeOffset>0</tns:timeOffset> <tns:timeWindow>120</tns:timeWindow> […]

node-soap:“第一个标记之前的非空白”。

我的WSDL是有效的,但是这个错误(在title中)发生在soap.createClient 。 WSDL托pipe在服务器上。 在检查node-soap源码之后,看起来好像我是否可以禁用WSDL类中的“strict”标志,这个错误不会发生,但是我似乎无法弄清楚如何禁用它。 我尝试将选项传递给createClient方法,如下所示: soap.createClient(wsdl, { strict: false }, callback); 但是这似乎并没有解决这个问题。 不幸的是,我不能共享WSDL,但是可以确定它通过了validation,并且在开始标记之前没有“非空白”。 我相当肯定,如果我可以以某种方式禁用wsdl类中的严格选项,可以解决问题。 有没有人有过这种情况发生过?

使用Javascript访问JSONparsing的SOAP信封

这是我的第一篇文章,我对这个奇妙的发展世界是新的,所以如果这是一个愚蠢的问题,我提前道歉。 我正在使用Xml2js发送肥皂请求。 然后我把这个响应parsing成json。 我的问题是深入到肥皂信封。 这就是响应的样子: { 'soap:Envelope': { '$': { 'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/' }, 'soap:Header': [ [Object] ], 'soap:Body': [ [Object] ] } } 这是一个扩大的观点 { 'soap:Envelope': { '$': { 'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/' }, 'soap:Header': [ { DWHeader: [ { '$': { xmlns: 'Some Xmls' }, SenderInfo: [ { ApplicationID: [ 'Id' ], Credentials: [ { AuthToken: […]

使用Node通过https调用SOAP Web服务

我正在尝试使用node-soap https://github.com/vpulim/node-soap来调用Web服务,但是我在使用https模块时遇到问题。 在下面的代码中,我使用http ,我可以看到函数并loggingAbout函数的describe() 。 (响应是空的,可能是因为在使用http(?)时WS被设置为这样) var soap = require('soap'); var url = "http://XXXXX/service.svc?DocArchiveService/DocArchiveV201409"; var auth = "Basic " + new Buffer("USERXXX" + ":" + "PWYYY").toString("base64"); var args = {}; soap.createClient(url, { wsdl_headers: {Authorization: auth} }, function(err, client) { console.log(client.describe().DocArchiveV201409.DocArchiveV201409Soap.About); client.DocArchiveV201409.DocArchiveV201409Soap.About(args, function(err, result){ if (err) throw err; console.log(result); }); }); 输出: { input: {}, output: […]

节点SOAP WSDL请求不完整(只有一些块)

我无法使用node-soap npm模块访问SOAP Web服务。 这就是我想要的: var url = 'https://ws-uat.ewinerysolutions.com/2.00/EWSWebServices.asmx?wsdl'; soap.createClient(url, function(err, client) { if(err) { console.log(err); } console.log(client.describe()); } 这不会出错,但会logging一个空的对象。 检查client显示返回的XML被截断,这反过来使node-soap模块不能构build适当的客户端。 XML的确切长度在16348字节的数量上波动。 如果我移动WSDL以引用本地文件,则client.describe()将按预期执行,并且对Web服务的调用也可用。 然而,对这种请求的更长的回应也会以类似的方式截断。 这导致我相信有一些东西在所有的数据块被接收之前closures了连接,所以我检出了请求 npm模块(也与节点打包在一起)。 为了解决这个问题,我试图只使用请求模块来检索WSDL : var request = require('request'); var body = ""; request.get('https://ws-uat.ewinerysolutions.com/2.00/EWSWebServices.asmx?wsdl') .on('data', function(data){ body += data; }).on('end', function() { console.log(body); }) 查看返回被截断的XML正文的实时版本 。 我已经有了这些工作之前,这些相同的库,只是为了确保我已经尝试运行相同的程序与一系列旧版本的依赖库。 我对这个东西也还是比较新的,所以任何帮助/指针都将不胜感激!

在Nodejs中结合复杂的filter范围

在Magento 1.8 SOAP APIv2,我正在寻找一种方法来获取date范围从SOAP API检索信息。 我已经咨询了从stackoverflow本身的查询,即组合复杂的filter的范围 。 需要在我的节点项目中应用相同types的复杂filter。 确定使用magento节点封装,即https://github.com/MadisonReed/magentoapi exports.find = function (req, res) { async.waterfall([ function (done) { magento.login(function(err, sessId) { if (err) { // deal with error console.log('login error:' + err); return; } done(err, done); // http://localhost/api/rest/customers }); }, function (filteredCustomer, done) { var attributes = []; var filteredCustomer = []; magento.customer.list({filters: [ […]

Node.js Soap:rpc样式绑定的无效消息定义

我试图从节点使用wsdl。 使用'vpulim / node-soap'。 我可以加载wsdl,描述它,甚至调用某些函数。 但是,任何时候我试图调用一个不期望任何参数的函数,我得到的错误: assert.js:92 throw new assert.AssertionError({ ^ AssertionError: invalid message definition for rpc style binding at Client._invoke (/home/user/node_scripts/application/node_modules/soap/lib/client.js:126:12) at null.getManagedModules (/home/user/node_scripts/application/node_modules/soap/lib/client.js:87:10) at /home/user/node_scripts/application/client.js:9:12 at /home/user/node_scripts/application/node_modules/soap/lib/soap.js:48:5 at null.callback (/home/user/node_scripts/application/node_modules/soap/lib/soap.js:35:7) at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:716:12 at WSDL._processNextInclude (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:732:12) at WSDL.processIncludes (/home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:762:8) at /home/user/node_scripts/application/node_modules/soap/lib/wsdl.js:678:10 at process._tickCallback (node.js:415:13) 这里是describe(): { AlertPollingService: { AlertPollingService: { getManagementModule: [Object], getEMConfig: [Object], […]

如何在node-soap中使用派生types

我使用Node Soap https://github.com/vpulim/node-soap发送SOAP请求并parsing答案。 现在我有一个派生types的服务<searchedAddress xsi:type="PersonAddressDescription"> 。 如何在我的请求中指定xsi:type="PersonAddressDescription" ? 这就是我所做的 const args = { searchedAddress: { location: { street: 'Karl-Theorstraße 88', zip: '34234', city: 'Rummelshausen' }, firstName: 'Foo', lastName: 'Bar' } } soap.createClient(WSDL, wsdlOptions, (err, client) => { client.getReport(args, (err, result) => { if (err !== null) { console.log(client.lastRequest) reject(err) } resolve(result) }) }) 这就是请求的样子: <s:Envelope […]