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请求,最终将结果返回给客户端。
1万+

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



