在WP7中使用NetSuite服务,CookieContainer无效

时间:2013-03-10 08:15:58

标签: web-services windows-phone-7 cookies soap netsuite

我在WP7项目中使用NetSuite webservice。

这是我使用的链接(较新版本): https://webservices.na1.netsuite.com/wsdl/v2012_1_0/netsuite.wsdl

这在我的C#控制台应用程序中完美运行,但在WP7中没有。

在WP7中,它成功登录,但在添加任何内容(员工,客户,时间单......)时,我收到以下错误:

"Your connection has timed out.  Please log in again"

更新:

这是我的控制台代码:

    NetSuiteService service = new NetSuiteService();

    service.CookieContainer = new CookieContainer();

    Passport passport = new Passport();
    passport.account = "TSTDRVxxxxxx";
    passport.email = "hamzeh.soboh@para-solutions.com";

    RecordRef role = new RecordRef();
    role.internalId = "3";
    passport.role = role;

    passport.password = "passxxxx";
    Status status = service.login(passport).status;

以下是我的WP7代码:

    NetSuitePortTypeClient service = new NetSuitePortTypeClient();

    // service.CookieContainer = new CookieContainer();

    Passport passport = new Passport();
    passport.account = "TSTDRVxxxxxx";
    passport.email = "hamzeh.soboh@para-solutions.com";

    RecordRef role = new RecordRef();
    role.internalId = "3";
    passport.role = role;

    passport.password = "passxxxx";
    service.loginAsync(passport);

取消注释第二个语句会导致运行时错误。

0 个答案:

没有答案