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

Regardless of Config, All Calls Go to Wrong DataCenter #434

Closed
imageaid opened this issue Aug 28, 2019 · 6 comments
Closed

Regardless of Config, All Calls Go to Wrong DataCenter #434

imageaid opened this issue Aug 28, 2019 · 6 comments

Comments

@imageaid
Copy link

imageaid commented Aug 28, 2019

I am attempting to update our NetSuite gem's configuration so that our requests go to the "right" data center.

However, regardless of what I enter into the initializer, all requests go to the wrong data center, using the 'generic' wsdl: https://webservices.netsuite.com/services/NetSuitePort_2017_2 as it appears to drop the na2. from the 'correct' URL (see below).

In my configuration/initializer, I have specified one of two options:

# config/initializers/netsuite.rb
NETSUITE_CONFIG = YAML.load_file(File.join(Rails.root, 'config', 'netsuite.yml'))[Rails.env].symbolize_keys

NetSuite.configure do
  reset!

  api_version   '2017_2'

  wsdl          "https://webservices.na2.netsuite.com/services/NetSuitePort_#{api_version}"
  # I have tried, with the same results, using one of the options below instead
  # wsdl          "https://OURACCT#.suitetalk.api.netsuite.com/wsdl/v#{api_version}_0/netsuite.wsdl"
  # wsdl_domain   'OURACCT#.suitetalk.api.netsuite.com'

  sandbox false
  account           NETSUITE_CONFIG[:api_account]
  consumer_key      NETSUITE_CONFIG[:consumer_key]
  consumer_secret   NETSUITE_CONFIG[:consumer_secret]
  token_id          NETSUITE_CONFIG[:token_id]
  token_secret      NETSUITE_CONFIG[:token_secret]

  read_timeout 100_000
  # let's save this stuff to its own log
  log File.join(Rails.root, 'log/netsuite.log')

  soap_header 'platformMsgs:ApplicationInfo' => {
    'platformMsgs:ignoreReadOnlyFields' => true
  }
end

The long and short is that no matter what I have in the initializer/config file, the library only makes requests to "https://webservices.netsuite.com/services/NetSuitePort_2017_2". I have even tried as wsdl "http://dumburls.com/i/hate/netsuite" as a WSDL URL and it still just goes to the URL noted above.

One final note: if I change the API Version in the config file, it DOES change the request to https://webservices.netsuite.com/services/NetSuitePort_2015_1 but still ignores whatever I have for wsdl or wsdl_domain.

Any direction or suggestions would be most appreciated and thank you!

@tatecarr
Copy link
Contributor

@imageaid Good place for questions like this is the slack channel, Mike tries to keep issues to just issues and not questions unless that leads to a bug/issue, and then an issue can be created of course. Join the slack channel by going here: http://opensuite-slackin.herokuapp.com/

But, to possibly answer your question, there is something funky with the sandbox config where it resets other config -- I forget exactly which, but I think the endpoint may be one of them. If you move the sandbox false to the top just above the api_version and use wsdl_domain not just wsdl, I think that may do the trick for you (and definitely use the account based URL for that).

@imageaid
Copy link
Author

imageaid commented Aug 29, 2019 via email

@tatecarr
Copy link
Contributor

Yep, it's easy to locate the problem sandbox bit. I think I was going to possibly submit a PR as well, but I think it might be a good idea to just nix the sandbox altogether -- the logic included with that flag is older and tied to the sandbox domain. So that was before NS got rid of the sandbox domain. Which was before they've now gone to account specific URLs for both prod 12345.app/suitetalk/etc... and for sandbox too 12345-sb1.app/suitetalk/etc.

So should probably look at removing sandbox, and making the wsdl_domain required -- then folks are setting it explicitly rather than any gem defaults, and it can be explicitly to a SB, or to a prod account. Thoughts @iloveitaly ?

@imageaid
Copy link
Author

I do like the idea of making wsdl_domain required given NetSuite's removal of their internal router and new requirement for accounts to use those specific, account-based Data Center URLs.

@shaicoleman
Copy link
Contributor

Related to #430

@iloveitaly
Copy link
Member

#473 Fixed this issue. Closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants