We are using WSDL-2-Code generated SkeletonInterface/MessageReceiverInOut
classes in our Apache Axis2 v1.3 doc/lit SOAP 1.2 based web service. We are
attempting to set headers for the response message that will be used for
traceability within our SOA system.
>From what I can see there is nowhere for us to set headers that will
actually be retained in the response SOAP message. For example, let me show
the simple case of copying input headers to the output message.
<snippet>
MessageContext inMessageContext =
MessageContext.getCurrentMessageContext();
OperationContext operationContext =
inMessageContext.getOperationContext();
MessageContext outMessageContext =
operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE
);
org.apache.axis2.description.AxisMessage inMessage =
inMessageContext.getAxisMessage();
org.apache.axis2.description.AxisMessage outMessage =
outMessageContext.getAxisMessage();
for (Iterator it = inMessage.get; it.hasNext();)
{
SOAPHeaderMessage header = (SOAPHeaderMessage )it.next();
outMessage.addSoapHeader(header);
}
</snippet>
This code does not seem to work. Also, if I simply add new
SOAPHeaderMessage objects that I create manually I can set their qname, etc
but how do I set the _contents_ of this header?
Example header:
<soapenv:Header>
<Server xmlns="foo.org">bar.server.com</Server>
</soapenv:Header>
Thanks in advance.
Alastair Fettes
MacDonald, Dettwiler and Associates
afettes at mdacorporation dot com
This e-mail and any attachments are intended solely for the use of the
intended recipient(s) and may contain legally privileged, proprietary and/or
confidential information. Any use, disclosure, dissemination, distribution
or copying of this e-mail and any attachments for any purposes that have not
been specifically authorized by the sender is strictly prohibited. If you
are not the intended recipient, please immediately notify the sender by
reply e-mail and permanently delete all copies and attachments.
The entire content of this e-mail is for "information purposes" only and
should not be relied upon by the recipient in any way unless otherwise
confirmed in writing by way of letter or facsimile.