Java获取Webservice的SOAP Header值

请问怎么通过Java获取Webservice的SOAP Header值。
我可以显示出Header,但就是获取不到具体的一个值出来。
显示出Header的代码是:
            SOAPHeader header = null;
            try {
                header =MessageContext.getCurrentContext().getRequestMessage().getSOAPEnvelope().getHeader();
            } catch (SOAPException e1) {
                // TODO Auto-generated catch block
                System.out.println("[ERR] notifySmsReception [SOAPException]"+e1.getMessage());
                System.out.println("======== notifySmsReception PrintStackTrace ==========");
                e1.printStackTrace();
                System.out.println("======================================================");
            }
            System.out.println("[DEUBG] notifySmsReception Header="+header.toString());



我通过 (String) MessageContext.getCurrentContext().getRequestMessage().getSOAPEnvelope().getHeader().getgetHeaderByName("spRevId","spRevId").getValue();

也获取不到值

请问应该怎么获取,谢谢!

你可能感兴趣的:(java,webservice,SOAP)