xmlrpc的java小例子

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.csdn.net/god123209/article/details/6799866

你可能感兴趣的:(java)