I have develop a soap handler which intercept inbound message and retrieve values from SoapHeader.
i use following code to read soapheader
SOAPMessage soapMessage= context.getMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
SOAPHeader soapHeader = soapEnvelope.getHeader();
Now how i can create Document from SOAPHeader object so i can use that in xPathExpression.evaluate
From Document i mean org.w3c.dom.Document.
I got answer
We can create document by following code
ByteArrayOutputStream out = new ByteArrayOutputStream();
soapMessage.writeTo(out);
InputStream is = new ByteArrayInputStream( out.toByteArray() );
doc = docBuilder.parse( is );
Regards,
imran
We can directly apply parsing on soapheader like following
NodeList nodes =soapHeader.getElementsByTagName(“param”);
No need of xpath.
Regards,