Changes between Version 3 and Version 4 of ExampleUsingXmlRpcCompliantTypes
- Timestamp:
- 05/22/07 12:17:48 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ExampleUsingXmlRpcCompliantTypes
v3 v4 1 1 == Using XML-RPC compliant types in your API == 2 2 3 If you use types in your remote calls w ich are XML-RPC compliant things are very easy:3 If you use types in your remote calls which are XML-RPC compliant things are very easy: 4 4 5 5 '''Server side''' 6 6 7 - The server side defines an API to be used remotely over XML-RPC. Additional y an implementation7 - The server side defines an API to be used remotely over XML-RPC. Additionally an implementation 8 8 of the API is hosted on the server-side 9 9 … … 11 11 interface Api { 12 12 String getStatusMessage( int code ); 13 int[] getInts(); 13 14 } 14 15 15 16 class Impl implements Api { 16 17 public String getStatusMessage( int code ) {...} 18 public int[] getInts() { return new int[]{ 1,2,3 }; } 17 19 } 18 20 }}} … … 33 35 Api remote_api = XmlRpc.createClient( Api.class, "handlerId", host, port ); 34 36 String msg = remote_api.getStatusMessage( 42 ); 37 int[] ints = remote_api.getInts(); 35 38 ... 36 39 }}} … … 43 46 44 47 - instead of solely using java type Hashtable for XML-RPC type STRUCT, also java type Map can be used. 48 49 - arrays of convertible types including their primitive counterparts (such as Integer, int, ...) can be used out-of-the-box