Feature: override host
Problem
Some SOAP api have a staging and a production domain. They sometimes provide only the production wsdl files and hence the developper is responsible to manually change the domain to the correct environment.
Context
The documentation says: https://github.com/vpulim/node-soap/blob/09a31e42dac15642f0a0433f5f128ac60ff12220/Readme.md?plain=1#L100
But this looks incorrect as it seems to override the full endpoint (including the URI part)
It is possible to override the httpClient but doing so is not really convenient
Suggested feature
Add a domain option or a urlHandler that would allow overriding the domain (or the full url, for example, to add a /staging prefix to the uri). The developer would then be able to use this to easily switch between environments.
I'm interested to try to contribute to this change.
@homersimpsons -- feel free to propose a PR with the suggested change along with the tests check for set, unset, null, or invalid domain option. Need to handle cases when both endpoint and domainare specified and are in conflict with one another as well. The proposal otherwise makes sense. @w666 would review the PR for approval and merge.
HI @homersimpsons.
I think you want this https://github.com/vpulim/node-soap?tab=readme-ov-file#clientsetendpointurl---overwrite-the-soap-service-endpoint-address
I think you want this https://github.com/vpulim/node-soap?tab=readme-ov-file#clientsetendpointurl---overwrite-the-soap-service-endpoint-address
Yes, that's what we are doing currently, but it forces us to hardcode (with a variable domain) every endpoint. If they ever changes we will have to update those part of the code (the service we use has one endpoint per service.
What is the difference between overriding full URL or just a domain bit from the URL? You already have to keep them somewhere and conditionally update.
But if this is important for you just create a PR with some tests.