Enable endpoint
as a configuration option to bypass NS WSDL issues
#473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This is related to #445, which I believe first raised this issue.
Recent versions of the NS WSDL contain an incorrect endpoint reference. This seems to have begun on version 2020_1. If you go to
https://<acount_id>.suitetalk.api.netsuite.com/wsdl/v2020_1_0/netsuite.wsdl
you can see at the very bottom:When requests are made to this endpoint the following error is returned:
Solution
To fix, I added a configuration option to set the WSDL endpoint:
This option is passed through to the Savon::Client at the time of client instantiation. Savon then reads the endpoint from its global config when it is building the request:
Note that the
endpoint
configuration is optional, and Savon ignores nilendpoint
configs in favor of the endpoint defined on the WSDL document:So this should be backwards compatible.
Testing
I added automated tests. But the nature of the change makes it hard to really test without deeply mocking private methods of Savon classes. So the best tests are probably manual.
By loading these changes into a console I was able to get a record on the 2020_1 version of the NS API:
Note that the request is sent to the desired endpoint:
https://1234567.suitetalk.api.netsuite.com/services/NetSuitePort_2020_1