Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25th Feb 2009, 23:43
jenis23 jenis23 is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 40
Default setting status in restdatasource response

Hi Isomorphic,

I am using Restdatasource to fetch the data from database. I am creating a smartclient expected format response in which i want to set the status of the response. this status needs to be manually set ? or can i get the status directly ?

One more thing , I am also using RPCManager to call one of the action class. I am calling RPCManager from one of javascript function , so how to get a status for that RPCrequest?


Code:
function abcMethod(){
	var abc="2";
	
		isc.RPCManager.sendRequest( { data:abc, actionURL: "/moduleName/2/moduleAction_execute.action?abc="+abc } );

	}
Reply With Quote
  #2  
Old 26th Feb 2009, 13:58
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,595
Default

#1 The message formats documented for RestDataSource show a <status> element (XML) or status property (JSON) - this is how you return status.

#2 use the callback and access rpcResponse.status
Reply With Quote
  #3  
Old 26th Feb 2009, 20:11
jenis23 jenis23 is offline
Registered Developer
 
Join Date: Nov 2008
Posts: 40
Default

Hi Isomorphic,

Thanks for reply. but my concern is How will status set in XML response? Do I need to set it explicitely ??
Reply With Quote
  #4  
Old 27th Feb 2009, 00:03
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,595
Default

Not sure what the question is here - if you don't set it explicitly, how will it get set? To be clear: if you are not using the SmartClient server, your own server code is responsible for returning a correctly-formed response (which includes a status element).

There is a full discussion of the RestDataSource here, including several examples of valid responses.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved