Facing Issue in using WSDL SOAP in node.js. Soap asking for username and password

232
January 24, 2018, at 10:52 PM

I'm trying to access SOAP WSDL using node.js. I have used node-soap for this purpose. I have successfully accessed function using wsdl file. But I'm struggling to make the function work since they need username and password. I have tried SOAPUI for testing and API's are working fine. This is how SOAP UI is sending the data:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dto="http://dto.transaction.partner.pg.systems.com/" xmlns:dto1="http://dto.common.pg.systems.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <dto:initiateTransactionRequestType>
         <dto1:username>testuser</dto1:username>
         <dto1:password>somepassword</dto1:password>
         <orderId>order1</orderId>
         <storeId>6432</storeId>
         <transactionAmount>50</transactionAmount>
         <transactionType>MA</transactionType>
         <msisdn>03458599966</msisdn>
         <mobileAccountNo>03343266323</mobileAccountNo>
         <emailAddress>abc_92@hotmail.com</emailAddress>
      </dto:initiateTransactionRequestType>
   </soapenv:Body>
</soapenv:Envelope>

And how I'm sending data from node

soap.createClient(url, function(err, client) {
var args = {
            username: "testuser",
            password:"c87sdd76787fff",
            orderId: "quenoo11",//payload.orderId,
            storeId:4403,
            transactionAmount:"5",//payload.transactionAmount,
            transctionType: "MA",//payload.transctionType, // 'MA' for transition through Mobile Account || 'OTC' for transition through Over The Counter Transactions ,
            msisdn:"03458578366",//payload.msisdn, // In case of OTC
            mobileAccountNo: "03343222053",//payload.mobileAccountNo, //In case MA
            emailAddress: 'someone@example.com'
        };
            client.setSecurity(new soap.BasicAuthSecurity('testuser','c87sdd76787fff'));
            client.initiateTransaction(args, function(err, result) {
                deferred.resolve({
                    content: 'New Transition added',
                    message: result,
                    status: 200
                })
            });
        });

I have tried both options by sending username and password in arg and using setSecurity function. but its not working.

READ ALSO
Changing icon images with the switch statement

Changing icon images with the switch statement

Depending on a notification type, I need to change icon image of this notificationThere are three types of notifications

215
Canvas code not updating and I&#39;m not sure why

Canvas code not updating and I'm not sure why

I'm trying to make a simple canvas program where the user clicks to create bouncing moving circlesIt keeps freezing but still creates the circles without updating

155
PHP update query does not execute, popup form closes

PHP update query does not execute, popup form closes

I am creating a webshop for schoolI got a problem when editing existing products that are stored in my mysql database

137