我設置了JAXWS處理程序來驗證來自JAXWS客戶端的傳入頭文件。 我想知道如何打印出的JAXWS如何使用處理程序打印客戶端傳入頭文件
handleMessage(SOAPMessageContext context)
捕獲的頭我在這裏:
Boolean isRequest = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
//for response message only, true for outbound messages, false for inbound
if(!isRequest){
try{
SOAPMessage soapMsg = context.getMessage();
SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
SOAPHeader soapHeader = soapEnv.getHeader();
Iterator<?> i = soapHeader.getChildElements();
System.out.println("Number of header elements: "
+ countElements(i));
}catch(SOAPException e){
System.err.println(e);
}
}
我如何從迭代器頭鍵和值提取?