--- Felix Halim <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using xmlrpc (Java Server) from > http://ws.apache.org > The client is using xmlrpc (Javascript Client) from > http://jsolait.net/ > > To use jsolait, we need to manually specify all of > the methods that > are available on the server before we can make any > call to the > methods. However, if the server has a > "system.listMethods" available, > we are no longer need to "manually" list all of the > method for > jsolait. Jsolait will query the methods using xmlrpc > call on > system.listMethods to the server to get all of the > available methods. > > My question is: Do the Apache XML-RPC has the > "system.listMethods"? > Which job is to list all the handlers that have been > added to the > XmlRpcServer? > > Thanks, > > Felix Halim >
You can create your own listMethods method and define a handler and register it as being named system/System. You know which methods you will be needing to use. The main issue with XML-RPC and something like what you are asking for is that handlers can be POJOs which means all class methods would be returned (public I would imagine) were such a method to already exist, and if not POJO(Plain Old Java Objects) then they will be XmlRpcHandler instances which means execute is called and the handler has it's own method of determining what to do with the request. This could even be a handler which uses a map to point to different methods by name. But, it would be pretty easy for you to provide your own such method (System.listMethods). You know which classes/handlers you will be needing on the server and which methods. So, you can simply have a configuration you read and send the list back to the client. This might be easier to implement if you have your own XmlRpcHandler implementation which you can add these calls to and filter the methods back to your client...basically adding your own registration of methods through your APIs own entry point (XmlRpcHandler base class) which you can extend to give your handlers common functionality and methods, maybe even some type of a defer method to the base class before the extensions handle requests, and obviously their own specifics. So, the short answer is no there is no way of listing all available methods, and the long answer is you an add your own fairly easy depending on what you have done on the backend, or you can always make a method that simply returns a list from a properties file. Some of the stuff in XML-RPC 3.0 may help make doing something like this easier as you could replace the XmlRpcHandlerMapping to be able to use XmlRpcHandler extensions which you give the ability to register and retrieve method names so the mapping could return all of the registered handlers methods. Wade
