当解决SOAP解析错误时如何修复Node SOAP服务

时间:2019-01-16 13:04:03

标签: node.js soap wsdl

我有一个NodeJS服务器,该服务器在app.js目录中也运行着SOAP服务。

当我使用PostMan测试该服务时(当我对端点执行POST请求时),该服务运行良好,但是当客户端尝试使用PHP客户端访问该服务时,它将引发错误。

错误:

Parsing WSDL: Couldn't load from 'https://{URL}/soap/wsdl.

据我了解,问题在于端点工作正常,但是没有附加WSDL描述?

如果是这种情况,我如何将WSDL描述“附加”到这一点?

app.js内容:

import "babel-polyfill";
import app from './config/express';
import config from './config/config';
import bodyParser from 'body-parser'
import soap from 'soap'

let xml = require('fs').readFileSync('./REDE.wsdl', 'utf8');
let myService = {
      RealEstateDataExchange: {
          RealEstateDataExchangePort: {

              getObjectIdsByStatus: function(args, callback) {
                // do something and get result
                // call callback with result like so:
                // callback( result );
              }
          }
      }
  };

app.use(bodyParser.raw({type: function(){return true;}, limit: '5mb'}));
app.listen(config.port, () => {
  console.info(`Server started on port ${config.port}`);
  soap.listen(app,'/soap/wsdl',myService,xml);
});

export default app;

0 个答案:

没有答案