节点Soap服务器未定义属性解析请求xml

时间:2019-11-03 18:39:13

标签: node.js web-services soap wsdl qbwc

我知道thisthis的类似问题,在那儿找不到能解决我问题的东西。

SPECS:服务器是托管在heroku上的服务器,使用node-soap和body-parser节点模块用JS编写,并与Quickbooks Web Connector作为Web服务进行通信。

我一直在记录肥皂服务器消息(因为它响应肥皂客户端请求(来自Quickbooks Web Connector)),它们看起来像这样:

soap server received...
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><authenticate xmlns="http://developer.intuit.com/"><strUserName>******</strUserName><strPassword>******</strPassword></authenticate></soap:Body></soap:Envelope>

soap server error...
TypeError: Cannot read property 'description' of undefined
 at SAXParser.p.onopentag (/app/node_modules/soap/lib/wsdl/index.js:241:37)
at emit (/app/node_modules/sax/lib/sax.js:624:35)
at emitNode (/app/node_modules/sax/lib/sax.js:629:5)
at openTag (/app/node_modules/sax/lib/sax.js:825:5)
 at SAXParser.write (/app/node_modules/sax/lib/sax.js:1391:13)
at WSDL.xmlToObject (/app/node_modules/soap/lib/wsdl/index.js:446:11)
at Server._process (/app/node_modules/soap/lib/server.js:240:29)
at Server._processRequestXml (/app/node_modules/soap/lib/server.js:162:18)
at IncomingMessage.<anonymous> (/app/node_modules/soap/lib/server.js:230:25)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

从日志中,我认为肥皂服务器无法正确解析POST请求正文中的请求,尽管我在连接肥皂服务器之前按照如下自述示例使用bodyparser.raw() >

//for qb post requests, use raw for node-soap library
app.use(bodyparser.raw({
  type: function() {
    return true
  },
  limit: '5mb'
}))

var soap_server = soap.listen(app, '/', soap_service, soap_wsdl, function() {
  console.log('SOAP server initialized')
})

有人知道解决方案吗?

0 个答案:

没有答案
相关问题