This topic contains 8 replies, has 0 voices, and was last updated by chanarbon 7 years, 1 month ago.

  • Author
    Posts
  • #6447 Score: 0

    AnaCampoVe
    • Contributions: 0
    • Level 1

    Hello 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.

  • #6448 Score: 0

    jejacob
    • Contributions: 0
    • Level 1

    Hi 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.

  • #6449 Score: 0

    jejacob
    • Contributions: 0
    • Level 1

    More importantly, redact the password from your code snippet! Your production data might be compromised!

  • #6450 Score: 0

    AnaCampoVe
    • Contributions: 0
    • Level 1

    Hi 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!!

  • #6451 Score: 0

    markjasonflores
    • Contributions: 0
    • Level 1

    AnaCampoVe

    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.

  • #6452 Score: 0

    AnaCampoVe
    • Contributions: 0
    • Level 1

    Hi 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

  • #6453 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Have 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?

  • #6454 Score: 0

    AnaCampoVe
    • Contributions: 0
    • Level 1

    Thank 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.

  • #6455 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    AnaCampoVe , 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.

You must be logged in to reply to this topic.