netsuite内部ajax请求,返回Code: 500错误-CarlZeng

500是服务器本身的错误代码。+代表”Internal Server Error”。一般是500都是你响应数据的页面本身就不能正确执行function login(){//alert(‘in login script’)var soap = ‘’;soap += ‘’;soap += ‘http://schemas.xmlsoap.org/soap/envelope/">';soap += ‘’;…

500是服务器本身的错误代码。+代表”Internal Server Error”。

一般是500都是你响应数据的页面本身就不能正确执行

function login()
{
//alert(‘in login script’)
var soap = ‘’;
soap += ‘‘;
soap += ‘<SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/">';
soap += ‘SOAP-ENV:Header‘;
soap += ‘<platformMsgs:applicationInfo xmlns:platformMsgs=”urn:messages_2_5.platform.webs ervices.netsuite.com” xmlns:platformMsgs=”urn:core_2_5.platform.webservi ces.netsuite.com”>’;
soap += ‘‘;
soap += ‘‘;
soap += ‘SOAP-ENV:Body‘;
soap += ‘platformMsgs:login‘;
soap += ‘platformMsgs:passport‘;
soap += ‘platformMsgs:emailzeng.chuanzhuo@totemsuite.com‘;
soap += ‘platformMsgs:password******‘;
soap += ‘platformMsgs:accountTSTDRV******‘;
soap += ‘<platformMsgs:role platformMsgs:internalId=”3”>’;
soap += ‘‘;
soap += ‘‘;
soap += ‘‘;
soap += ‘‘;
soap += ‘‘;

return soap;
}

把这个soap 传递给 ‘https://webservices.netsuite.com/services/NetSuitePort\_2\_6‘;

response =nlapiRequestURL(ns_ws_url, loginsoap, a);

问题估计是发生在了这个soap上,由于最新的netsuite更新这个soap估计有问题了。

关联应用:

var test_value = request.getAllHeaders();

var the_response =nlapiRequestURL(‘https://system.netsuite.com/app/common/multicurrency/currencyratelist.nl‘, null, test_value);

var the_body = the_response.getBody();

这个关联的应用代表登陆后在访问的页面,携带登陆信息。这个应用很经典!就是在服务端通过ajax直接操作了很多东西,用户可能还察觉不到。