Tag: soap

节点soap,消费密码保护的WSDL

我正在尝试使用Node构build一个SOAP客户端,我使用“soap”包( https://www.npmjs.org/package/soap )尝试使用受用户/密码保护的WSDL。 在“soap.createClient”创build客户端之前,我找不到如何传递这些凭据,当然,如果我没有提供正确的凭据,我无法检索到WSDL。 我试过了: soap.security.WSSecurity('user','pass'); 然后调用“createClient”但无济于事。 另外,我试图用node-soap-client来完成这个工作,我可以通过这个客户端(显然)连接到WSDL,但是之后我不知道该怎么去(如何调用方法)。 我究竟做错了什么? 感谢你的帮助!

无法为SOAP Node.js制定响应对象

我正在编写SOAP Node.js Web服务使用node-soap ,我无法弄清楚如何正确地制定响应。 我正在使用Web连接器将Web应用程序与QuickBooks 2013集成在一起。 客户端将请求进行身份validation,我可以logging传递的参数,所以我知道它被调用,但我无法得到正确的答复。 该文件说,它期待一个string数组作为响应。 WSDL的相关部分如下所示: <s:element name="authenticateResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="authenticateResult" type="tns:ArrayOfString" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="ArrayOfString"> <s:sequence> <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" /> </s:sequence> </s:complexType> <wsdl:message name="authenticateSoapOut"> <wsdl:part name="parameters" element="tns:authenticateResponse" /> </wsdl:message> <wsdl:operation name="authenticate"> <wsdl:input message="tns:authenticateSoapIn" /> <wsdl:output message="tns:authenticateSoapOut" /> </wsdl:operation> <wsdl:operation name="authenticate"> <soap:operation soapAction="http://developer.intuit.com/authenticate" style="document" […]

简单的SOAP调用失败(Nodejs,easysoap)

我在使用easysoap( https://npmjs.org/package/easysoap )时遇到了一些问题,而且我一直无法find很多文档或人们在讨论这个问题,所以我希望你们中的一些人可以帮忙: 我正在做一个这样简单的调用: var clientParams = { host : 'somewhere.com', port : '9001', path : '/somews.asmx', wsdl : '/somews.asmx?WSDL' }; var clientOptions = { secure : false }; //create new soap client var SoapClient = new soap.Client(clientParams, clientOptions); SoapClient.once('initialized', function() { //successful initialized SoapClient.once('soapMethod', function(data, header) { }); console.log('call'); SoapClient.call({ 'method' : 'Execute', 'params' […]

使用复杂types的Node.js SOAP调用

我目前正在尝试使用node-soap ( https://github.com/milewise/node-soap )来调用Authorize.net的SOAP服务器。 但是,我似乎无法让我的客户端代码传递适当的参数。 我知道该函数正在调用服务器,因为我得到一个服务器错误响应。 当我检查WSDL时,我注意到服务器调用需要ComplexType参数。 有没有办法来创build我需要的复杂types,或者我可以只使用Javascript对象? 这是我现在的代码: var soap = require('soap'); var url = 'https://api.authorize.net/soap/v1/Service.asmx?WSDL'; soap.createClient(url, function(err, client) { var args = { merchantAuthentication: { name: '285tUPuS', transactionKey: '58JKJ4T95uee75wd' } }; client.Service.ServiceSoap12.GetTransactionDetails(args, function(err, result) { if (err) { console.log(err); } else { console.log(result.GetTransactionDetailsResult[0].messages); } }); });

简单的web服务与节点肥皂

我正在尝试使用SOAP实现一个简单的Web服务,使用Node Js和node-soap,但客户端似乎在使用服务器时遇到问题。 assert.js:92 throw new assert.AssertionError({ ^ AssertionError: invalid message definition for document style binding 我的wsdl文件是: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="wscalc1" targetNamespace="http://localhost:8000/wscalc1" xmlns="http://localhost:8000/wscalc1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:message name="sumarRequest"> <wsdl:part name="a" type="xs:string"></wsdl:part> <wsdl:part name="b" type="xs:string"></wsdl:part> </wsdl:message> <wsdl:message name="multiplicarRequest"> <wsdl:part name="a" type="xs:string"></wsdl:part> <wsdl:part name="b" type="xs:string"></wsdl:part> </wsdl:message> <wsdl:message name="multiplicarResponse"> <wsdl:part name="res" type="xs:string"></wsdl:part> </wsdl:message> <wsdl:message name="sumarResponse"> <wsdl:part name="res" […]

使用node-soap在Node.js中通过Soap发送参数

我刚刚开始使用NodeJS,并开始使用milewise的node-soap与SOAP服务进行交谈 。 我正在使用基本的电子邮件地址validationSOAP API作为我的testing用例。 我似乎不明白正确的方式来格式化我的参数列表。 我的SOAP客户端代码: var url = "http://www.restfulwebservices.net/wcf/EmailValidationService.svc?wsdl"; soap.createClient(url, function(err, client){ console.log(client.describe().EmailValidationService.BasicHttpBinding_IEmailValidationService.Validate); client.Validate({result:"my@emailaddress.com"}, function(err, result){ console.log(result); }); }); client.describe()命令告诉我API如何将input格式化,以及如何返回输出。 这就是说: { input: { 'request[]': 'xs:string' }, output: { 'ValidateResult[]': 'xs:boolean' } } 但是,当我作为一个对象发送参数: {request:"my@emailaddress.com"} 我觉得我的问题在于我如何定义参数对象… request[]的括号是什么意思?

Nodejs Soap api调用返回“WSDL或包含的意外根元素”

我正在尝试使用node-soap模块访问web api,但是每次运行代码时,我都会收到以下错误:“WSDL的意外根元素或包含” var soap = require('soap'); var xml2js = require('xml2js'); var url = 'https://webservice.servcei.com/LoginXML'; var params = { Username:'webservice', Password:'Test123' }; soap.createClient(url,params,function(err,client){ console.log(err); });

在Node.js SOAP客户端中设置授权

我想通过Node.js中的SOAP客户端访问WSDL服务。 我用肥皂节点模块。 但我无法find任何文件来设置用户名和密码。 我不打算创buildSOAP服务器,我只是希望SOAPClient类似于PHP的SoapClient,使用它我应该能够访问WSDL服务。 更新 : 我已经分叉和定制源支持这个functionhttps://github.com/sincerekamal/node-soap

SOAP在Node.js中

当然,你会告诉我,SOAP是不推荐使用的,所有的,我都被迫使用它。 现在,我已经尝试使用冲洗模块( https://github.com/marcgreenstock/douche ),但是当我这样做时(WSDLurl没问题,实际上我正在尝试在test/index.js处提供的示例test/index.js ) Client.wsdl.parse(function(wsdl) { console.log(wsdl); }); 错误是: /usr/local/lib/node_modules/douche/lib/douche/wsdl.js:74 attrs.forEach(function(url,index) { ^ TypeError: Object #<Object> has no method 'forEach' at [object Object]._read_namespaces (/usr/local/lib/node_modules/douche/lib/douche/wsdl.js:74:9) at /usr/local/lib/node_modules/douche/lib/douche/wsdl.js:20:10 at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/douche/lib/douche/wsdl.js:102:7) at IncomingMessage.emit (events.js:81:20) at HTTPParser.onMessageComplete (http.js:133:23) at Socket.ondata (http.js:1226:22) at Socket._onReadable (net.js:683:27) at IOWatcher.onReadable [as callback] (net.js:177:10) 关于so​​ap( https://github.com/milewise/node-soap )我甚至不能用NPM安装它,它会失败: > node-expat@1.3.2 install /home/warorface/node_modules/soap/node_modules/node-expat > […]

我如何强制命名空间前缀使用?

我想消费一个SOAP Web服务,但WSDL是有点破,所以我必须做一些定制node-soap 。 我想要的理想SOAP信封就是这个: <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Body> <getImagesDefinition xmlns="http://services.example.com/"/> </Body> </Envelope> 到目前为止,这是我必须调用服务的nodejs代码: var soap = require('soap'); var url = 'http://www.example.com/services/imagesizes?wsdl'; soap.createClient(url, function(err, client) { client.setEndpoint('http://www.example.com/services/imagesizes'); client.getImagesDefinition(null, function(err, result) { console.log(result); }); console.log(client.lastRequest) }); 我必须手动设置端点,因为它在WSDL文件中被破坏 打印client.lastRequest得到的信封是这样的: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://services.example.com/"> <soap:Body> <getImagesDefinition /> </soap:Body> </soap:Envelope> 我知道,如果我可以强制命名空间前缀的身体有<tns:getImagesDefinition />而不是<getImagesDefinition />请求完美的作品。 有什么办法强迫我? 我读了文档,说tns是一个默认的忽略命名空间,所以我试图通过这样做来改变: var options = { ignoredNamespaces: { […]