Changes between Version 3 and Version 4 of WikiStart


Ignore:
Timestamp:
10/06/06 14:14:34 (18 years ago)
Author:
lauer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v3 v4  
    4242== How does it Work? == 
    4343   
    44    
     44== Examples == 
     45 
     46=== Server side === 
     47 
     48 - The server side defines an API to be used remotely over XML-RPC. Additionaly an implementation 
     49   of the API is hosted on the server-side 
     50    
     51{{{  
     52interface Api { 
     53  String getStatusMessage( int code ); 
     54} 
     55 
     56class Impl implements Api { 
     57  public String getStatusMessage( int code ) {...} 
     58} 
     59}}} 
     60 
     61 - register implementation as XML-RPC handler with the server 
     62 
     63{{{ 
     64WebServer xmlRpcServer = new WebServer( port ); 
     65xmlRpcServer.addHandler( "handlerId", XmlRpcHandlerFactory.createHandlerFor( new Impl() ); 
     66xmlRpcServer.start(); 
     67}}}     
     68 
     69=== Client side === 
     70     
     71 - create a remote client the use the API by simply calling a single method  
     72 
     73{{{ 
     74Api remote_api = XmlRpc.createClient( Api.class, "handlerId", host, port ); 
     75String msg = remote_api.getStatusMessage( 42 ); 
     76... 
     77}}}