Changes between Version 3 and Version 4 of ExampleUsingXmlRpcBeans


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

--

Legend:

Unmodified
Added
Removed
Modified
  • ExampleUsingXmlRpcBeans

    v3 v4  
    1818    - a conversion mapping for that type is put at the XmlRpcBean (which then acts as an API itself) 
    1919    - it is an XmlRpcBean (that is, XmlRpcBeans can be nested) 
     20    - it is a Collection or Map containing a type which is XML-RPC compliant and is annotated with the @Contains annotation 
     21 
    2022 
    2123Technically, an !XmlRpcBean is converted into a XML-RPC STRUCT. The field names of the tranfered map are the property names derived from the bean class. 
     
    5456}}} 
    5557 
     58== Client side == 
     59 
     60Again, the client has no restrictions using the bean class: 
     61{{{ 
     62public interface Api 
     63{ 
     64    @Contains(CoffeeBean.class) 
     65    Collection<CoffeeBean> getAllBeans(); 
     66} 
     67 
     68Api remote_api = XmlRpc.createClient( Api.class, "handlerId", host, port ); 
     69 
     70Collection<CoffeeBean> beans = remote_api.getAllBeans(); 
     71 
     72for( CoffeeBeans b: beans ) 
     73{ 
     74    System.out.println( "Bean of type " + b.getType() + " comes from " + b.getOrigin() ); 
     75} 
     76... 
     77}}} 
     78 
    5679See also [http://delight.opendfki.de/wiki/ExampleUsingOwnConceteTypes#UsingowntypesinCollectionsandMaps How to use own types in Collections an Maps].