I have a nodeJS library, where I'm coding a certain functionality, which will call a SOAP API to get information.
I want that people can use the library easily. So that they can just call:
And the library should handle all the dirty work behind scenes. What I want the library to do is to first possibly validate the parameters given. Then construct the message to be sent based on the parameters (serialization?), create signature etc... And finally, call the soap API with a soap client including the message created and signed before.
The SOAP client might return a promise by itself already. So then I would have two promises floating around a function, and I'm not sure if that is a good idea at all really. Then one of those promises wouldn't be resolved or rejected.