cxf soap header 获取

1.cxf  soap header 获取

public class E {
	private WebServiceContext context;
	public String a(){
		Map<String, Object> headers = context.getMessageContext();
		List<Header> headerList = (List<Header>)headers.get(Header.HEADER_LIST);
		for (Header header : headerList) {
		 Node root = (Node) header.getObject();
		System.out.println("soap header name:" + root.getNodeName() + " text:" + root.getTextContent());
					if("RequestSOAPHeader".equals(root.getNodeName())){
		NodeList list = root.getChildNodes();
		int size = list.getLength();
		for(int i=0;i<size;i++){
		Node node = (Node) list.item(i);
		System.out.println("soap header name:" + node.getNodeName() + " text:" + node.getTextContent());
		//node.get
		}
		}
		}
		return null;
	}

 用户CPSP身份验证。

你可能感兴趣的:(cxf soap header 获取)