1

我的任务是制作 (node-soap)[https://github.com/milewise/node-soap] 解析 wsdl 文件作为大规模应用程序问题的一部分,它不会读取文件

我的源代码:

var soap = require('soap');
var url = 'services/air_v24_0/Air.wsdl';
var args = {name: 'John Doe'};
var http = require('http');

soap.createClient(url, function(err, client){
    client.parseAirService(args, function(err, result){
        console.log(result);
    });
});

var parseAirService = {
    parseAirService: {
        port: {
            getArgs: function(args) {
                return {
                    name: args.name
                };
            }
        }
    }
};

var xml = require('fs').readFileSync(url, 'utf8');
var server = http.createServer(function(request, response){
    response.end("404: Not Found: "+request.url);
});

server.listen(8000);
soap.listen(server, 'services/air_v24_0/Air.wsdl', parseAirService, xml);
4

0 回答 0