|
From: creedon <icr...@us...> - 2005-06-14 00:55:12
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/betty/rpc/serverSupport In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21026 Modified Files: multiCall Log Message: commented test code bundle Index: multiCall =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/betty/rpc/serverSupport/multiCall,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** multiCall 26 Mar 2005 19:42:37 -0000 1.1.1.1 --- multiCall 14 Jun 2005 00:54:54 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.betty.rpc.serverSupport.multiCall ! on multiCall (callarray) { ÇChanges Ç4/9/01; 9:35:11 AM by DW ÇCreated. Conforms to the spec here: Çhttp://www.xmlrpc.com/discuss/msgReader$1208 ÇCalled from user.betty.rpcHandlers.system.multiCall. bundle { //fault if this is a recursive call try { //if we're debugging, don't fail local (adrparamtable = parentof (client)); if defined (adrparamtable^.flMulticall) { scriptError ("Can't process this call because we don't allow system.multicall to recurse.")}; adrparamtable^.flMulticall = true}}; bundle { //initialization if not defined (betty.rpc.errorCodes.multiCallError) { betty.rpc.errorCodes.multiCallError = 7}}; local (i, responseArray = {}); for i = 1 to sizeof (callarray) { try { //call the script local (onecall = callarray [i], flerror); local (result = betty.rpc.serverSupport.callHandler (onecall.methodName, @onecall.params, @flerror)); if flerror { responseArray = responseArray + {result}} else { responseArray = responseArray + {{result}}}} else { local (errortable); new (tabletype, @errortable); errortable.faultString = tryError; errortable.faultCode = betty.rpc.errorCodes.multiCallError; responseArray = responseArray + {errortable}}}; return (responseArray)}; bundle { //test code local (callarray = {}, i); for i = 1 to 10 { new (tabletype, @onecall); onecall.methodName = "examples.getStateNameWithError"; onecall.params = {random (35, 65)}; callarray = callarray + {onecall}}; local (multicallresult = betty.rpc.serversupport.multicall (callarray)); new (tabletype, @scratchpad.multicallresult); for i = 1 to sizeof (multicallresult) { scratchpad.multicallresult.[string.padwithzeros (sizeof (scratchpad.multicallresult), 3)] = multicallresult [i]}; edit (@scratchpad.multicallresult)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.betty.rpc.serverSupport.multiCall ! on multiCall (callarray) { ÇChanges Ç4/9/01; 9:35:11 AM by DW ÇCreated. Conforms to the spec here: Çhttp://www.xmlrpc.com/discuss/msgReader$1208 ÇCalled from user.betty.rpcHandlers.system.multiCall. bundle { //fault if this is a recursive call try { //if we're debugging, don't fail local (adrparamtable = parentof (client)); if defined (adrparamtable^.flMulticall) { scriptError ("Can't process this call because we don't allow system.multicall to recurse.")}; adrparamtable^.flMulticall = true}}; bundle { //initialization if not defined (betty.rpc.errorCodes.multiCallError) { betty.rpc.errorCodes.multiCallError = 7}}; local (i, responseArray = {}); for i = 1 to sizeof (callarray) { try { //call the script local (onecall = callarray [i], flerror); local (result = betty.rpc.serverSupport.callHandler (onecall.methodName, @onecall.params, @flerror)); if flerror { responseArray = responseArray + {result}} else { responseArray = responseArray + {{result}}}} else { local (errortable); new (tabletype, @errortable); errortable.faultString = tryError; errortable.faultCode = betty.rpc.errorCodes.multiCallError; responseArray = responseArray + {errortable}}}; return (responseArray)}; Çbundle //test code Çlocal (callarray = {}, i) Çfor i = 1 to 10 Çnew (tabletype, @onecall) Çonecall.methodName = "examples.getStateNameWithError" Çonecall.params = {random (35, 65)} Çcallarray = callarray + {onecall} Çlocal (multicallresult = betty.rpc.serversupport.multicall (callarray)) Çnew (tabletype, @scratchpad.multicallresult) Çfor i = 1 to sizeof (multicallresult) Çscratchpad.multicallresult.[string.padwithzeros (sizeof (scratchpad.multicallresult), 3)] = multicallresult [i] Çedit (@scratchpad.multicallresult) \ No newline at end of file |