dojox/rpc/JsonRPC.js

  • Provides:

    • dojox.rpc.JsonRPC
  • jsonRpcEnvelope

    • type
      Function
    • parameters:
      • version: (typeof )
    • source: [view]
        return {
         serialize: function(smd, method, data, options){
          //not converted to json it self. This will be done, if
          //appropriate, at the transport level

       
          var d = {
           id: this._requestId++,
           method: method.name,
           params: data
          };
          if(version){
           d.jsonrpc = version;
          }
          return {
           data: dojo.toJson(d),
           handleAs:'json',
           contentType: 'application/json',
           transport:"POST"
          };
         },

       
         deserialize: function(obj){
          if ('Error' == obj.name){
           obj = dojo.fromJson(obj.responseText);
          }
          if(obj.error) {
           var e = new Error(obj.error.message || obj.error);
           e._rpcErrorObject = obj.error;
           return e;
          }
          return obj.result;
         }
        };
    • summary
  • dojox.rpc.JsonRPC

    • type
      Object
    • summary
  • dojox.rpc

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary