I am getting the SOAPHeader by using stub._getServiceClient().getLastOperationContext().getMessageContext("In").getEnvelope().getHeader()
Then i need to parse the value of particullar element inside it, Searched lot but i'm getting null.
i have tried soapHeader.getAttribute(QName)
soapHeader.examineAllHeaderBlocks()
etc. and after getting the Iterator i'm not able to get the text of particullar element inside header.
Asked
Active
Viewed 208 times
0
1 Answers
1
You need to create 2 classes, a HeaderHandler
and a HeaderHandlerResolver
at that point in your IDE for your client you can right click and click new webservice client
and point to the wsdl url. Take a look at this http://www.javadb.com/using-a-message-handler-to-alter-the-soap-header-in-a-web-service-client/

j.con
- 879
- 7
- 19
-
The tutorial u shared shows to create header element, but here i already have header element, I just need to get a particular element out of it. – Ars May 08 '14 at 12:24
-
Oh I see, use an XML parser then, I prefer JAXB because it is standard. See this line `SOAPMessage message = smc.getMessage();` you can send `message` to the XML parser which should break out the elements for you. – j.con May 08 '14 at 13:38