`
pengfeifei26
  • 浏览: 245787 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

An error was discovered processing the <wsse:Security> header.

 
阅读更多
An error was discovered processing the <wsse:Security> header.
http://blog.sina.com.cn/s/blog_77a2a8b301015fls.html
  	Map<String, Object> outProps = new HashMap<String, Object>(); 
	        outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN); 
	        outProps.put(WSHandlerConstants.USER, "admin"); 
	        outProps.put(WSHandlerConstants.PASSWORD_TYPE, "admin"); 
	        outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,  UsernamePasswordCallbackClient.class.getName()); 
	        ArrayList list = new ArrayList(); 
	        // 添加cxf安全验证拦截器,必须 
	        list.add(new SAAJOutInterceptor()); 
	        list.add(new WSS4JOutInterceptor(outProps)); 
	        
		
		  //创建WebService客户端代理工厂
		  JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		  //注册WebService接口
		  factory.setServiceClass(CmsWebService.class);
		  //设置WebService地址
		  factory.setAddress("http://localhost:8080/as/ws/cmsWebService");
		  CmsWebService cmsWebService = (CmsWebService)factory.create();
		  
		  factory.getOutInterceptors().addAll(list); 
			
		  System.out.println("invoke webservice...");
		  StringBuffer sb = new StringBuffer();
		  sb.append("{\"id\":");
			sb.append("\"111\"");
			sb.append(", \"placardId\":");
			sb.append(2956729);
			sb.append(",  \"placardTitle\":");
			sb.append("\"太仆寺旗城镇管理局清洁卫生车辆公开招标招标公告\"");
			sb.append("}");
		  System.out.println("message context is:"+cmsWebService.inputArticle("1", "aa","bb",sb.toString()));  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics