How to integrate NetSuite with Microsoft .NET

laptop

Using the console application

This chapter provides information on how to use the Microsoft .NET platform to create a SOAP Web services application.

Note. NetSuite recommends that you use Visual Studio .NET when you create an application using Microsoft .NET because it provides an integrated development environment for creating and debugging Web services applications. Instead, you can download and install the Microsoft .NET Framework SDK. However, this only provides an SDK and NOT an integrated IDE.

All the code samples in this chapter use C#, but the steps are similar for all other languages supported by Microsoft .NET. These languages include Visual Basic, Visual J#, and C++.

Step 1
Install Microsoft Visual Studio .NET, which includes .NET Framework 4 or higher.

Step 2
Run Microsoft Visual Studio .NET.

Step 3
Create a new project and select a template.
For example: the console program shown in the figure below.

Step 4
After creating the project, add a web link.
Go to the Project menu -> Add service link -> click the Advanced button.
Click the “Add web link” button.

Step 5
In the Add Web Reference message, enter the SuiteTalk WSDL URL and click the Go icon.

Step 6
Visual Studio parses the WSDL and then displays a summary of the available operations. If any security warnings are displayed, click Yes as many times as necessary to continue with the process.

Step 7
Once the summary is displayed, click the “Add References” button to create the classes. Once this process is complete, com.netsuite.webservices will be listed under the Web Links section in the Solution Explorer.

Step 8
You can view all the generated proxy classes by doing one of the following:
Option 1: Enable the “Show all files” option in the Project menu.
Option 2: Select View in Object Browser by right-clicking the com.netsuite.webservices listing in the Solution Explorer if the first option is not available.

Step 9
Implement your application by applying your business logic using the .NET proxy classes you created.
Allow the use of objects from the newly created namespace without the need to qualify them.
Create an instance of a NetSuiteService class object.
Enable support for managing multiple cookies.
Create a valid session by populating the Passport object.
Implement your business logic (for example, create a new customer in NetSuite).
Log out to invalidate the current session.