Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix "must use account-specific domains" error with newer API versions #439

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/netsuite/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def connection(params={}, credentials={})
log_level: log_level,
log: !silent, # turn off logging entirely if configured
}.update(params))
client.wsdl.endpoint = client.wsdl.endpoint.to_s.sub('//webservices.netsuite.com/', "//#{wsdl_domain}/")
cache_wsdl(client)
return client
end
Expand Down
18 changes: 18 additions & 0 deletions spec/netsuite/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@
end
end

context 'when the API and wsdl domain have been set on newer api versions' do
before do
config.sandbox = false
config.api_version '2019_1'
config.wsdl_domain = '4810331.suitetalk.api.netsuite.com'
end

it 'should correctly modify the full wsdl path' do
expect(config.wsdl).to eql('https://4810331.suitetalk.api.netsuite.com/wsdl/v2019_1_0/netsuite.wsdl')
end

it 'should override endpoint using wsdl_domain' do
# Override endpoint as netsuite wsdls starting with 2019_1 default to the webservices.netsuite.com
# endpoint even though it is not supported by newer api versions
expect(config.connection.wsdl.endpoint).to eql('https://4810331.suitetalk.api.netsuite.com/services/NetSuitePort_2019_1')
end
end

context '#cache_wsdl' do
it 'stores the client' do
expect(config.wsdl_cache).to be_empty
Expand Down