Tag: soap

使用node.js来使用soap

我试图学习node.js和使用node-soap包来使用这个简单的肥皂。 WSDL在这里给出: https : //www.dropbox.com/s/f9o79f8jejqwfp3/UserDataService.wsdl并导入一个在https://www.dropbox.com/s/4vz0eoh70kvx1bm/import_UserDataService.wsdl 注意父WSDL中的导入。 所以我执行以下消耗肥皂操作removeUser但即时通讯错误“无效的子types”。 这是否意味着import无法完成? var soap = require('soap'); var url = 'http://localhost/idmsrvc/UserDataService?wsdl'; var args = {id: 'bladigblahddfdfdfdfdfd'}; soap.createClient(url, function(err, client) { client.removeUser(args, function(err, result) { console.log(result); }); }); 节点test.js assert.js:92 throw new assert.AssertionError({ ^ AssertionError: Invalid child type at DefinitionsElement.addChild (/home/kasunt/node_modules/soap/lib/wsdl.js:383:5) at Element.endElement (/home/kasunt/node_modules/soap/lib/wsdl.js:143:14) at Object.p.onclosetag (/home/kasunt/node_modules/soap/lib/wsdl.js:1162:9) at emit (/home/kasunt/node_modules/soap/node_modules/sax/lib/sax.js:615:33) at […]

嘲笑使用sinon肥皂网服务

我有一个使用Express应用程序的Node应用程序,并且想要调用soap web服务,以便我可以编写一些unit testing。 对于嘲笑,我使用Sinon和Soap向SOAP Web服务发送请求,但在如何解决这个问题上遇到困难。 before(function(done) { var soapWs = require('../../methods/soapWs'); soapWs.user = soap.createClient(path + '/restsoapproxy/test/specs/testjson/user.wsdl); // following returns undefined sinon.stub(SoapWs.user, 'sessionLogin', function(err) { err.code = '404'; err.message = 'error'; // eg "for user not found" return err; }); } SOAP Web服务有一个名为sessionLogin的方法,它接受用户名和电子邮件,但不知道如何使用sinon来模拟对soap web服务的调用 – 上面的代码片段返回“undefined”

如何使用nodejs发送soap复杂types到axis wsdl服务器

我使用节点作为客户端与java轴wsdl服务进行通信(不熟悉这一点)。 有一个node-soap模块可以发送简单types的服务。 例如: <wsdl:message name="helloArgsRequest"> <wsdl:part name="str" type="xsd:string"/> <wsdl:part name="i" type="xsd:int"/> </wsdl:message> <!– … –> <wsdl:operation name="helloArgs" parameterOrder="str i"> <wsdl:input message="impl:helloArgsRequest" name="helloArgsRequest"/> <wsdl:output message="impl:helloArgsResponse" name="helloArgsResponse"/> </wsdl:operation> 节点: soap.createClient(url, function(err, client) { client.helloArgs({ str: "haha", i: 100 }, function(err, result) { console.log(result); // OK }); }); 但node-soap不支持complexType (找不到关于complexType的任何示例)。 所以我捕捉到的HTTP请求,并得到原始的XML数据发布服务,如下所示: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="http://192.168.0.3:8080/axis/LoginService.jws" xmlns:intf="http://192.168.0.3:8080/axis/LoginService.jws" xmlns:tns1="http://DefaultNamespace"> <soap:Body> […]

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 : […]

我无法访问wsdl文件中定义的函数。提供了代码和错误代码片段

我无法访问wsdl文件中定义的ResloveIP函数。 我检查使用SoapUI的服务,它工作正常。 请帮忙! var soap=require('soap'); var url='http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl'; soap.createClient(url, function(err, client) { if(err){ console.log(err); return; } //console.log(client.describe()); client.IP2Geo.IP2GeoSoap.ResolveIP('184.172.104.38');//the ResolveIP function cannot be accessed. }); 错误信息:

Node.js – 从wsdl生成Web服务服务器/客户端框架

我正在寻找像wsimport为node.js工具,我可以从wsdl自动生成服务/客户端。

节点SOAP如何发送参数/参数与请求

我正在做一个服务的肥皂调用,但无法弄清楚如何正确格式化和发送参数/客户client.method ,我想使用的参数。 client.describe()给了我这个: { SysGestAgentApi: { SysGestAgentApiSoapPort: { EXECSQL: [Object] ….以及更多,但是这个EXECSQL是我想要使用的方法。 此方法将SQL查询作为唯一参数作为string。 我试过的是这样的: var soap = require('soap'); var url = 'http://ipaddress:port/sysgestagentapi/SysGestAgentApi.WSDL'; var args = 'SELECT * FROM _33NWEB'; soap.createClient(url, function(err, client) { client.SysGestAgentApi.SysGestAgentApiSoapPort.EXECSQL(args, function(err, result) { console.log(result.toJSON()); }); }); 它一直在回应一个错误的XML,这是这样的: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>WSDLReader:None of […]

在节点JS肥皂Web服务

我正在尝试使用npm模块soap在节点js中构buildsoap web服务。 我正在使用soap.listen函数在节点js中启动soap服务器。 我包括的wsdl文件如下所示: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="wscalc1" targetNamespace="http://localhost:8100/api/orderStatusWsdl" xmlns="http://localhost:8100/api/orderStatusWsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <wsdl:message name="receiveOrderStatusRequest"> <wsdl:part name="a" type="xs:string"/> <wsdl:part name="b" type="xs:string"/> </wsdl:message> <wsdl:message name="receiveOrderStatusResponse"> <wsdl:part name="orderStatusResponse" type="xs:string"/> </wsdl:message> <wsdl:portType name="orderStatusPort"> <wsdl:operation name="receiveOrderStatus"> <wsdl:input message="receiveOrderStatusRequest"/> <wsdl:output message="receiveOrderStatusResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="orderStatusBinding" type="orderStatusPort"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="receiveOrderStatus"> <soap:operation soapAction="receiveOrderStatus"/> <wsdl:input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal"/> </wsdl:input> […]

NodeJS(HapiJS)parsingXML

我是新的parsing和XML和使用nodejs,我已经尝试node-soap , easysoap , strong-soap ,但我不能让这个图书馆工作 这是我的XML如果我打开浏览器的链接 <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:myserv" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:myserv"> <types> <xsd:schema targetNamespace="urn:myserv"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/> <xsd:complexType name="reqSearch"> <xsd:sequence> <xsd:element name="Username" type="xsd:string" minOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="respSearch">…</xsd:complexType> </xsd:schema> </types> <message name="SearchRequest"> <part name="param" type="tns:reqSearch"/> </message> <message name="SearchResponse"> <part name="return" type="tns:respSearch"/> </message> <portType name="searchPortType"> <operation name="Search"> <documentation>Search Service</documentation> […]