title: Node Js loop in Promise All not waiting to get request from SOAP
body: <p>Hi I try to use for for loop data and send request to soap api. The problem is my program seems like it didn't wait to get request from soap request</p>
  <p>here is my example data</p>
  <pre><code> data = [
        {
          store: &quot;store1&quot;,
          product: &quot;product2&quot;,
        },
        {
          store: &quot;store2&quot;,
          product: &quot;product3&quot;,
        }
      ]
  exports.thisIsFunc = async (req, res, next) =&gt; {
     Promise.all(data).then(result =&gt; {
        for (let item of result) {
          i++
          console.log(i)
          args.CustomerCode = item.store
          args.ItemNo = item.product
          const getApi = apiSend()
        }
      });
   }
  
  
  
  export function apiSend() {
    return new Promise ((resolve, reject) =&gt; {
      soap.createClient(url, (err, client) =&gt; {
        client.getDataFromAPI(args, (err, result) =&gt; {
          console.log(result)
          return result
        })
      });
    });
  }
  </code></pre>
  <p>as you see I try to use new Promise in sendApi function but sometimes It stop the error show up
  TypeError: Cannot read property 'getDataFromAPI' of undefined</p>
  <p>sometimes it return response from api. The reason that I didn't use async,await in soap because I try to change soap function into async function but it didn't work.</p>