public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
XmlRpcServer xmlrpc = new XmlRpcServer();
xmlrpc.addHandler("check", new ClassName())//其中这个类名字就是;该xmlrpc接口封装类的主要功能。
byte[] result = xmlrpc.execute(request.getInputStream());
response.setContentType("text/html");
response.setContentLength(result.length);
OutputStream out = response.getOutputStream();
out.write(result);
out.flush();
}
更多参考:http://blog.youkuaiyun.com/god123209/article/details/6799866
本文介绍如何使用XML-RPC接口进行数据传输,并通过Java实现了一个简单的XML-RPC接口封装类,演示了如何执行远程方法并返回结果。
98

被折叠的 条评论
为什么被折叠?



