Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    dursk
    @dursk
    Hello, I'm working on a feature right now that requires downloading MTOM attachments. I see that support was added in this PR https://github.com/vpulim/node-soap/pull/1148/files, and have been developing locally against that commit and everything is working great. Is there a plan or timeline to get this into an official release soon?
    Adish Upadhyay
    @adishupadhyay
    Hi All , If there is big amount of data in search response , its taking almost 25 minutes to return the response.. can anyone please suggest fix for this?
    data response of size ~3mb
    wagnerch
    @wagnerch
    Noticing with soap 0.40.0 that SOAP faults are no longer being included in the error exception via Async method calls. Just a generic "500" error. Reverting to 0.39.0 seems to fix this. Any one else have this problem?
    wagnerch
    @wagnerch
    Here is a reproducer of the 0.40.0 bug with SOAP faults:
    const soap = require("soap");
    
    (async () => {
        const client = await soap.createClientAsync("http://www.dneonline.com/calculator.asmx?wsdl");
    
        try {
            const res = await client.AddAsync ({
                "intA": "1",
                "intB": "a"
            });
            console.log(res[0]?.AddResult);
        } catch (error) {
            console.log("ERROR:", error?.message);
        }
    }) ();
    
    
    C:> npm install soap@0.40.0
    C:> node .\soap.js
    ERROR: Request failed with status code 500
    
    C:> npm install soap@0.39.0
    C:> node .\soap.js
    ERROR: soap:Client: System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 326). ---> System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Xml.XmlConvert.ToInt32(String s)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Add()
       at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       --- End of inner exception stack trace ---
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
       --- End of inner exception stack trace ---
       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
       at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
    Andrey Popov
    @somalil
    Hi, All! I'm a newbie in soap. Please write an example of a request with authorization(Basic). Thanks!!!
    Halvor Lyche Strandvoll
    @halvors

    Hi! I saw that it is possible to add attachments to a client for sending files with a soap request using multipart/related.

    Is this possible for the soap.listen() to parse? How can i read out attachments in listen() ?

    victorgsp
    @victorgsp

    I have the following error in my log:

    2021-08-25T08:13:59.074-03:00    Error: Error http status codes
    2021-08-25T08:13:59.074-03:00    at finish (/appserver/server/node_modules/soap/lib/client.js:256:33)
    2021-08-25T08:13:59.074-03:00    at parseSync (/appserver/server/node_modules/soap/lib/client.js:307:20)
    2021-08-25T08:13:59.074-03:00    at /appserver/server/node_modules/soap/lib/client.js:466:24
    2021-08-25T08:13:59.074-03:00    at Request._callback (/appserver/server/node_modules/soap/lib/http.js:171:17)
    2021-08-25T08:13:59.074-03:00    at Request.self.callback (/appserver/server/node_modules/request/request.js:185:22)
    2021-08-25T08:13:59.074-03:00    at Request.emit (events.js:314:20)
    2021-08-25T08:13:59.074-03:00    at Request.EventEmitter.emit (domain.js:483:12)
    2021-08-25T08:13:59.074-03:00    at Request.<anonymous> (/appserver/server/node_modules/request/request.js:1154:10)
    2021-08-25T08:13:59.074-03:00    at Request.emit (events.js:314:20)
    2021-08-25T08:13:59.074-03:00    at Request.EventEmitter.emit (domain.js:483:12)

    Which can cause the error: "Error http status codes"?

    Thanks!

    2 replies
    Joffrey Da Rocha
    @SteakdeNiche

    Hi people ! client.setSecurity using NTLMSecurity doesn't seems to work.
    I've tested my authentication using SOAPUI and it's going fine.
    Writing these code result each time in a 401 Unauthorized response from my WS. (My .wsdl file is correct and here)

    soap.createClient("file.wsdl", (err, client) => {
     client.setSecurity(new soap.NTLMSecurity(username, password, domain))
     client.MyFunction({}, (err, result) => {
       if (err) {
        console.log(err.response.status)
       }
       res.json(result)
      })
    })

    No Authorization Headers are set to my HTTP Request this way, I think that's the problem because using an old library "soap-ntlm" https://github.com/piotr-gawlowski/node-soap, there are Headers. Any ideas ?

    Halvor Lyche Strandvoll
    @halvors
    Is this channel inactive?
    Halvor Lyche Strandvoll
    @halvors
    Is there any way i can force content length to be set for a soap server?
    It is currently using chunked encoding and that is not supported by the client i need to serve.
    Andrew Brown
    @Andrew4041_gitlab
    Hello, everyone.
    Is it possible to get a session when making requests to the soap-server?
    app.listen(8001, function(){
    soapServer.listen(app, '/wsdl', myService, xml, function(){
    console.log('server initialized');
    });
    });
    How do I configure middleware for the soapServer object here?
    sm2017
    @sm2017
    There is a bug in version Version 0.41.0, I am using Version 0.39.0 and it works well today I upgraded to latest version and found that there is a bug in my app, after inspecting I figured out that vpulim/node-soap#1154 is a bad PR, I am using https-proxy-agent package to send requests via a http proxy, the code works with proxy in version 0.39.0 but not latest (I am not testing 0.41.0 but I think the issue is here)
    eldonzo
    @eldonzo

    Hi all, I upgraded from v 0.37.0 to 0.40.0 and I noticed a change in how errors are returned.
    I'm using a WSDL instance and the same request with 0.37.0 returns an error like this:

    {
       "root":{
          "Envelope":{
             "Body":{
                "Fault":{
                   "faultcode":"soap:Server",
                   "faultstring":"Il codice fiscale non e' nel formato corretto di 16 caratteri",
                   "detail":{
                      "WSException":{
                         "error":"3",
                         "message":"Il codice fiscale non e' nel formato corretto di 16 caratteri"
                      }
                   }
                }
             }
          }
       }
    }

    With 0.40.0 I get this (I replaced some informations with ...):

    {
       "message":"Request failed with status code 500",
       "name":"Error",
       "stack":"Error: Request failed with status code 500\n at createError (/usr/local/src/liveid/api/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/src/liveid/api/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/src/liveid/api/node_modules/axios/lib/adapters/http.js:260:11)\n at IncomingMessage.emit (events.js:326:22)\n at IncomingMessage.EventEmitter.emit (domain.js:483:12)\n at endReadableNT (_stream_readable.js:1241:12)\n at /usr/local/src/liveid/api/node_modules/async-listener/glue.js:188:31\n at processTicksAndRejections (internal/process/task_queues.js:84:21)",
       "config":{
          "url": ...,
          "method":"post",
          "data":"<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:tns=\"http://service.ws.nam/\">...</soap:Envelope>",
          "headers":{
             "Accept":"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8",
             "Content-Type":"text/xml; charset=utf-8",
             "User-Agent":"node-soap/0.40.0",
             "Accept-Encoding":"none",
             "Accept-Charset":"utf-8",
             "Connection":"close",
             "Host": ...,
             "Content-Length":1529,
             "SOAPAction":"\"\"",
             "Authorization":"Basic ..."
          },
          "transformRequest":[
             null
          ],
          "transformResponse":[
             null
          ],
          "timeout":0,
          "xsrfCookieName":"XSRF-TOKEN",
          "xsrfHeaderName":"X-XSRF-TOKEN",
          "maxContentLength":-1,
          "maxBodyLength":-1
       }
    }

    Does anybody have some ideas of why this happens and how to restore an error like the one I get with 0.37.0 (beside from downgrading to 0.37.0 :P)?

    haribaskarvr
    @haribaskarvr
    Hi All, I have an issue with SOAP response.
    1. When the database contains records it is working fine, but when the records not present it is not returning null response or throwing error. If anyone has any suggestion please let me know.
    Deepak Rawat
    @DeepakR-28

    hello i recently started working on soap request because of a requirement in our org.

      var soap = require('soap');
      var url = 'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso';
      var args = {sCountryISOCode: 'IN'};
      soap.createClient(url, function(err, client) {
          client.MyFunction(args, function(err, result) {
              console.log(result);
          });
      });

    i used that endpoint for testing purposes, which returns the capital of any country
    I am not sure what will go in the args,
    I made the same request from postman as you can see in the image

    with the library i get this error

    TypeError: Cannot read property 'MyFunction' of undefined
    1 reply
    image.png
    i apologize if this is a stupid question, but i am relatively new to this, haven't worked much with soap requests
    Deepak Rawat
    @DeepakR-28
    i tried this url too
    http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
    Dario Di Palma
    @DarioDiPalma98
    Hi, I have a problem, when i use node-soap, in the url i define the https, but when i lunch the code, i receive an error , and in the header is used the http version
    Dario Di Palma
    @DarioDiPalma98
    Nobady know how to solve this problem ? :(
    amalashenok
    @amalashenok
    Hello is there a way to remove empty soap:Header from soap:Envelope?
    like it's done in java
    SOAPHeader header = env.getHeader();
    header.detachNode();
    i tried clearSoapHeaders but <soap:Header></soap:Header> is not being removed
    marcosjara
    @marcosjara

    Hello group

    How could I overwrite the request to inform the certificate before creating the client?

    The server that has the WSDL requests mutual authentication by certificate

        const options : any = {
                url: `${url}`,
                cert: Buffer.from(this.cert, 'utf8'),
                key: Buffer.from(this.key, 'utf8'),
            };
            //const req = request.defaults(options);
            const req = request.defaults(options);
    
            return soap.createClient(`${url}`, {request: req}, (err: any, client: any) => {
            });

    But I got an error:

    error ->  TypeError: req.then is not a function
        at HttpClient.request (C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\http.ts:184:9)
        at Object.open_wsdl (C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\wsdl\index.ts:1414:16)
        at openWsdl (C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\soap.ts:55:5)
        at C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\soap.ts:32:7
        at _requestWSDL (C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\soap.ts:61:5)
        at Object.createClient (C:\Users\marco\git\facturacionelectronicapy-setapi\node_modules\soap\src\soap.ts:83:3)

    Thanks

    Juan Sebastian Goldberg
    @sebasgoldberg
    Hi,
    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 ><