Changes between Initial Version and Version 1 of ExampleUsingXmlRpcCompliantTypes


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

--

Legend:

Unmodified
Added
Removed
Modified
  • ExampleUsingXmlRpcCompliantTypes

    v1 v1  
     1== Using XML-RPC compliant types in your API == 
     2 
     3If ypu use types in your remote calls wich are XML-RPC compliant things are very easy: 
     4 
     5'''Server side''' 
     6 
     7 - The server side defines an API to be used remotely over XML-RPC. Additionaly an implementation 
     8   of the API is hosted on the server-side 
     9    
     10{{{  
     11interface Api { 
     12  String getStatusMessage( int code ); 
     13} 
     14 
     15class Impl implements Api { 
     16  public String getStatusMessage( int code ) {...} 
     17} 
     18}}} 
     19 
     20 - register implementation as XML-RPC handler with the server 
     21 
     22{{{ 
     23WebServer xmlRpcServer = new WebServer( port ); 
     24xmlRpcServer.addHandler( "handlerId", XmlRpcHandlerFactory.createHandlerFor( new Impl() ); 
     25xmlRpcServer.start(); 
     26}}}     
     27 
     28'''Client side''' 
     29     
     30 - create a remote client the use the API by simply calling a single method  
     31 
     32{{{ 
     33Api remote_api = XmlRpc.createClient( Api.class, "handlerId", host, port ); 
     34String msg = remote_api.getStatusMessage( 42 ); 
     35... 
     36}}}  
     37