dderevjanik / wsdl-tsclient

:page_facing_up: Generate typescript client from WSDL
https://npm.im/wsdl-tsclient
MIT License
97 stars 71 forks source link

Way to do pre action before sending soap request #55

Open neilpalima opened 1 year ago

neilpalima commented 1 year ago

Is there a way where we can do something before sending the soap message? In my use case, I need to get the soap body and then use this to generate an authorization header.

const client = await createClientAsync("wsdl path");
// get soap body
// do something
client.addHttpHeader('Authorization', 'something generated based on key and soap body') // add soap header
client.CallSoapMethodAsync();
gomain commented 1 year ago

You may want to look into node-soap Client. The client returned by this library is essentially that.