Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Michael Schramm


    I'm having problems with a WSDL File that has complex types that are extended from oneanthother.

    in a operation it will then resolve all fields to be of the same namespace while they are actually from different namespaces.

    A { a: string }, B extends A { b: number } - operation(B)

    doing something like operation({ a: "1", b: "2" }) I would need the xml to be something like <A.a>1</A.a><B.b>2</B.b>. But the Result is then <B.a>1</B.a><B.b>2</B.b>

    any Idea how I could best debug this within the code? Right now I'm trying to print out everything in WSD.objectToXML and just see that the nsPrefix is then always B (also for the ones that should have namespace A)

    Michael Schramm
    I am thinking right now that the problem is coming from within the wsdl parser -> as only arrays seem to have the correct namespace assigned.
      input: {
        VUNr: 'VUNr|xsd:string|minLength,maxLength',
        ClientId: 'xsd:string',
        'TechnischeParameter[]': {
          Key: 'xsd:string',
          Value: 'xsd:string',
          targetNSAlias: '__tns__',
          targetNamespace: 'urn:CommonServiceTypes-1-1-0'
    Helder Afonso de Morais
    HI. I am getting this error: Failed to bind to WSDL. I have the same WSDL fila working in PHP, so, it is ok.
    Yan-Fa Li

    Hi, I'm trying to use v0.43, but it ships with a very old version of Axios 0.21, because of this it fails typescript checks when I pass it an AxiosInstance 0.26 using options.request. A couple of thoughts, I can work around it by making axios: any, not optimal.

    Is there a way to not bundle axios but refer to a dependency? Or alternatively, could you just upgrade to a newer release? I believe 0.21 has security issues. https://snyk.io/vuln/npm:axios@0.21.1

    Yan-Fa Li
    It's not stated in the docs, but is the assumption that clients must be created per request? i.e. you should not share a client between different parallel requests? Or is it possible to create a request pool of clients and re-use them?
    Dean Vaughan


    im having a issue with parsing a soap file

    RangeError: Maximum call stack size exceeded
    at ElementElement.description
    anyone else had this issue an found any workarounds?
    When using WSSecurityCert, is it possible to override theBinarySecurityToken?
    It appears a critical vulnerability was raised recently on 'formidable' in Snyk - https://security.snyk.io/vuln/SNYK-JS-FORMIDABLE-2838956
    Recommended fix is to update to 3.2.4 and above. Are there any plans to update this dependency? I did see an open PR but that is only to update to v2 and seems to be facing build issues.
    Guillaume Ambrois
    Hey, I'm having this error when making a SOAP call that responds with something not expected in the WSDL file, does that ring a bell to anyone?
    Error occurred in handler for 'MSSANTE_LIST_EMAILS': TypeError: Cannot read property 'description' of undefined
        at SAXParser.p.onopentag (/Users/myUser/Saturn/dist/webpack:/node_modules/soap/lib/wsdl/index.js:238:1)
        at emit (/Users/myUser/Saturn/dist/webpack:/node_modules/sax/lib/sax.js:624:1)
        at emitNode (/Users/myUser/Saturn/dist/webpack:/node_modules/sax/lib/sax.js:629:1)
        at openTag (/Users/myUser/Saturn/dist/webpack:/node_modules/sax/lib/sax.js:825:1)
        at SAXParser.write (/Users/myUser/Saturn/dist/webpack:/node_modules/sax/lib/sax.js:1391:1)
        at WSDL../node_modules/soap/lib/wsdl/index.js.WSDL.xmlToObject (/Users/myUser/Saturn/dist/webpack:/node_modules/soap/lib/wsdl/index.js:443:1)
        at parseSync (/Users/myUser/Saturn/dist/webpack:/node_modules/soap/lib/client.js:289:1)
        at /Users/myUser/Saturn/dist/webpack:/node_modules/soap/lib/client.js:496:1
        at /Users/myUser/Saturn/dist/webpack:/node_modules/soap/lib/http.js:199:1
        at processTicksAndRejections (internal/process/task_queues.js:93:5) {
    3 replies
    Daniel Saewitz
    Has anyone been able to use node-soap with Cloudflare workers?
    Kurt Smith

    I am trying to use WSSecurityCert. And I am using additionalReferences :['was:To'] to sign the tag but I am getting

    Error: the following xpath cannot be signed because it was not found: //*[name(.)='wsa:To']

    and also
    TypeError: Cannot read property 'setSecurity' of undefined

    mohamad arifin
    hello,, this code use 'easy-soap-request',, i want to use node-soap but i dont know how,,please somebody change this code for node-soap use
    exports.findAll = (req, res, next) => {
        let server = req.body.server;
        let agencyCode = req.body.agencyCode;
        let branchCode = req.body.branchCode;
        let transactionCode = req.body.transactionCode;
        let userId = req.body.userId;
        let ic = req.body.input_ic;
        var date = new Date(); // Or the date you'd like converted.
        var reqDate = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString();
        reqDate = reqDate.substring(0, reqDate.length - 5);
        const soapRequest = require('easy-soap-request');
        const fs = require('fs');
        const xml2js = require('xml2js');
        const url = `${server}`;
        const header = {
            'user-agent': 'SSIPR',
            'Content-Type': 'text/xml;charset=UTF-8',
        const xml = `<?xml version="1.0" encoding="UTF-8"?>
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:crs="http://tempuri.org/CRSService">
        // usage of module
        (async () => {
                const { response } = await soapRequest({ url: url, headers: header, xml: xml, timeout: 30000 }); // Optional timeout parameter(milliseconds)
                const { headers, body, statusCode } = response;
                    { tagNameProcessors: [ xml2js.processors.stripPrefix ]},
                        function (err, result) {
    1 reply
    Kendell R
    does anyone have any recommendations for soap clients that work with cloudflare workers/pages (no builtin node libraries)?
    Would be cool if we could await the addHeaders method of the client's security. I'm using a token which times out after 1h and refreshing that token could be done in the addHeaders method but for that to work it would become async and the client would have to await it in its _inspect method. Maybe we could add another optional method to the ISecurity interface called addHeadersAsync to be backwards-compatible.
    Sævar Már Atlason
    On master I see you have added the support of creating a soap Client from WSDL string. When can I expect that version to be published on npm?
    anyone faced "TypeError: Cannot read properties of undefined (reading 'description')" error ?
    i don't know what could cause this to happen when i tried a dummy soap service with a dummy wsdl the client.methodAsync worked fine but when i tried a real soap webservice and wsdl i got this error ,same service works fine with soapui .any help will be appreciated .

    Hello, I'm having this error in a Firebase Function using soap that was working fine for the last past two years

    Error: socket hang up
    >      at connResetException (node:internal/errors:692:14)
    >      at TLSSocket.socketOnEnd (node:_http_client:478:23)
    >      at TLSSocket.emit (node:events:539:35)
    >      at endReadableNT (node:internal/streams/readable:1345:12)
    >      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    >    code: 'ECONNRESET',

    I made no code change no library update in the two weeks before having this issue.

    I have posted on StackOverflow if you need more information :

    To add more information on my problem, I see that the protocol used by the service to which I want to connect is TCL1.3, could it be a conflict with the lib if it uses TLC1.2 ?
    Has anyone tried using a WSDL with xs:date and passing dates that include the time zone? If my remote server sends a valid xs:date date such as 2022-10-30-07:00 for pacific time, the parser seems to return Invalid Date even though this complies with the w3 XML schema for DataTypes. To work around the issue I have to save the WSDL locally and hack it so that it comes as a xs:string then convert that to a Javascript Date field. Seems unusual it can't deal with regular SOAP specifications that have been around forever.
    2 replies
    Hi, how can i create node-soap server that wsdl imports another wsdl???
    5 replies
    Eric Wein
    Hi, can anyone show me how to create a node-soap server which uses mutual ssl authentication?
    1 reply

    I am new to combining node.js and soap (but not new to them separately)

    I have the following snippet:

      console.log('About to fetch client');
      const res = await fetch(wsdl);
      console.log('It is available!');
      console.log(await res.text());
      const soapClient = createClientAsync(wsdl);

    What could cause the last line to throw an error if all the previous lines succeed?

    I got back

    backend_1  | [ERROR] 16:57:04 TypeError: Cannot read properties of undefined (reading 'create')
    5 replies

    TypeError: Cannot read properties of undefined (reading 'create')
    at new HttpClient (/var/www/html/node_modules/soap/lib/http.js:40:59)
    at Object.open_wsdl (/var/www/html/node_modules/soap/lib/wsdl/index.js:1270:48)
    at openWsdl (/var/www/html/node_modules/soap/lib/soap.js:70:16)
    at /var/www/html/node_modules/soap/lib/soap.js:48:13
    at _requestWSDL (/var/www/html/node_modules/soap/lib/soap.js:76:9)
    at createClient (/var/www/html/node_modules/soap/lib/soap.js:94:5)
    at /var/www/html/node_modules/soap/lib/soap.js:104:9
    at new Promise (<anonymous>)
    at Object.createClientAsync (/var/www/html/node_modules/soap/lib/soap.js:103:12)
    at /var/www/html/scenes/cabinetScene.js:21:35

    How to solve this problem ?

    const client = await soap.createClientAsync(urlWSDL, {
    wsdl_headers: {Authorization: auth1С}
    } );
    await client.addHttpHeader('Authorization', auth1С)

        const phoneAbonent = phoneClient 
        const abonent = {phone: phoneAbonent}
        client.GetOsobr(abonent, async function (err, res) {
            const result = JSON.parse(res.return)
            const item = result.data
            if (item.length) {
                item.forEach(el => {
                    const numberClient1C = el.phone
                    ctx.session.osobrPhoneAbonent = numberClient1C
                    client.GetPhoneName(abonent, async function (err, res) {
                        const result = JSON.parse(res.return)
                        const item = await result.data
                        let name = ''
                        item.forEach(el => {
                            name = el.nameo
                        ctx.session.NameAbonet = name
                        await ctx.replyWithHTML(`\u{1F44B} <b>${name}</b>, `,
                                .keyboard([['\u{1F4DD}  '\u{1F440} '], ['\u{1F4CB} '], ['\u{1F50D}'], ['\u{1F4CE} ']],)
    how to solve this problem?
    Downgraded to 0.42
    downgrade what?
    soap npm package
    Marcos Munoz
    It worked! I downgraded to 0.43
    Any maintainers here?
    Tommy Tran
    @Serezhaua @marcosmunoz__twitter Is Axios a dependency in your package.json?
    1 reply
    It is a popular package, and
    • has version 0.x 😱
    • has bug in latest version for months ☹️
    Tommy Tran
    A lot of popular packages don't get maintained very well
    I'm quite sure your issue is that you don't have Axios in your package.json
    And what is different in say 0.42?
    Tommy Tran
    Marcos downgraded to 0.43 and says that worked. In 0.44, Axios became a peer dependency. npm v3 - v6 does not install peer dependencies by default.
    My test failes right when you just parse the wsdl with the lib. Is it the same reason? const soapClient = createClientAsync(wsdl);
    And how date parsing is related to axios btw?
    Is defining Axios a peer dependency a good step?
    Tommy Tran
    If your stack trace matches Serezha's, then yes. The error is coming from https://github.com/vpulim/node-soap/blob/master/src/http.ts#L42 when it tries to call Axios's create() function. Date parsing is not related to Axios. I don't know if defining it as a peer dependency is a good idea. The argument for it is that it allows users to update Axios in their own projects independently from node-soap.
    Thanks for the explanation. As you pointed out (and as the docs says), the default request module is axios since 0.40.
    IMHO the constructor should at least complain about axios being not available. Or, better: it should not provide a default request and persuade callers to specify the request option.
    If it is decided, I would try to make a PR for it.
    Hm, should npm i axios resolve the issue?
    And eh, I cannot replace it with http.request, or how can I match this option? request?: req.AxiosInstance;
    I need to change the original code and specify the request option.
    Is there a way to upgrade to 0.45 without modifying the source?
    int values in the response also stays string
    Alex Wellnitz

    I have a small question about the project and how it compiles the XML from a WSDL.

    right way

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:msv3:v2">

    wrong way

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <verbindungTesten xmlns="urn:msv3:v2">

    Why does the client hook the namespace behind the attribute and SOAPUI does not?

    Paulo Azevedo
    Hello. I need a little help. I'm trying to call a remote SOAP API with the node-soap. The problem is that the payload is very big +20MB and it gives an exception[ERR_FR_MAX_BODY_LENGTH_EXCEEDED]: Request body larger than maxBodyLength limit
    How can i set a bigger limit ?