您的位置:首页 > 其它

xmlrpc远程监听指定端口号的建立

2014-01-26 13:21 106 查看
//创建服务端public class XmlrpcServer {protected static Logger logger = LoggerFactory.getLogger(XmlrpcServer.class);public static void monitorPython() throws Exception{WebServer webServer=new WebServer(端口号);XmlRpcServer xmlRpcServer=webServer.getXmlRpcServer();PropertyHandlerMapping phm=new PropertyHandlerMapping();phm.addHandler("stationHandler",StationHandler.class);xmlRpcServer.setHandlerMapping(phm);XmlRpcServerConfigImpl config=(XmlRpcServerConfigImpl)xmlRpcServer.getConfig();config.setContentLengthOptional(false);config.setEnabledForExtensions(true);config.setKeepAliveEnabled(true);webServer.start();}}//创建处理器,给服务端调用public class StationHandler{ 
    //对外提供远程调用的方法public String handTest(String msg) {system out println("xmlrpc测试方法被调用");}} 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐