1

I am using NodeJS and need to connect to a SOAP service. From research, it sounds like https://github.com/vpulim/node-soap is the best package for this, though the question I have is independent of the package.

When creating a SOAP client. Should I be creating one client per APPLICATION or one client per REQUEST?

For example, say I have an endpoint /api/someMethod that needs to access the SOAP endpoint, should I:

a) Create the global soap client upon starting up the server and giving each route access to it

OR

b) Create a new soap client everytime the endpoint is accessed

Thanks!

4

1 回答 1

1

The answer is to create one global soap client because node-soap isn't really async and can cause performance problems.

Full answer provided here: https://github.com/vpulim/node-soap/issues/653

于 2015-05-20T13:30:31.607 回答