wiki:WikiStart

Version 4 (modified by lauer, 17 years ago) (diff)

--

XML-RPC Delight

Using XML-RPC the easy way ...


XML-RPC Delight is meant for: All users that want to have their java components connected using a web-based protocol but don't want to waste time with defining the interfaces a second time in another language-independed description format and then generate stubs and skeletons and so on.

XML-RPC Delight is an addon to the XML-RPC specification (http://www.xmlrpc.com/spec) and builds on apache's implementation (http://ws.apache.org/xmlrpc/).


Design Objectives

  • have java components interact over internet wire with a minimum of programming and configuration effort

  • preserve XML-RPC compliance

  • make EVERY type XML-RPC transportable with minimal coding effort (ideally, not a single line of extra code!)

  • do not interfere with design of remote interfaces. Within the remote calls, one should be able to use any type or interface he wants.
  • neither the client nor the server has to be forced to load configuration files or register factories programmatically in order to use non XML-RPC compliant types in remote calls.

Overview

XML-RPC Delight creates remote clients to java APIs that are supposed to be used remotely. XML-RPC Delight does this at runtime, not at compile time!
In case the API uses types which are not XML-RPC compliant, java annotations and user-defined conversion methods allow for automatic tranformation of types to and from a XML-RPC compliant representation. Optimally, one can use non-compliant java classes in XML-RPC calls without having to code a single line of code!!

While all the automatic conversion is done, communication with the server is still XML-RPC compliant so that remote methods can still be called by non-java languages.


How does it Work?

Examples

Server side

  • The server side defines an API to be used remotely over XML-RPC. Additionaly an implementation of the API is hosted on the server-side

interface Api {
  String getStatusMessage( int code );
}

class Impl implements Api {
  public String getStatusMessage( int code ) {...}
}
  • register implementation as XML-RPC handler with the server
WebServer xmlRpcServer = new WebServer( port );
xmlRpcServer.addHandler( "handlerId", XmlRpcHandlerFactory.createHandlerFor( new Impl() );
xmlRpcServer.start();

Client side

  • create a remote client the use the API by simply calling a single method
Api remote_api = XmlRpc.createClient( Api.class, "handlerId", host, port );
String msg = remote_api.getStatusMessage( 42 );
...

Attachments (1)

Download all attachments as: .zip