闲着没事Hessian开发WebService的总结(二)

          在Spring和Hessian整合中,以前整合直接在客户端使用代理访问Spring和Hessian整合的远程访问调用,没有问题,最近没事,直接采用地址栏输入地址,常见的一个问题,Hessian仅仅支持Post请求。

 

 

 

 在客户端访问源代码:

 

 http://topmanopensource.iteye.com/blog/350108

请参看:

Spring中HessianServiceExporter 类源代码如下:

 

public class HessianServiceExporter extends HessianExporter implements HttpRequestHandler {

	/**
	 * Processes the incoming Hessian request and creates a Hessian response.
	 */
	public void handleRequest(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		if (!"POST".equals(request.getMethod())) {
			throw new HttpRequestMethodNotSupportedException(request.getMethod(),
					new String[] {"POST"}, "HessianServiceExporter only supports POST requests");
		}

		try {
		  invoke(request.getInputStream(), response.getOutputStream());
		}
		catch (Throwable ex) {
		  throw new NestedServletException("Hessian skeleton invocation failed", ex);
		}
	}

}

 由上可以看出仅仅支持HTTP中的POST协议。

备注:在java web开发中,http的常用的请求方式有两种HTTP POST,HTTPGET ,默认的GET,但是在地址栏中输入http地址实质就是get请求方式。所以不支持!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值