Changeset 1170
- Timestamp:
- 12/20/07 14:47:34 (1 year ago)
- Files:
-
- trunk/src/main/javascript/stub-json-rpc-debug.js (modified) (5 diffs)
- trunk/src/main/javascript/stub-json-rpc.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/javascript/stub-json-rpc-debug.js
r1165 r1170 23 23 stubbles.json.rpc.Client = function(clientObj) { 24 24 var reqRespMapping = []; 25 var finalServiceUrl = null; 25 26 26 27 var callback = { … … 40 41 } 41 42 console.error("Stubbles::REQID " + rpcObj.id + " :: Invalid request id."); 42 throw ' no related request id for response id found - mapping in js obj reqRespMapping failed!';43 throw 'stubbles: no related request id for response id found - mapping in js obj reqRespMapping failed!'; 43 44 } else { 44 45 console.error("Stubbles::REQID " + rpcObj.id + " :: ERROR: " + rpcObj.error); … … 48 49 failure: function(o) { 49 50 console.error("Stubbles::REQID n/a :: ERROR: HTTP Request failed."); 50 throw ' callback error due to bad request from service (instead of HTTP status code 200)';51 throw 'stubbles: callback error due to bad request from service (instead of HTTP status code 200)'; 51 52 } 52 53 }; … … 62 63 63 64 if(stubbles.json.rpc.serviceUrl === null) { 64 throw ' no service url set via js object \'stubbles.json.rpc.serviceUrl\'';65 throw 'stubbles: no service url set via js object \'stubbles.json.rpc.serviceUrl\''; 65 66 } else { 66 stubbles.json.rpc.serviceUrl = (stubbles.json.rpc.appendToUrl !== null) 67 ? stubbles.json.rpc.serviceUrl + '&' + stubbles.json.rpc.appendToUrl 68 : stubbles.json.rpc.serviceUrl + ''; 67 if (finalServiceUrl === null) { 68 finalServiceUrl = (stubbles.json.rpc.appendToUrl !== null) 69 ? stubbles.json.rpc.serviceUrl + '&' + stubbles.json.rpc.appendToUrl 70 : stubbles.json.rpc.serviceUrl; 71 } 69 72 } 70 73 … … 81 84 }; 82 85 83 YAHOO.util.Connect.asyncRequest('POST', stubbles.json.rpc.serviceUrl, callback, jsonRpcReq.toJSONString());86 YAHOO.util.Connect.asyncRequest('POST', finalServiceUrl, callback, jsonRpcReq.toJSONString()); 84 87 console.info("Stubbles::REQID " + id + " :: Calling method " + classAndMethod); 85 88 reqRespMapping.push(jsonRpcReq); trunk/src/main/javascript/stub-json-rpc.js
r1167 r1170 22 22 */ 23 23 stubbles.json.rpc.Client = function(clientObj) { 24 var reqRespMapping = []; 24 var reqRespMapping = []; 25 var finalServiceUrl = null; 25 26 26 27 var callback = { … … 38 39 } 39 40 } 40 throw ' no related request id for response id found - mapping in js obj reqRespMapping failed!';41 throw 'stubbles: no related request id for response id found - mapping in js obj reqRespMapping failed!'; 41 42 } else { 42 43 throw rpcObj.error; … … 44 45 }, 45 46 failure: function(o) { 46 throw ' callback error due to bad request from service (instead of HTTP status code 200)';47 throw 'stubbles: callback error due to bad request from service (instead of HTTP status code 200)'; 47 48 } 48 49 }; … … 58 59 59 60 if(stubbles.json.rpc.serviceUrl === null) { 60 throw ' no service url set via js object \'stubbles.json.rpc.serviceUrl\'';61 throw 'stubbles: no service url set via js object \'stubbles.json.rpc.serviceUrl\''; 61 62 } else { 62 if (stubbles.json.rpc.appendToUrl !== null && 63 stubbles.json.rpc.serviceUrl.indexOf('SID') === -1) { 64 stubbles.json.rpc.serviceUrl += '&' + stubbles.json.rpc.appendToUrl; 63 if (finalServiceUrl === null) { 64 finalServiceUrl = (stubbles.json.rpc.appendToUrl !== null) 65 ? stubbles.json.rpc.serviceUrl + '&' + stubbles.json.rpc.appendToUrl 66 : stubbles.json.rpc.serviceUrl; 65 67 } 66 68 } … … 78 80 }; 79 81 80 YAHOO.util.Connect.asyncRequest('POST', stubbles.json.rpc.serviceUrl, callback, jsonRpcReq.toJSONString());82 YAHOO.util.Connect.asyncRequest('POST', finalServiceUrl, callback, jsonRpcReq.toJSONString()); 81 83 reqRespMapping.push(jsonRpcReq); 82 84 return id;
