/**
 * Created by hongxin on 2015-12-16.
 */

//api :  http://webservice.webxml.com.cn/WebServices/TrainTimeWebService.asmx

var soap = require('soap');

var url = 'http://webservice.webxml.com.cn/WebServices/TrainTimeWebService.asmx?wsdl';


function getTrainLine(xStartStation,xArriveStation) {
    var args={
        StartStation:xStartStation,
        ArriveStation:xArriveStation
    };
    soap.createClient(url, function (err, client) {
        client.getStationAndTimeByStationName(args, function (err, result) {
            console.log('火车信息:',JSON.stringify(result));
        });

    });
}

module.exports = {
    getTrainLine: getTrainLine
};