Reputation: 21
I can't get Visual Studio (VS) to recognize the methods from the Netsuite sample code or other posts here. I'm attaching a screenshot (http://www.rpmex.com/img/Untitled-1.jpg) of my VS screen. The code is mostly from page 24 of the Netsuite documentation.
I have imported the WSDL in VS as a service reference. Was this wrong? I see a post (What is the difference between NetSuitePortType and NetSuiteService?) that says there is a distinction between a service reference and a web reference. The Netsuite documentation does say to import a web reference, but VS doesn't seem to have anything with that terminology.
VS is recognizing some methods like RecordRef, but it doesn't recognize calls to NetsuiteService or Passport, as you can see on the screenshot because those terms are underlined. Because there is a functioning namespace for the Netsuite Service Reference I assume I don't need to put a "using netsuiteServiceReference.com.netsuite.webservices; " line, but I did because the documentation says so.
My understanding is that VS should be recognizing any function call that is valid. Where am I going wrong?
In the following code I bolded (it is putting it bracketed in **) what VS has underlined as a syntax error
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using **netsuiteServiceReference.com**.netsuite.webservices;
namespace WebApplication5
{
namespace netsuiteServiceReference
{
**NetSuiteService** service = new **NetSuiteService**();
service.CookieContainer = new **CookieContainer**();
//invoke the login operation
Passport passport = new **Passport**();
passport.account = "TSTDRV96";
passport.email = "[email protected]";
RecordRef record = new **RecordRef**();
role.id = "3";
passport.record = record;
passport.password = "mypassword";
Status status = service.login( passport ).status;
}
public partial class ThursdayTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Upvotes: 2
Views: 2615
Reputation: 81
Sounds like you created a Service Reference. You must create a Web Reference.
Upvotes: 3
Reputation: 189
You may start from the SuiteTalk sample application that can be found here: http://www.netsuite.com/portal/developers/resources/suitetalk-sample-applications.shtml
This loads fine in Visual Studio.
Upvotes: 0