Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    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 ?
    Tekin GÜNDOĞDU

    I am using the soap module in Node.js as follows

    import soap  from "soap";
            const ADRES = 'https://tckimlik.nvi.gov.tr/service/kpspublic.asmx?WSDL';
            let degerler = {
            TCKimlikNo: 11111111111,
            Ad: 'YUSUF SEFA',
            Soyad: 'SEZER',
            DogumYili: 1111
            soap.createClient(ADRES, (err, client) =\> {
            client.TCKimlikNoDogrula(degerler, (err, result) =\> {
            if (result.TCKimlikNoDogrulaResult) {
            console.log('information is correct');
            } else {
            console.log('Information is incorrect');

    However, I am getting the following error as output.

    > soap@1.0.0 start
            > node app.js
            this.\_request = options.request || req\["default"\].create();
            TypeError: Cannot read properties of undefined (reading 'create')
            at new HttpClient (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\http.js:40:59)
            at Object.open_wsdl (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\wsdl\\index.js:1270:48)
            at openWsdl (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:70:16)
            at C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:48:13
            at \_requestWSDL (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:76:9)
            at Object.createClient (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:94:5)
            at file:///C:/laragon/www/node-soap/app.js:12:6
            at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
            at async Promise.all (index 0)
            at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
            PS C:\\laragon\\www\\node-soap\>

    package.json content

            "name": "soap",
            "version": "1.0.0",
            "description": "",
            "main": "app.js",
            "type": "module",
            "scripts": {
            "test": "echo "Error: no test specified" && exit 1",
            "start": "node app.js"
            "author": "",
            "license": "ISC",
            "dependencies": {
            "express": "^4.18.2",
            "nodemon": "^2.0.20",
            "soap": "^0.45.0"

    What is the reason for this error? Despite all the searches on the internet, I could not find the solution for this. Is there a problem with the version? Where is the error, I can't try this soap module of the believer because of this error.

    3 replies
    The reason for the error is that axios is a dependency of soap, but the library owner decided to transform it to a peer dependency.
    Does this mean that if you add axios, version 0.45.0 will also work?
    It will, but you must pass the request option to createClient.

    Hello All, I am facing the similar issue what has been asked previously. https://gitter.im/vpulim/node-soap?at=5ba2f9de1ee2ca6502406b9e
    However, fix suggested is not working as intended. I am passing object as

    { Foo: Bar: ["One", "Two"] }




    using ^0.45.0 version. any help is appreciated
    2 replies
    Siva Masilamani
    I got the same error too with the version 0.45.0
    2022-11-10 08:10:46.099 [error] - TypeError: Cannot read properties of undefined (reading 'create')
        at new HttpClient (/mnt/c/Repos/proj/server/node_modules/soap/src/http.ts:42:52)
        at Object.open_wsdl (/mnt/c/Repos/proj/server/node_modules/soap/src/wsdl/index.ts:1416:46)
        at openWsdl (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:55:5)
        at /mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:32:7
        at _requestWSDL (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:61:5)
        at createClient (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:83:3)
        at /mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:93:5
        at new Promise (<anonymous>)
        at createClientAsync (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:92:10)
    Sarath medasani
    Hello All,
    I have started using the 0.45.0 version of the soap library, didn't notice this issue with 0.38.0.
    started seeing the following error. Anyone noticed similar issue with 0.45.0 version
    stack=Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
    at TLSSocket.emit (node:events:390:28)
    at TLSSocket.emit (node:domain:475:12)
    at TLSSocket._finishInit (node:_tls_wrap:944:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12),
    Rohan Gupta
    We have tried using the WS Security Cert for authentication, but the XML generated by it has more Reference details ( one for timestamp and one for Body ).
    Is there any way to remove the References for these two (timestamp and Body)?
    I want only Reference details for <To> section.
    Hi all,
    Does anybody know if it is possible to include a CA certificate anywhere that will then be set on the http client that is used to read the WSDL from a URL?
    I can see the ClientSSLSecurity option but that gets set once the soap client has been created, which is obviously too late.
    Many thanks.
    2 replies
    Is there a working example of createClientAsync anywhere? I've added axios to package.json but still get errors when trying to run -> TypeError: Cannot read properties of undefined (reading 'createClientAsync')
    # index.ts
    import soap from 'soap';
    (async () => {
      const wsdlUrl = 'http://www.thomas-bayer.com/axis2/services/BLZService?wsdl';
      const client = soap.createClientAsync(wsdlUrl);
    5 replies
    Scroll back for examples. It is the only topic here.
    I'm guessing most of these are pure js projects and not ts?