Tag: node soap

使用node-soap创build一个字节数组传递给SOAP服务

对于一个API,我需要从本地的pdf文件创build一个字节数组的可能性。 我已经检查过StackOverflow,但现有的解决scheme不起作用。 每当我尝试执行的代码,我从SOAP API得到一个错误的请求。 如果我发送零字节,那么我得到一个错误消息,发送零字节。 凭据也工作。 我唯一不能解决的是我怎样才能从PDF文件生成一个字节数组,并通过节点肥皂发送。 在这里我的代码: var fs = require('fs'); var zlib = require('zlib'); var soap = require('soap'); var path_to_wsdl = "url to wsdl"; var data = {}; data['Authentication'] = { 'Username': "myusername", 'Password': "mypass" } data['Options'] = { 'Testmode': true } data['Recipient'] = { 'Company': "Firma", 'FirstName': 'Vorname', 'Name': 'Name', 'Address': 'Street […]

如何将身份validation标头传递给node-soap

我正在尝试使用wsdl服务作为客户端,但我找不到如何设置一些标题。 我需要这个的原因是因为我试图使用的wsdl需要通过标题的用户名和密码。 这是wsdl > POST /Service.asmx HTTP/1.1 > Host: 210.12.155.16 > Content-Type: text/xml; charset=utf-8 > Content-Length: length > SOAPAction: "http://yyyy.com:1002/apability" > > <?xml version="1.0" encoding="utf-8"?> > <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > <soap:Header> > <AuthHeader xmlns="http://yyyy.com:1002/"> > <UserName>string</UserName> > <Password>string</Password> > </AuthHeader> > </soap:Header> > <soap:Body> > <sale xmlns="http://yyyy.com:1002/"> > <BID>string</BID> > <Amount>string</Amount> > […]

meteor服务器中的asynchronousfunction

我正在使用vpulim:node-soap来运行soap服务器。 我的meteor服务器启动包含其中各种其他代码: authRequestOperation: function(args,cb,headers,req) { console.log(args); var authResponceObject = {}; var futureAuthResponse = new Future(); Fiber(function(){ if(collectorUsers.findOne({username: args.username})){ console.log("Found User"); authResponceObject = { username: args.username, nonce: Random.id() }; console.log("authResponceObject is: " + JSON.stringify(authResponceObject,null,4)); console.log("futureAuthResponse returning…"); futureAuthResponse.return(authResponceObject); } // console.log("futureAuthResponse waiting…"); // return futureAuthResponse.wait(); }).run(); console.log("authResponceObject after fiber is: " + JSON.stringify(authResponceObject,null,4)); return authResponceObject; }, 我想要做的是: […]

在几次成功的调用之后Nodejs Node-SOAP ETIMEDOUT

几个成功的电话后,我得到一个ETIMEDOUT错误…这是代码: soap.createClient("./WSDL/test.wsdl", function (err, soapClient) { if (err) { throw new Error(err) }; bpData.forEach(function (elementOfArray) { soapClient.service.binding.Update({ ProductUpload: { ID: elementOfArray.ProductID, newIndicator: 'false', UpdateIndicator: 'true', UpdateDate: dateFormat(new Date(), 'yyydd'), RawData: elementOfArray.RawData1, RawData2: elementOfArray.RawData2 } }, function (err, result) { if (err) { console.log(err); //throw new Error(err); } else { console.log(JSON.stringify(result)); return JSON.stringify(result); } } ); […]

尝试通过节点调用National Rail SOAP API时发生TypeError

我正在尝试使用node-soap访问National Rail API。 文档在这里: https : //lite.realtime.nationalrail.co.uk/OpenLDBWS/ 我是SOAP的新手,所以这可能不是API的问题。 我正在得到一个types错误,无论我尝试… TypeError:无法读取未定义的属性“Body” 以下是我用来尝试拨打电话的代码: var soap = require('soap'); var url = 'https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2014-02-20'; var soapHeader = '<com:AccessToken>MY_TOKEN</com:AccessToken>'; soap.createClient(url, function(err, client){ var args = { numRows : 10, crs : 'LAN' }; client.addSoapHeader(soapHeader); client.GetDepartureBoard(args, function(err, result){ if(err){ console.log('error!'); throw err; } console.log(result); }); }); 使用节点肥皂我也可以得到请求的信封,这是内容: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://thalesgroup.com/RTTI/2014-02-20/ldb/" xmlns:tok="http://thalesgroup.com/RTTI/2013-11-28/Token/types" […]

用Node-soap(node.js)中的数组发送请求

我使用nodejs和node-soap与Web服务进行通信。 但我似乎无法获得将parameter passing给服务的语法。 该文件说,我需要发送一个数组的字段uuid和它的值。 这里是我从Web服务所有者那里得到的PHP代码 $uuid = "xxxx"; $param = array("uuid"=>new SoapVar($uuid, XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema") ) 这里是我在我的节点服务器中使用的代码 function getSoapResponse() { var soap = require('soap'); var url = 'http://live.pagoagil.net/soapserver?wsdl'; var auth = [{'uuid': 'XXXXXXXXX'}]; soap.createClient(url, function(err, client) { client.ListaBancosPSE(auth, function(err, result) { console.log(result); console.log(err); }); }); 有了这个我得到不良的XML错误 var auth = [{'uuid': 'XXXXXXXXX'}]; 要么 var auth = […]

node-soap客户端中的数组字段的名称空间(Node.js)

如何为数组configurationnode-soap客户端集名称空间不仅用于对象? 我的“sendPatient”方法的参数: params = { patientCard: { patient: { firstName: 'test', lastName: 'test' }, identifiers: { code: "123456789", codeType: 1 } } }; client.sendPatient(params, …) 节点肥皂产生: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://xxx/patient/api/" xmlns:bi="http://xxx/base/info/build/"> <soap:Header></soap:Header> <soap:Body> <tns:sendPatient xmlns:tns="http://xxx/patient/api/" xmlns="http://xxx/patient/api/"> <tns:patientCard> <ns1:patient xmlns:ns1="http://xxx/patient/"> <ns1:firstName>test</ns1:firstName> <ns1:lastName>test</ns1:lastName> </ns1:patient> <ns1:identifiers xmlns:ns1="http://xxx/patient/"> <ns1:code>123456789</ns1:code> <ns1:codeType>1</ns1:codeType> </ns1:identifiers> </tns:patientCard> </tns:sendPatient> </soap:Body> </soap:Envelope> 它的工作原理,但我需要发送标识符数组,不仅一个,所以当我把数组 params = { […]

Node-soap client.describe()?

我试图通过使用本地WSDL文件来使用Web服务。 我已经使用了两个WDSL 。 GDSQueue.wsdl GDSQueueAbstract.wsdl 第一个, GDSQueue.wsdl 导入 GDSQueueAbstract.wsdl 。 但在node-soap中,当我使用client.describe() ,它显示如下输出: { GdsQueueService: { GdsQueueCountServicePort: {}, GdsQueueListServicePort: {}, GdsQueuePlaceServicePort: {}, GdsEnterQueueServicePort: {}, GdsExitQueueServicePort: {}, GdsNextOnQueueServicePort: {}, GdsClearQueueServicePort: {}, GdsQueueAgentListServicePort: {} } } 现在来调用服务,我应该使用 GdsQueueService.GdsQueueCountServicePort.service(params , callback) 但是没有任何调用这个Web服务的服务方法 。 因此,我不明白为什么node-soap不会创build服务方法 。

node-soap是否可以在单个WSDL中处理具有不同名称空间的多个模式?

我正在使用node-soap与现有的SOAP API进行接口。 我遇到了多个模式和命名空间的问题,从我正在阅读的内容可能是一个已知的问题。 这里是设置,我用一个WSDL文件和两个模式进行交互: WSDL(为简洁起见删除了属性和元素): <wsdl:definitions xmlns:tns="[rm-nsurl]" targetNamespace="[rm-nsurl]" …> <!– schema1 –> <schema xmlns:tns="[cm-nsurl]" targetNamespace="[cm-nsurl]" …> <complexType abstract="true" name="Operation"> <sequence> <element maxOccurs="1" minOccurs="0" name="operator" type="tns:Operator">…</element> </sequence> </<complexType </schema> <!– schema2 –> <schema xmlns:cm="[cm-nsurl]" xmlns:tns="[rm-nsurl]" targetNamespace="[rm-nsurl]" …> <complexType name="UserListOperation"> <complexContent> <extension base="cm:Operation">…</extension> </complexContent> </complexType> </schema> … </wsdl:definitions> 重要的细节是两个模式将tns定义为不同的值。 当schema2中的一个types引用了schema1( cm:Operation )中的一个元素时,它使用了cm的显式名称空间(目前为止还不错),但是随后跳转到schema1中的引用types中,我们现在看到了tns名称空间和schema1 tns是cm 。 这会导致问题,因为node-soap对于tns使用单个整体值,在这种情况下恰好是rm并且在需要时不显式使用cm命名空间。 这里是我看到问题的一个例子: 请求对象传递给WSDL方法: […]

用X509证书实现WSSecurity npm'Soap'

问题的第一部分: 使用npm的肥皂,我试图做一个肥皂调用下面的端点var url 。 var sslRootCAs = require('ssl-root-cas/latest') sslRootCAs.inject(); var soap = require('soap'); var url = 'https://ws.conf.ebs.health.gov.on.ca:1440/HCVService/HCValidationService?wsdl'; var args = {name: 'value'}; soap.createClient(url, function(err, client) { if (err) { console.log(err); } else console.log(client); }); 我收到callback错误为: { [Error: unable to verify the first certificate] code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' } 上面的错误发生了什么,虽然我有Certs。 问题的第2部分: 我收到了以下信息: ***信息开始 点击WSDL链接: https : //ws.conf.ebs.health.gov.on.ca : […]