Search code examples
node.jsweb-servicesexpresswsdlnusoap

i have ERROR is that when a service called nusoap


exports.list = function(req, res){
var url = 'http://www.tribunal.besaba.com/php/servidorSoap.php?wsdl';
  soap.createClient(url, function(err, client) {
    var args = {name: '78763396'};
      client.getInhabilidad2(args, function(err, result) {
          res.send(result);
      });
  });
};

i have problem is that when a service called nusoap get an error cannot call method getInhabilidad2 of undefined.


Solution

  • Your error is telling you that client is undefined. You should check what the err passed in the callback function of soap.createClient returns. There you'll find the root of your problem that is not creating your client to be able to call its getInhabilidad2 later on.

    Try:

    function(err, client) {
        if(err) { 
            console.log("Error creating client: ", err); 
        }
        else {
            ...
        }
    }