ehcache的webservice API应用

ehcache提供了两个API,一个是面向资源的RESTful, 另一个SOAP。参见[url]http://ehcache.org/documentation/cache_server.html[/url],官网上有相关介绍。
这两种方式我都是用了,但是当想要实现webservice的安全时却遇到了问题。ehcache使用XWSS 3.0来实现安全的,这里我把所有相关的jar包,从ehcache的war工程拿到客户端来,并且激活war下的server_security_config.xml,此时服务端应该没有问题。但是客户端的调用老是出错。
[quote]2009-10-23 14:05:57 com.sun.xml.wss.impl.SecurityRecipient processMessagePolicy
严重: WSS0253: Message does not conform to configured policy: No Security Header found in message
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]: No Security Header found[/quote]
按照官网给的资料,在客户端的classpath下添加client_security_config.xml,并且在测试main程序里添加
[quote] cacheService = new EhcacheWebServiceEndpointService().getEhcacheWebServiceEndpointPort();
//add security credentials
((BindingProvider)cacheService).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "Ron");
((BindingProvider)cacheService).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "noR");
String result = cacheService.ping();[/quote]
问题暂时没有解决 :oops:
ps:以前使用过wss4j这个组件,在xfire上实现过webservice的安全,但是xfire项目初步废止,现已apache组织接管了[url]http://cxf.apache.org/docs/index.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值