Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Juan Sebastian Goldberg
    @sebasgoldberg
    How can I use this library in the browser? There exists a minified version?
    Bart Smets
    @b-smets
    Is there a way to provide a namespace mapping when generating a client based on a WSDL file? I am working against a WSDL whose schema declares elements with the same namespace, however the namespace is repeated on every element definition with a different prefix so my final resulting SOAP XML ends up with tons of duplicated namespaces with different prefixes.
    Mahdi Karami
    @MKdir98
    Hi All.
    I search in file of project for xenc:EncryptedData or something like this but I can not find anything.
    Mahdi Karami
    @MKdir98
    something like this:
    <soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="_30d88595-86e5-446e-b779-60b13612fe62"> <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="ED-9cacd30b-e921-4f12-b13c-66618fd704b3" Type="http://www.w3.org/2001/04/xmlenc#Content"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" /> <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"> <wsse:Reference URI="#EK-e9aa9c0a-28cf-487a-81e9-a38f1e4079db" /> </wsse:SecurityTokenReference> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>ghu/wEcFEkun4tImo++HWo3rpXU9jPw9qSA/uGhrqqAAR/LuE+6G8aFPNZ/QLDnocxvfAicieWoTlmJ5kpitjmJHW3lv95PKPyMoE/GymNVicG6qCp/HARBbk0uY+SkkSS91n7AOyGARO80aa4npggbUFdzaZlywKOMFZ6tSTDC/+0YZAfQTjecSm3xSl5C3zFX5fPgvXuVRT4AEeFnjwvja2lbJFOLc2Vhpd0tG3LGkKA111q99Qkt/o3S7/GUfimbZKQhInXioCw+t73PpKPu0JtG5YOdCuHBoJJUhW/T6DKcYdFx0exWxz7EFfa2RMK5emB9bJplPKS4fflMDpA==</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> </soap:Body>
    Rangarajan Kesavan
    @rangarajan-k

    Hey everyone I am trying to create a soap server in my local that listens on https.

    let key = fs.readFileSync('key.pem'); 
                    let cert = fs.readFileSync('cert.pem')
    
                    let soapServer = soap.listen(httpServer, {
                        path: urlPath,
                        services: processorService,
                        xml: xmlPath,
    
                        key : key,
                        cert : cert
                    });

    When i am trying to make a request, I am always getting secure connection could not be established error. I have all the WSDL files and the server works properly without https ( i.e http ) .

    Any pointers to help ?

    Anders Wasen
    @QAnders
    Looking for some advice initially as I noticed you offer consulting so want to verify if it can be done... We have the need to migrate an older Java based solution which runs a standard called Peppol which in turn is ebMS/AS4 based. The requests are MIME based with SOAP envelope that references the payload in a second mime part. The payload is encrypted and compressed (gzip). Would node-soap be able to handle ebMS/AS4 based messages?
    kp
    @krle031_twitter

    hi everyone, does anybody have experience with using async with postProcess option?
    i need to modify XML in postProcess, but first need to pull it through async method. postProcess just goes on without waiting.

    example:
    postProcess: async (_xml) => { _xml = await someMethod(_xml); return _xml; }

    manuelpolo
    @manuelpolo:matrix.org
    [m]
    Hi all. I'm currently using a client with WSSecurityCert. Using soap.WSSecurityCert(privateKey, publicKey, password, options) it just signed the body and the timestamp, if it's needed, but I also need to sign the SecurityTokenReference. How can I sign it? Thank you in advance.
    hardnold
    @hardnold
    Hi guys. I updated from a very old version (0.18.0) to the latest version and in v 0.26.0 there's a change that drives me nuts. In Versions prior to 0.26.0 we got a Response code of 500 if the req.body was empty. Now it seems that a request with an empty body doesn't get processed at all and even won't make it to the route handler for a soap-endpoint but instead the server just does not end the request (it runs infinitely). It's probably because of this change: vpulim/node-soap@e13942b. How (and where) would I appropriately handle an empty req.body if the request actually never makes it to the handler? I tried using an express-route but since node-soap wraps around the express app it seems, express never gets to see the request either. How do you guys handle an empty body?
    Awarc
    @awarc:matrix.org
    [m]
    Hello all,
    Did anyone had issues with came case? I'm having trouble with this request that works perfectly from postman but not when using node-soap. From my researches I'm assuming it's because the server i'm connecting needs to perfectly match the "lowerCamelCase" but I believe node-soap is sending the "UpperCamelCase".
    Does this rings any bell for anyone?
    sparkspriya
    @sparkspriya:matrix.org
    [m]
    Hi All, I am getting 'Error http status codes' while hitting the operation using node-soap. Any idea what could be the reason for this error?
    Verner Codoceo
    @vacodoceo

    Hi! I'm getting the following error when trying to use an async client with ts-node

    (node:21227) UnhandledPromiseRejectionWarning: Error: soapenv:server: java.lang.NullPointerException: {"message":null}
        at finish (/Users/verner/Code/equifax/node_modules/soap/src/wsdl/index.ts:513:30)
        at WSDL.xmlToObject (/Users/verner/Code/equifax/node_modules/soap/src/wsdl/index.ts:491:12)
        at parseSync (/Users/verner/Code/equifax/node_modules/soap/src/client.ts:362:25)
        at /Users/verner/Code/equifax/node_modules/soap/src/client.ts:575:16
        at /Users/verner/Code/equifax/node_modules/soap/src/http.ts:214:7
        at processTicksAndRejections (internal/process/task_queues.js:95:5)

    Any ideas what could be wrong?

    Miguel Angel
    @miguel258
    Hi guys, I'm using node-adwords library that use underwoord node-soap but im having the next error.
    TypeError: HttpClient is not a constructor
    at Object.open_wsdl (/soap/lib/wsdl.js:2253:44)
    Aishwarya Raj
    @aishwaryaraj:matrix.org
    [m]
    Hello guys, I have updated my soap to 0.43 hence I have replace the options.request in createClient by axiosInstance..Below is my old code snippet request.defaults({
    // strictSSL: true,
    // ca: caCert
    // }); and the new implementation in axios -> axiosInstance.defaults.httpsAgent = new https.Agent({
    rejectUnauthorized: true,
    // requestCert:true,
    // strictSSL: true,
    ca: [fetchCACerts(process.env.NODE_EXTRA_CA_CERTS)],
    });
    Aishwarya Raj
    @aishwaryaraj:matrix.org
    [m]

    :point_up: Edit: Hello guys, I have updated my soap to 0.43 hence I have replaced the options.request in createClient by axiosInstance..
    Below is my old code snippet =>

    request.defaults({
                           strictSSL: true,
                           ca: caCert
                         });

    and the new implementation using axios->

    axiosInstance.defaults.httpsAgent = new https.Agent({
                            rejectUnauthorized: true,
                            ca: cacert
                        });
           My options for soap.CreateClient -> 
    Options = {
                        url,
                    wsdl_options: {
                        rejectUnauthorized: true,
                        pfx,
                        passphrase,
                        strictSSL: true,
                    },
                    request:axiosInstance
                }.

    I get below error "Invalid WSDL 401 error".. Am I missing any paramter?

    Aishwarya Raj
    @aishwaryaraj:matrix.org
    [m]

    :point_up: Edit: Hello guys, I have updated my soap to 0.43 hence I have replaced the options.request in createClient by axiosInstance..
    Below is my old code snippet =>

    request.defaults({
                           strictSSL: true,
                           ca: caCert
                         });

    and the new implementation using axios->

    axiosInstance.defaults.httpsAgent = new https.Agent({
                            rejectUnauthorized: true,
                            ca: cacert
                        });
           My options for soap.CreateClient ->
    Options = {
                        url,
                    wsdl_options: {
                        rejectUnauthorized: true,
                        pfx,
                        passphrase,
                        strictSSL: true,
                    },
                    request:axiosInstance
                }.

    I get below error "Invalid WSDL 401 error".. Am I missing any paramter?
    Code: 401

    Response Body: <html><head><meta http-equiv="content-type" content="text/html; charset=windows-1252"><title>Anmeldung fehlgeschlagen

    Tommy Tran
    @tommyhtran
    @aishwaryaraj:matrix.org It looks like the URL you're passing to the node-soap is restricted from public access.
    Tommy Tran
    @tommyhtran
    Patrik Elfström
    @PatrikElfstrom
    Solved my issue with node-soap adding unnecessary namespace prefixes by setting ignoreBaseNameSpaces: true.
    Luke Policinski
    @lukepolo
    upgrading from 0.34 -> .43 broke digest auth for me, it seems the http implementation was switched to axios. Has anyone gotten this to work?
    Luke Policinski
    @lukepolo
    ah long story short, ill have to implement it with axios ><
    fuck
    Tommy Tran
    @tommyhtran
    @lukepolo The request module was replaced with Axios in 0.40.0, so you should be able to upgrade to 0.39.0 in the meantime.
    Umang Kathuria
    @umang_kathuria_twitter

    HI there! Could anyone help me with following error ?

    I am using a WSDL file to create server. And I call my endpoint from SOAPUI. On my server console, I end up with error -

    TypeError: Cannot read property 'description' of undefined
    at SAXParser.p.onopentag (C:\Codebase\sample-domo\strong-soap-demo\node_modules\soap\lib\wsdl\index.js:238:37)
    at emit (C:\Codebase\sample-domo\strong-soap-demo\node_modules\sax\lib\sax.js:624:35)
    at emitNode (C:\Codebase\sample-domo\strong-soap-demo\node_modules\sax\lib\sax.js:629:5)
    at openTag (C:\Codebase\sample-domo\strong-soap-demo\node_modules\sax\lib\sax.js:825:5)
    at SAXParser.write (C:\Codebase\sample-domo\strong-soap-demo\node_modules\sax\lib\sax.js:1391:13)
    at WSDL.xmlToObject (C:\Codebase\sample-domo\strong-soap-demo\node_modules\soap\lib\wsdl\index.js:443:11)
    at Server._process (C:\Codebase\sample-domo\strong-soap-demo\node_modules\soap\lib\server.js:251:29)
    at Server._processRequestXml (C:\Codebase\sample-domo\strong-soap-demo\node_modules\soap\lib\server.js:166:18)
    at IncomingMessage.<anonymous> (C:\Codebase\sample-domo\strong-soap-demo\node_modules\soap\lib\server.js:235:25)

    I have done the same process for another WSDL, worked fine. But this time, its just weird. ANY help is appreciated!! Please reach out if you know anything about the issue.

    Marco Savelli
    @piruzzolo:matrix.org
    [m]
    Hi guys!
    Marco Savelli
    @piruzzolo:matrix.org
    [m]
    I've a problem: Error: Invalid WSDL URL: http://<omissis>/WCFService.svc?xsd=xsd0
    Code: 401
    I've set NTLM auth via client.setSecurity(new soap.NTLMSecurity(loginData));
    with loginData having username, password, domain and workstation
    here is my code
    var soap = require('soap');
    var url = './DocumentiWCFService.wsdl';
    
    soap.createClientAsync(url).then((client) => {
        var loginData = { username: MYUSER, password: MYPASS, domain: MYDOMAIN, workstation: MYWS };
        client.setSecurity(new soap.NTLMSecurity(loginData));
        return client.Documents_GetAll();
    }).then((result) => {
        console.log(result);
    });
    Zach Perkins
    @ZachPerkins1
    Hi! I have an application where we don't ever care about any of the XML attributes that come back, just the values of each returned field. When the API returns attributes, node-soap changes the shape of the object to put the value in $value and the attributes in attributes, but, when it doesn't, this object is not formed. Is there any way to make this function consistently one way or the other (either with the $value object or without the $value object, preferably without)?
    Matija Urh
    @ajitam
    Hello (sorry if I'm not using correct terminology), I have a scenario where I "call some method" on WSDL and get response object, then I change something in this object and send it back to some other method on WSDL. But when I send object back I used rawRequest to inspect what I'm sending and I noticed that for example "date of birth" (which is in format 1979-11-24T23:00:00.000Z) is empty - any ideas why this gets omitted ?
    Chris
    @chris.mcdonald93_gitlab

    Any idea why the overrideRootElement option might sometimes not work?

    const options = {
        namespaceArrayElements: false, // This works!
        envelopeKey: 'SOAP-ENV', // This works!
        overrideRootElement: {
            namespace: 'ns1', // This DOES NOT work!
            xmlnsAttributes: [{ // This DOES NOT work!
                name: 'xmlns:ns1',
                value: "http://some.domain"
            }]
        }
    }
    
    const client = await soap.createClientAsync(MyWsdlUrl, options);
    client.myApiMethod(params, (result) => {
        console.log(client.lastRequest);
    });

    This is the XML it generates:

    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
            <impl:myApiMethod>
                Name space and xmlns attributes are not changing!
            </impl:myApiMethod>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    MichaelDenwood
    @MichaelDenwood
    Hey! Can someone tell me if Node-Soap follows redirects, HTTP Status Code 301? And if so how I go about enabling that feature?
    MichaelDenwood
    @MichaelDenwood

    Hey! Can someone tell me if Node-Soap follows redirects, HTTP Status Code 301? And if so how I go about enabling that feature?

    I should be a little more specific. I am specifically asking when making the SOAP calls if the client will handle the redirects or do I have to do something special to make this happen. Currently, it is not following the redirects and and I can't quite figure out how to accommodate for this.

    Orgad Shaneh
    @orgads
    Hi. formidable@v1 is deprecated. Do you plan upgrading to v2 or v3 anytime soon?
    bemlw
    @bemlw

    Hi! This is my first time using SOAP, I have a node.js application that needs to integrate with an application that provides a SOAP api. They only have Java documentation so I am trying to figure out how to do this...

    I have managed to create the client but I get an error going any further. I am trying to authenticate, I have the 3 required params and an example Java snippet. The Java snippet is:

    IntimeServiceV3_0Stub.Authenticate auth=new IntimeServiceV3_0Stub.Authenticate();
    auth.setAgencyRefCode("<supplied_credentials>");
    auth.setUsername("<supplied_credentials>");
    auth.setPassword("<supplied_credentials>");
    IntimeServiceV3_0Stub.AuthenticateResponse authResp=stub.authenticate(auth);
    String ticket=authResp.get_return();
    System.out.println("Authentication token:" + ticket);

    I am wondering how I go about converting that to using node-soap, I have at present:

    client.authenticateAsync("agencyRefCode", "username", "password")
            .then(res => {
                console.log("SUCCESS");
                console.log(res);
            })
            .catch(err => {
                console.log("ERROR");
    console.log(err);
            })

    I have tried a few variations of the aboe. There is also an authenticate method available on the client for non-async requests but the same error is returned each time. Any help would be greatly appreciated!

    vietanhtwdk
    @vietanhtwdk
    image.png
    how can i add name space to header
    i don't understand how to use client.addSoapHeader
    vietanhtwdk
    @vietanhtwdk
    I add it by postProcess, is there better way?
    Leoromero.Dev
    @Micnick
    Hi Team, I faced a issue when launch a soap into a network through a proxy, any suggest?
    Israel Wegierski
    @israelmw
    Hi folks, i am new in world of SOAP and can't understand if my code need any more. I use express-soap over node-soap and this is my code:
    const express = require('express')
    const { soap } = require('express-soap')
    const db = require('./db')
    const app = express()
    const port = 3000
    
    app.use(
        '/soap/transaction',
        soap({
            services: {
                TransactionService: {
                    Transaction(
                        {
                            idTransaccion, idCuenta, codigoRespuesta, codigoAutorizacion, importe, importeDevolucion, moneda,
                        },
                        res
                    ) {
                        db.query(
                            `INSERT INTO transaction (idTransaccion, idCuenta, codigoRespuesta, codigoAutorizacion, importe, importeDevolucion, moneda) VALUES (?,?,?,?,?,?,?)`,
                            [
                                idTransaccion, idCuenta, codigoRespuesta, codigoAutorizacion, importe, importeDevolucion, moneda,
                            ],
                            (err, results) => {
                                if (err) {
                                    console.log(err)
                                    res({
                                        TransactionResult:
                                            'error for not have camps',
                                    })
                                } else {
                                    console.log(results)
                                    if (results.insertId !== null) {
                                        res({
                                            TransactionResult: '00',
                                        })
                                    }
                                }
                            }
                        )
                    },
                },
            },
            wsdl: `<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema"
            xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
            xmlns:tns="http://www.italcred.com"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
            xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
            xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
            targetNamespace="http://www.italcred.com">
                    <wsdl:types>
                        <s:schema elementFormDefault="qualified" targetNamespace="http://www.italcred.com">
                            <s:complexType name="Transaction">
                                <s:sequence>
                                    <s:element minOccurs="1" maxOccurs="1" name="idTransaccion" type="s:string" />
                                    <s:element minOccurs="1" maxOccurs="1" name="idCuenta" type="s:string" />
                                    <s:element minOccurs="1" maxOccurs="1" name="codigoRespuesta" type="s:string" />
                                    <s:element minOccurs="1" maxOccurs="1" name="codigoAutorizacion" type="s:string" />
                                    <s:element minOccurs="1" maxOccurs="1" name="importe" type="s:double" />
                                    <s:element minOccurs="1" maxOccurs="1" name="importeDevolucion" type="s:double" />
                                    <s:element minOccurs="1" maxOccurs="1" name="moneda" type="s:string" />
                                </s:sequence>
                            </s:complexType>
                            <s:element name="TransactionResponse">
                                <s:complexType>
                                    <s:sequence>
                                        <s:element minOccurs="1" maxOccurs="1" name="TransactionResult" type="tns:string" />
                                    </s:sequence>
                                </s:complexType>
                            </s:element>
                        </s:schema>
                    </wsdl:types>
                    <wsdl:message name="TransactionSoapIn">
                        <wsdl:part name="parameters" element="tns:Transaction" />
                    </wsdl:message>
      <wsdl:message name="TransactionSoapOut">
                        <wsdl:part name="parameters" element="tns:TransactionResponse" />
                    </wsdl:message>
                    <wsdl:portType name="TransactionService">
                        <wsdl:operation name="Transaction">
                            <wsdl:input name="Transaction" message="tns:TransactionSoapIn" />
                            <wsdl:output name="Transaction" message="tns:TransactionSoapOut" />
                        </wsdl:operation>
                    </wsdl:portType>
                    <wsdl:binding name="TransactionService" type="tns:TransactionService">
                        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
                        <wsdl:operation name="Transaction">
                            <soap:operation soapAction="http://localhost:3000/soap/transaction" style="document" />
                            <wsdl:input>
                                <soap:body use="literal" />
                            </wsdl:input>
                            <wsdl:output>
                                <soap:body use="literal" />
                            </wsdl:output>
                        </wsdl:operation>
                    </wsdl:binding>
                    <wsdl:service name="Servicio">
                        <wsdl:port name="TransactionService" binding="tns:TransactionService">
                            <soap:address location="http://localhost:3000/soap/transaction" />
                        </wsdl:port>
                    </wsdl:service>
                </wsdl:definitions>`, // or xml (both options are valid)
        })
    )
    
    app.listen(port, () => {
        console.log(`App listening on port ${port}`)
    })
    when send
    ```
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <Transaction xmlns="http://localhost:3000/soap/transaction">
          <idTransaccion>"123456"</idTransaccion>
          <idCuenta>"1231"</idCuenta>
          <codigoRespuesta>"00"</codigoRespuesta>
          <codigoAutorizacion>"00"</codigoAutorizacion>
          <importe>500.0</importe>
          <importeDevolucion>500.0</importeDevolucion>
          <moneda>"PESOS"</moneda>  
        </Transaction>
      </soap:Body>
    </soap:Envelope>
    Obtain:
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:tns="http://www.italcred.com" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
        <soap:Body>
            <soap:Fault>
                <soap:Code>
                    <soap:Value>SOAP-ENV:Server</soap:Value>
                    <soap:Subcode>
                        <soap:Value>InternalServerError</soap:Value>
                    </soap:Subcode>
                </soap:Code>
                <soap:Reason>
                    <soap:Text>TypeError: Cannot read property &apos;outputName&apos; of undefined</soap:Text>
                </soap:Reason>
            </soap:Fault>
        </soap:Body>
    </soap:Envelope>
    i can't understand what part need outputName