Changeset 866

Show
Ignore:
Timestamp:
08/21/07 23:28:01 (1 year ago)
Author:
schst
Message:

Fixed ticket #53: stateful services can now be achieved by setting a string that will be appended to the service URL.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/docroot/json-rpc/index.php

    r775 r866  
    1010 * @author  Stephan Schmidt <schst@stubbles.net> 
    1111 */ 
     12/** 
     13 * Load Stubbles 
     14 */ 
     15require '../bootstrap-stubbles.php'; 
     16 
     17stubClassLoader::load('net.stubbles.ipo.request.stubWebRequest', 
     18                      'net.stubbles.ipo.session.stubPHPSession'); 
     19 
     20$request = new stubWebRequest(); 
     21$session = new stubPHPSession($request, session_name()); 
    1222 
    1323$propFile = '../../examples.properties'; 
     
    5969}; 
    6070var nameServ = new NameService(NameCallbackObj); 
     71 
     72// make sure, that the session id is used for all requests 
     73stubbles.json.rpc.appendToURL = '&<?php echo $session->getName(); ?>=<?php echo $session->getId(); ?>'; 
    6174</script> 
    6275 
  • trunk/src/main/javascript/stub-base.js

    r514 r866  
    55 */ 
    66var stubbles = {}; 
    7 stubbles.json = {}; 
    8 stubbles.json.rpc = {}; 
  • trunk/src/main/javascript/stub-json-rpc-debug.js

    r666 r866  
     1/** 
     2 * Namespaces for JSON-RPC 
     3 */ 
     4stubbles.json = {}; 
     5stubbles.json.rpc = {}; 
     6stubbles.json.rpc.appendToURL = null; 
    17/** 
    28 * Stubbles JSON-RPC client 
     
    5662 
    5763    var postUrl = this.serviceURL; 
     64    if (stubbles.json.rpc.appendToURL != null) { 
     65        postUrl = postUrl + stubbles.json.rpc.appendToURL; 
     66    } 
    5867    var jsonRpcReq = { 
    5968      'method': classAndMethod, 
  • trunk/src/main/javascript/stub-json-rpc.js

    r514 r866  
     1/** 
     2 * Namespaces for JSON-RPC 
     3 */ 
     4stubbles.json = {}; 
     5stubbles.json.rpc = {}; 
     6stubbles.json.rpc.appendToURL = null; 
    17/** 
    28 * Stubbles JSON-RPC client 
     
    5258 
    5359    var postUrl = this.serviceURL; 
     60    if (stubbles.json.rpc.appendToURL != null) { 
     61        postUrl = postUrl + stubbles.json.rpc.appendToURL; 
     62    } 
    5463    var jsonRpcReq = { 
    5564      'method': classAndMethod,