This topic contains 8 replies, has 0 voices, and was last updated by chanarbon 7 years, 8 months ago.
-
AuthorPosts
-
March 6, 2017 at 1:14 am #6447
AnaCampoVeHello everyone!!!
We are starting our development to integrate our application with the company Netsuite account. We are in our first steps and our problem is that we are not able to connect with the NetSuite account.
We try to log with Passport, we think that the information we are sending is correct, and when we try to do the login we get a SOAP Exception saying: “Company Id does not exist”.
We have been looking for the solution in several Internet forums, but we can’t find anyone with the same error.
Here is our code:
Code:
namespace SuiteTalkTests
{
class Program
{
static void Main(string[] args)
{
var accountNumber = “1274562”;
var service = new DataCenterAwareNetSuiteService(accountNumber);service.applicationInfo = new ApplicationInfo
{
applicationId = “78T56A65-283F-4EE6-A6EA-4TRT7DBS344D”
};//invoke the login operation
Passport passport = new Passport();
passport.account = accountNumber;
passport.email = “user@email.com”;
RecordRef role = new RecordRef();
role.internalId = “3”;
passport.role = role;
passport.password = “xxxxxxxx”;
Status status = service.login( passport ).status;}
}public class DataCenterAwareNetSuiteService : NetSuiteService
{
public DataCenterAwareNetSuiteService(string account)
{
var originalUri = new Uri(Url);
var urls = getDataCenterUrls(account).dataCenterUrls;
var dataCenterUri = new Uri(urls.webservicesDomain + originalUri.PathAndQuery);
Url = dataCenterUri.ToString();
}
}
}
Do you know what can we be doing wrong?Regards,
Ana
This is a cached copy. Click here to see the original post. -
March 6, 2017 at 3:36 pm #6448
jejacobHi Ana,
Are you sure you’re using the correct NetSuite Account ID in the Passport object? For you to get the correct one, navigate to Setup > Integration > Web Service Preferences > ACCOUNT ID field.
-
March 6, 2017 at 3:38 pm #6449
jejacobMore importantly, redact the password from your code snippet! Your production data might be compromised!
-
March 7, 2017 at 12:43 am #6450
AnaCampoVeHi Jeremie!!!!
The account number is taken from the path you have suggested. And regarding security, the data I wrote in the code snippet was just invented!!!
Any other idea about what can be happening?
Thanks!!
-
March 7, 2017 at 1:06 pm #6451
markjasonfloresAnaCampoVe
Can you give us more information on this?
What datacenter are you? Are you connecting to production or sandbox?
One possibility is that you are connecting to a wrong environment/datacenter.
Or another possible problem is if you are connecting to Sandbox 2.0 account to sb environment but you are on EU1.
-
March 13, 2017 at 8:43 am #6452
AnaCampoVeHi markjasonflores !!! We are trying to connect to our Sanbox account. The web reference URL that we use is: https://webservices.sandbox.netsuite…/netsuite.wsdl and the datacenter Url that we get in our code is https://webservices.sandbox.netsuite…itePort_2016_2. Do you think these values are ok?
Thanks for your response.
Ana Campo
-
March 13, 2017 at 8:53 am #6453
chanarbonHave you tried the EU1 URL (https://webservices.eu1.netsuite.com…itePort_2016_2). I think you are in EU. What is your URL in Sandbox for your account?
-
March 13, 2017 at 9:22 am #6454
AnaCampoVeThank you very much chanarbon !! We have tried with the URL you have told me and it is working now!!! We thought that, as we have a sandbox account, we had to connect to the Sandbox URL for the web services.
-
March 13, 2017 at 10:31 am #6455
chanarbonAnaCampoVe , this is because EU sandbox is hosted in EU2 data center and not on the Sandbox link so you have to note that information when you are an EU hosted customer.
-
AuthorPosts
You must be logged in to reply to this topic.