on 01-12-2015 5:46 PM
Hi Experts
I'm trying to expose my table profile through XSJS but I'm getting the following error.
Found the following errors:
===========================
Error: WebEntityResponse.setBody : wrong number of arguments (line 24 position 0 in /TM/services/profile.xsjs)
URL PARAMETER
http://54.XXX.114.137:8000/TM/services/profile.xsjs?Cmd=filter
I know its a silly error i'm not able to figure it.
profile.xsjs
function exposeProfile(){
try{
var responseArray = [];
var queryStatement = 'SELECT * FROM SAP_HANA_TM.TM.data::profile';
var conn = $.db.getConnection("TM.services::Anonymous_Access");
//var conn = $.db.getConnection();
var pstmt= conn.prepareStatement(queryStatement);
var rs = pstmt.executeQuery();
while (rs.next()) {
responseArray.push({'FIRSTNAME':rs.getString(1),'HEADLINE':rs.getString(2),'PID':rs.getString(3),'DOMAIN':rs.getString(4),'LASTNAME':rs.getString(5),
'PICURL':rs.getString(7),'PROFILEURL':rs.getString(8)});
$.response.contentType = 'application/json';
}
$.response.setBody(JSON.stringify(responseArray));
$.response.status=$.net.http.OK;
}
catch(e){
$.response.status=$.net.http.INTERNAL_SERVER_ERROR;
$.response.setBody();
return;
}
}
var aCmd=$.request.parameters.get('Cmd');
switch(aCmd){
case 'filter': exposeProfile();
break;
default : $.response.status=$.net.http.INTERNAL_SERVER_ERROR;
}
Directory
Hi Shashank,
I guess the error "wrong number of arguments" is because of line 20 in your code snippet. Please try to set a string, e.g., "error".
$.response.setBody();
Best regards,
Wenjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.