Results 1 to 1 of 1
Thread: Apache XMl-RPC - Default Handler
- 07-25-2011, 06:01 PM #1
Member
- Join Date
- Jul 2011
- Location
- Nuremberg
- Posts
- 2
- Rep Power
- 0
Apache XMl-RPC - Default Handler
Hi,
I need to be able to process method calls of the syntax "someMethodName" without any handler specified. Is there any way to define a default handler for such cases?
Here is some code to illustrate the problem:
Java Code:public class EchoServer { public static void main(String[] args) throws Exception { WebServer webServer = new WebServer(8080); EchoService echo = new EchoServiceImpl(); PropertyHandlerMapping phm = new PropertyHandlerMapping(); phm.setVoidMethodEnabled(true); phm.addHandler("EchoService", EchoService.class); XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer(); xmlRpcServer.setHandlerMapping(phm); XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlRpcServer.getConfig(); serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(false); webServer.start(); } }
Java Code:public class EchoClient { public static void main(String[] args) throws Exception { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://127.0.0.1:8080/xmlrpc")); config.setEnabledForExtensions(true); config.setConnectionTimeout(60 * 1000); config.setReplyTimeout(60 * 1000); XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); Object[] params = new Object[] {"bla"}; client.execute("echo", params); } }
cheers
serow
Similar Threads
-
[XML-RPC Apache] The api create request handler for each request! HELP
By dario in forum Advanced JavaReplies: 0Last Post: 07-06-2011, 02:12 PM -
zip a file tp data handler
By beginer@1234 in forum New To JavaReplies: 2Last Post: 04-27-2009, 07:04 AM -
[SOLVED] Access to default session deniedAccess to default session denied
By jazz2k8 in forum NetworkingReplies: 1Last Post: 03-10-2009, 02:12 PM -
Apache Axis2 is built on Apache AXIOM, a new high performance, pull-based XML object.
By anusoniaa in forum XMLReplies: 0Last Post: 11-15-2008, 08:29 AM -
Help with Handler
By baltimore in forum AWT / SwingReplies: 1Last Post: 08-04-2007, 10:42 PM
Bookmarks