@aditya.gupta41,
I tested a few things with the SOAP snap, but I could not get my ideas to work. However, I had more success testing an idea with the REST POST snap, which does allow you to access the account.username and account.password fields of a REST Basic Auth account.
You could potentially use the REST POST snap with the SOAP endpoint URL as the Service URL value, add the basic auth account to the snap, and use the following as an expression in the HTTP Entity field.
'<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns0="http://siemens.com/agilews">
<env:Header/>
<env:Body>
<ns0:login
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<credentials>
<username>' + account.username + '</username>
<password>' + account.password + '</password>
<application>' + $credentials.application + '</application>
</credentials>
</ns0:login>
</env:Body>
</env:Envelope>'
(Note 1: I tried the same with the HTTP Client snap, but it didn’t seem to have access to the account properties)
(Note 2: The account properties feature of the REST snaps is not publicly documented as far as I can tell, but it has been referenced by SnapLogic employees in multiple community posts; so keep that consideration in mind. I use it in multiple scenarios for hiding API keys)