I recieve an error message when using NodeJS SOAP to make a request

327 Views Asked by At

I try to make a request using npm soap, the client is well created and I'm able to get all methods but when I execute the method "GetAccessProfileList", I recieve an error message.

When using SOAPUI, my request works, I only have an issue with the NodeJS code.

NodeJS code :

  var soap = require('soap'),
      url = 'https://ipevia.com/public/files/onvif/accessrules.wsdl';

  soap.createClient(url, {
    endpoint: 'https://ipevia.com/index.php?OnvifServer'
  }, (err, client) => {
    client.GetAccessProfileList({}, function(err, result) {
      console.log(err);
    }, {
      forceGzip: true,
      responseEncoding: 'utf8',
      url: 'https://ipevia.com/index.php?OnvifServer',
      auth: {
        username: '*********',
        password: '*********'
      }
    });
  });

Error message :

<?xml version="1.0" encoding="UTF-8"?>\n' +
    '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>500</faultcode><faultstring>Cannot parse XML: Not well-formed (invalid token) at line: 1, column: 1</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
0

There are 0 best solutions below