Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Edwin Valencia
    @InnovaInternacional_gitlab

    Hello guys

    I am trying to consume a soap.wsdl with Google's SAML2 authentication. Anyone have experience with this authentication?

    Thank you

    stdvn
    @stdvn

    Hello, I am trying to get data from a SOAP operation from a wsdl file and it seems like nothing happens when firing soap.createClient(url, options) function.
    For example , i'm trying to get

    curl --location --request POST 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso' \
    --header 'Content-Type: text/xml; charset=utf-8' \
    --data-raw '<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
          <ubiNum>500</ubiNum>
        </NumberToWords>
      </soap:Body>
    </soap:Envelope>'

    So I wrote this following code in node js :

    var soap = require('soap');
    export const createRequest = () => {
      const url = 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso?wsdl';
    
      const args = {
        ubiNum: 500,
      };
    
      soap.createClient(url, ([err, client]: [any, any]) => {
        console.log('err', err);
        console.log('client', client);
        client.NumberToWords(args, ([err, result]: [any, any]) => {
          console.log(result);
        });
      });
    };

    I don't have either logs err, client or result.
    Is there anyone who can help me telling me what I'm doing wrong ?
    Thanks a lot !

    Andy Moreno
    @andymorenoing
    Hello, can you please help me. my question is if you can put a WSSecurity header and a WSSecurityCert in the same request?
    Martin Zegarelli
    @zegarelli
    Hello, I have a WSDL file that imports another WSDL file. I'm trying to use soap.createClientAsync('path/to/wsdl/file') but it only accepts a path to one. Any idea how I can get the other file to be imported?
    stdvn
    @stdvn

    Hello, I am trying to get data from a SOAP operation from a wsdl file and it seems like nothing happens when firing soap.createClient(url, options) function.
    For example , i'm trying to get

    curl --location --request POST 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso' \
    --header 'Content-Type: text/xml; charset=utf-8' \
    --data-raw '<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
          <ubiNum>500</ubiNum>
        </NumberToWords>
      </soap:Body>
    </soap:Envelope>'

    So I wrote this following code in node js :

    var soap = require('soap');
    export const createRequest = () => {
      const url = 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso?wsdl';
    
      const args = {
        ubiNum: 500,
      };
    
      soap.createClient(url, ([err, client]: [any, any]) => {
        console.log('err', err);
        console.log('client', client);
        client.NumberToWords(args, ([err, result]: [any, any]) => {
          console.log(result);
        });
      });
    };

    I don't have either logs err, client or result.
    Is there anyone who can help me telling me what I'm doing wrong ?
    Thanks a lot !

    For information, if it helps someone, to correct it, I had to change createClient call to :

    soap.createClient(url, function(err: any, client: any) {
        console.log('err', err);
        console.log('client', client);
        client.NumberToWords(args, function(err: any, result: any) {
          console.log(result);
        });
      });
    Biktop
    @Biktop

    Hello, I've updated node-soap from 0.33.0 to 0.35.0 and found the issue that <soap:Body> is empty.
    There's message what I have for 0.33.0

    <?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:fns="urn:fault.partner.soap.sforce.com"
      xmlns:tns="urn:partner.soap.sforce.com"
      xmlns:ens="urn:sobject.partner.soap.sforce.com">
      <soap:Header>
        <tns:SessionHeader>
          <tns:sessionId>...</tns:sessionId>
        </tns:SessionHeader>
        <connection>keep-alive</connection>
      </soap:Header>
      <soap:Body>
        <describeGlobal xmlns="urn:partner.soap.sforce.com"></describeGlobal>
      </soap:Body>
    </soap:Envelope>

    And what I have for 0.35.0 (and 0.34.0)

    <?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:fns="urn:fault.partner.soap.sforce.com"
      xmlns:tns="urn:partner.soap.sforce.com"
      xmlns:ens="urn:sobject.partner.soap.sforce.com">
      <soap:Header>
        <tns:SessionHeader>
          <tns:sessionId>...</tns:sessionId>
        </tns:SessionHeader>
        <connection>keep-alive</connection>
      </soap:Header>
      <soap:Body></soap:Body>
    </soap:Envelope>

    Maybe it's well known issue?

    4 replies
    temuccio
    @temuccio
    Hi all, I use node-soap with 3 wsdl without problem
    but at 4th wsdl I have this problem
    TypeError: Cannot read property 'complexTypes' of undefined
    Do you can help me to solve this problem?
    temuccio
    @temuccio
    the wdsl import two schemas
    I have upgrade to 0.35.0
    I have try on SOAP-UI and it's works fine
    Francesco Francomano
    @silversoul93

    Hi guys, I need your help. I have a service that uses a custom version of the node-soap library, forked from the 0.24.0 version, forked to add the support to the attribute element.

    In this way, the describe operation returns the content of the attribute fields too.

    Is a way to achieve this with the 0.35.0 version of the node-soap library?

    I mean that with this piece of wsdl:

    <s:element name="Add">
            <s:complexType>
              <s:attribute name="AttributeInOne" type="s:boolean"/>
              <s:attribute name="AttributeInTwo" type="s:int" />
              <s:sequence>
                <s:element minOccurs="1" maxOccurs="1" name="intA" type="s:int" />
                <s:element minOccurs="1" maxOccurs="1" name="intB" type="s:int" />
                <s:element minOccurs="0" maxOccurs="1" name="NestedElem" type="tns:NestedElemDef" />
              </s:sequence>
              <s:attribute name="AttributeInThree" type="s:string"/>
            </s:complexType>
          </s:element>

    I want to get (the attributes are the fields starting with the _ char):

    const expected = {
        type: 'object',
        properties: {
          intA: {
            type: 'integer',
          },
          intB: {
            type: 'integer',
          },
          NestedElem: {
            type: 'object',
            properties: {
              NestedValueOne: {
                type: 'string',
              },
              NestedValueTwo: {
                type: 'string',
              },
              _AttributeNested: {
                type: 'string',
              },
            },
          },
          _AttributeInOne: {
            type: 'boolean',
          },
          _AttributeInTwo: {
            type: 'integer',
          },
          _AttributeInThree: {
            type: 'string',
          },
        },
      }
    Sorry if I wrote some stupid thing, I am not so expert with soap
    Juan Pedro
    @JuanPedroPontVerges
    Hello, im having this error: Unexpected root element of WSDL or include while trying to create a client. I know it requires auth but i dont know how to achieve it
    SimonSchimmels
    @SimonSchimmels
    Hi, I'm just writing here again:
    I'm experiencing the same issue as @Biktop and @Victorcet_twitter . It was also mentioned in https://stackoverflow.com/questions/65262599/node-soap-request-gives-empty-soap-body
    I receive an empty body as response. But strangely only when calling some methods. In my case client.GetProcessListAsync() returns an empty body, but client.StopSystemAsync() is working just fine.
    Does someone have any ideas?
    trademark18
    @trademark18
    Hi all, I'm new to the library, and I'm wondering if there's anything included or available for use in node-soap that works as a type factory. I saw something in Zeep (for Python) that does this: https://docs.python-zeep.org/en/master/api.html?highlight=type_factory#zeep.Client.type_factory
    SimonSchimmels
    @SimonSchimmels
    Hi, Our team solved the issue with the empty soap body: From soap client 0.34.0 bluebird promises are replaced by custom promisifying (see vpulim/node-soap#1125), where in the case of async service method with no parameter you should explicitly set the parameter to {} such that the soap body can be correctly written in the request. In my case this was client.GetProcessListAsync({}). I hope this helps anyone stumbling over the same issue ;)
    1 reply
    Pablo Gnesutta
    @PabloGnesutta

    Hi community, I'm having a problem setting up headers for my requests:
    The Soap method I try to call is this:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ecom="http://tempuri.org/Ecommerce">
       <soapenv:Header>
          <ecom:CabeceraSoapToken>
             <!--Optional:-->
             <ecom:TokenAcceso>5b77091f-4328-4221-a78d-17adb34a740a</ecom:TokenAcceso>
          </ecom:CabeceraSoapToken>
       </soapenv:Header>
       <soapenv:Body>
          <ecom:ClientesConsulta>
             <!--Optional:-->
             <ecom:Fecha>10-10-2020</ecom:Fecha>
          </ecom:ClientesConsulta>
       </soapenv:Body>
    </soapenv:Envelope>

    And, as I understand from the docs, what I'm doing to set the proper headers is the following:

        const credentials = {
          CabeceraSoapToken: {
            TokenAcceso: "5b77091f-4328-4221-a78d-17adb34a740a"
          }
        };
    
        soap.createClient(wsdlUrl, function (err, client) {
            if (err) reject(err)
    
            client.addSoapHeader(credentials)
    
            console.log('client', client)
    
            client.ClientesConsulta(args, function (err, result) {
              if (err) reject(err)
              console.log('result', result)
            });
          });

    But i'm getting unauthorized access every time.
    I tried sending the same token with Soap UI and it works fine. It seems like it is not placing the headers in the right manner, maybe?

    IM SO LOST, please help me.

    When i Log the client after setting up the headers I see this:

    soapHeaders: [
        '<CabeceraSoapToken><TokenAcceso>5b77091f-4328-4221-a78d-17adb34a740a</TokenAcceso></CabeceraSoapToken>'
      ],

    Thank you so much in advance, I really need this to work.
    Thank you!

    Fabian Tollenaar
    @fabdrol
    Hi all, posting here as there's no "issues" on the node-soap GH page. I'm interfacing with a third party (SAP) SOAP webservice, which uses xd:sequence in the WSDL. Which means that the order of the fields matter. node-soap doesn't seem to respect the order, when generating the XML. How should I handle that?
    Vinu V
    @vv619-perf
    Hi community, currently the package node-soap has raised vulnerability in the latest security scan. Replace the deprecated and vulnerable dependency package request. The request is having two known bugs - Prototype Pollution and Insecure Cipher.
    Is there of replacing the request library with other alternatives.
    mmm-ui
    @mmm-ui
    Hi. I'm receiving files as XML responses from SOAP. Is there a way to receive them as a stream? It is possible to specify stream option when creating SOAP client but I can't figure out what it does ("stream: allows using a stream to parse the XML SOAP response. Default: false"). What shall I do guys?
    Giovanni M Guidini
    @Gguidini

    Hey guys :wave:
    I'm trying to create a SOAP client from a .wsdl definition. The problem I'm facing is that there's a redirect from the URL I have to the actual .wsdl file. If I use the URI of the file, it works, the client is created, everything is fine. But with the URL (that ends in ?wsdl) it gives me an error:

    Error: Unexpected root element of WSDL or include

    I tried passing request: request.defaults({ followAllRedirects: true }) as an option to the SOAP client, but it didn't work. I'm probably missing something here... any ideas?

    Thanks :)

    John Rossitter
    @johnatzark
    Hi Team
    I got a quick Q: I am using the soap tool to access a 3rd party SOAP based API.
    I was able to connect to their API and get WSDL discovery working, however Im a bit confused about how to pass the paramenter/arguments stack to them.
    Their API takes all arguments in the Body, but broken up into objects. I tried making a JSON flavored version of the argument stack, but just cant seem to make it work
    sinksar
    @sinksar

    Hi,
    I hope that someone could help me. I have invested now months into Soap but still getting an confusing error: My Soap Service is communicating with another one. We are using both the same wsdl file. When I am sending informations to him there is no problem but if he is using my service he couldn't read my message (The other service is like a black box and I cannot read the error out of it)
    Anyhow:
    If I send a message the raw_result looks like this

    <tns:SomAction>
    <tns:MessageA>A</tns:MessageA>
    <tns:MessageB>B</tns:MessageB>
    <tns:MessageC>C</tns:MessageC>
    </tns:SomeAction>

    If I receive a message the result looks like this

    <SomAction>
    <MessageA></MessageA>
    <MessageB></MessageB>
    <MessageC></MessageC>
    </SomeAction>

    How can i get rid oft he tns stuff?

    John Rossitter
    @johnatzark
    Sadly it seems like this chat is not used very much by the team.
    many many unanswered questions
    sinksar
    @sinksar
    @johnatzark i have switched now to strong-soap => and finally all my problems are gone. Maybe you can give it a try to. See you there ;)
    John Rossitter
    @johnatzark
    I was able to get mine working finally too,
    I find the namespace mapping to be very troublesome in this tool. My soap envelop3 has over 279 namespace mappings to the exact same thing and the validation on the server takes FOREVER to process all of that
    LukasK07
    @LukasK07
    We are using node-soap in an angular application for consuming Webservice from the clients. Does anyone know how to this client as a signleton? At the moment we are permanently creating new client instances (incl. .wsdl/.xsd... request).
    Zach Luther
    @zluther89
    How can i look at the raw request? I'm getting an unexpected response from a server and I want to look at the raw request being sent to make sure it matches as expected?
    palbornoz
    @palbornoz_twitter

    We need to add both a SSL and a X509 Certificate in node-soap. Is possible?

    SSL Certificate
    client.setSecurity(new soap.ClientSSLSecurityPFX(
    './xxxxxxx.p12',
    'passw',
    {strictSSL: false,
    rejectUnauthorized: false,
    //secureOptions: require('constants').SSL_OP_NO_TLSv1_2
    }));

    and WS-Security X509 Certificate

    Thanks,
    Pablo

    Navi0419
    @Navi0419
    Hello anyone redirect me simple node soap request using certificate pfx
    Angel Kurten
    @angelkurten
    I need help
    var args = {
    codigoInformaciom: 3058,
    numeroItendiciacion: 1190747,
    tipoIdentificacion: 1,
    };
    var auth =
      'Basic ' + Buffer.from('419984' + ':' + 'Credi9').toString('base64');
    var options = {
      wsdl_options: {
        pfx: fs.readFileSync(__dirname + '/../creditoApp.pfx'),
        rejectUnauthorized: false,
        passphrase: 'creditoApp',
      },
      wsdl_headers: { Authorization: auth },
    };
    
    soap
      .createClientAsync(url, options)
      .then((client) => {
        log(client.describe());
        log(
          client.ProspectaPlusWSService.ProspectaPlus.consultaProspecta(args),
        );
        //return client.consultaProspecta(args);
      })
      .then((result) => {});
    The response is

    callback(error, result, rawResponse, soapHeader, rawRequest);
    ^

    TypeError: callback is not a function

    Navi0419
    @Navi0419

    Any help why I am gettig this error var request = require('request');
    var soap = require('soap');
    const fs = require('fs')
    const path = require('path');
    const https = require('https');
    var options = {
    'method': 'POST',
    wsdl_options: {
    forever: true,
    rejectUnauthorized: false,
    strictSSL: false,
    pfx: fs.readFileSync(path.join(__dirname, 'key/cis-client-dev.pfx')),
    passphrase: 'client@123!',
    secureProtocol : 'TLSv1_2_method',
    gzip : true,
    // key: fs.readFileSync('./cis-client-dev-key.pem', 'utf8'),
    // cert: fs.readFileSync('./cis-client-dev.cer', 'utf8')
    },
    wsdl_headers: {
    'Content-Type': 'text/xml',
    'Authorization': 'uat_admin',
    'Accept-Encoding': 'gzip, deflate, br',
    'Connection': 'keep-alive'
    },

    body: '<XML part>'
    };

    var url = 'https://gateway.integr-test.domain.uk:port/test/services/DocumentUploadService'
    soap.createClient(url, options, function (err, client) {
    console.log('Error' + err);
    console.log('Response back from DRS: ' + client);
    });

    Error
    ErrorError: Invalid WSDL URL: https://gateway.integr-url/test/services/DocumentUploadService

    Code: 500

    Response Body: <faultstring>The endpoint reference (EPR) for the Operation not found is /test/services/DocumentUploadService and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>
    Response back from DRS: undefined

    tp-dev1
    @tp-dev1
    Hi everyone, sorry for the noob question but this is my first time using a SOAP API. I'm trying to call a SOAP function which expects an object defined in its WSDL as an object. How do I reference this object in this package?
    I've had success doing this in C#, but Visual Studio created proxy objects automatically when I imported the WSDL file. Do I need to do that in Node.js too somehow?
    Jiří Pešík
    @pesikj

    Hello, I have a .NET application with a SOAP client with the following custom binding. Is it possible to rewrite this custom binding using node-soap? I have tried Python libraries zeep and suds and it did not work, probably because it does not fully support the specified settings. Is it possible to configure the node-soap to be compliant with the following settings? I am especially concerned by the MutualCertificate mode. Thank you.

    <binding name="X">
    <security defaultAlgorithmSuite="Basic128" authenticationMode="MutualCertificate" enableUnsecuredResponse="true" requireDerivedKeys="false" includeTimestamp="true" messageProtectionOrder="EncryptBeforeSign" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" requireSignatureConfirmation="false">
    <localClientSettings detectReplays="false" />
    <localServiceSettings detectReplays="false" />
    </security>
    <textMessageEncoding messageVersion="Soap11" />
    <httpsTransport authenticationScheme="Basic" />
    </binding>

    ramnathan84
    @ramnathan84
    Hi can this module be used in react-native project?
    Matt St Jean
    @mattstjean
    Is it possible to use a string for port name with the client? The port for the service I am consuming is named "MyPort.1" but I keep getting errors when I try to call: client.MyService.MyPort.1.MyFunction(...). I've tried client.MyService.'MyPort.1'.MyFunction(...), and things like underscores etc. When I use client.describe() I get:
    { MyService: {
    MyPort: { MyFunction: [Object] },
    'MyPort.1': { MyFunction: [Object]},
    ...
    }}
    Matt St Jean
    @mattstjean
    Oh I missed the little bit about bracket notation, woops
    Teascade
    @Allexit:matrix.org
    [m]
    Hey. I'm attempting to develop something with node-soap and I'm having a weird issue
    When I call a method (no matter with methodAsync or method, or even with MyService.MyPort.method), I receive an empty response.
    The weird part is that if I use soapui and copy-and-paste the result from client.lastRequest, it works perfectly fine. node-soap just returns an empty response
    Any ideas?