envelope.addChild();

P

plork123

Hello All

I'm trying to add a request header to a response header using
envelope.addChild (blaa);

I'm not too sure how to do it.

What i want to do is a 'client' will call a web service method to add a
soap header. Then every other call the 'client' makes i want to make
sure the value in the header is valid

Can anyone help

Many Thanks

I'm getting the request/response MessageContext like this

MessageContext context = MessageContext.getCurrentContext();
Message requestMessage = context.getRequestMessage();
Message responseMessage = context.getResponseMessage();
SOAPEnvelope envelope = responseMessage.getSOAPEnvelope();
SOAPHeaderElement receivedHeader =
requestMessage.getSOAPEnvelope().getHeaderByName("", "MyHeader");

Then getting the value within the header

if (receivedHeader != null)
{
headerElementValue = (String)receivedHeader.getValue();
......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top