我无法让Visual Studio(VS)从Netsuite示例代码或其他帖子中识别这些方法。我附上我的VS屏幕截图(http://www.rpmex.com/img/Untitled-1.jpg)。代码大部分来自Netsuite documentation的第24页。Netsuite Suitetalk服务引用在ASP.NET和Visual Studio中不起作用
我已经在VS中导入了WSDL作为服务引用。这是错的吗?我看到一篇文章(What is the difference between NetSuitePortType and NetSuiteService?)表示服务引用和Web引用之间存在区别。 Netsuite文档确实表示要导入一个Web引用,但是VS似乎没有任何关于该术语的内容。
VS正在识别一些像RecordRef这样的方法,但它不能识别对NetsuiteService或Passport的调用,因为您可以在屏幕截图中看到这些方法,因为这些术语是带下划线的。因为Netsuite服务参考有一个正在运行的命名空间,所以我假设我不需要放置“使用netsuiteServiceReference.com.netsuite.webservices;”这一行,但我这样做是因为文档说明了这一点。
我的理解是VS应该识别任何有效的函数调用。我哪里错了?
在下面的代码我加粗(它把它在括号**)什么VS突显了作为一个语法错误
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)
{
}
}
}
欢迎来到Stack Overflow!请编辑您的问题,将您的实际代码作为文本加入您的项目的服务参考资料中,以代替屏幕截图。另外,Netsuite文档的链接被打破。感谢您为未来的搜索者改进问题! – 2015-02-06 00:31:11