Tuesday, September 25, 2018

Set up the Dynamic Web Services Reference URL to run the .NET Sample Application

 
1. Open .NET Sample Application NSClientCRM.cs in Microsoft Visual C# Studio
2. Right Click on Web Reference
3. Click on Add Web Reference to add the following WSDL URL 
    3.1 https://webservices.netsuite.com/wsdl/v2009_2_0/netsuite.wsdl for production 
    3.2 https://webservices.sandbox.netsuite.com/wsdl/v2009_2_0/netsuite.wsdl for sandbox
4. Change WSDL URL Behavior from Static to Dynamic
    4.1 Right Click on created Web Reference (Step 3) and Select Properties
    4.2 Set URL Behavior as Dynamic
5. Add the following code to get access to all Web Services definition
 
using NSClientCRM.com.netsuite.webservices;
using NSClientCRM.com.netsuite.sandbox;


NOTE:
1. The following will automatically be added in your app.config

< applicationSettings >
< NSClientCRM.Properties.Settings >
< setting name="NSClientCRM_com_netsuite_webservices_NetSuiteService" serializeAs="String" >
< value >https://webservices.netsuite.com/services/NetSuitePort_2009_2< /value >
< /setting >
< setting name="NSClientCRM_com_netsuite_sandbox_webservices_NetSuiteService" serializeAs="String" >
< value >https://webservices.sandbox.netsuite.com/services/NetSuitePort_2009_2< /value >
< /setting >
< /NSClientCRM.Properties.Settings >
< /applicationSettings >
 
2. To reference and add URL as a key value to the projects app.config under appSettings.
< appSettings >
.....
< add key="ClientSettingsProvider.ServiceUri" value="https://webservices.netsuite.com/wsdl/v2009_2_0/netsuite.wsdl" / >
< /appSettings >

 

No comments:

Post a Comment