axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty (JIRA)" <>
Subject [jira] [Commented] (AXIS2-5431) No Header in response
Date Tue, 02 Oct 2012 12:45:07 GMT


Martin Gainty commented on AXIS2-5431:

 if the SOAPHeaders were never populated in Service Client in the first place (then the headers
ArrayList wont contain MUST_UNDERSTAND or any other attribute)
here in ServiceClient
 public void sendRobust(QName operation, OMElement elem) throws AxisFault {
        MessageContext mc = new MessageContext();
        fillSOAPEnvelope(mc, elem);
//at this point headers should be filled with SOAPHeaderBlock
        OperationClient mepClient = createClient(operation);

//which calls fillSOAPEnveloper with the aforementioned MessageContext and the xmlPayload
  private void fillSOAPEnvelope(MessageContext messageContext, OMElement xmlPayload)
            throws AxisFault {
        SOAPFactory soapFactory = getSOAPFactory();
        SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
        if (xmlPayload != null) {

//which calls addHeadersToEnvelope with the envelope (previously constructed from SOAPFactory)
 public void addHeadersToEnvelope(SOAPEnvelope envelope) {
        if (headers != null) {
            SOAPHeader soapHeader = envelope.getHeader();
            for (Object header : headers) {

/ /where do the headers come from..they are added with addHeader(OMElement) or addHeader(SOAPHeaderBlock)
..note the difference!
     * Add an arbitrary XML element as a header to be sent with outgoing messages.
     * @param header header to be sent (non-<code>null</code>)
    public void addHeader(OMElement header) {
/ /at this point the attributes of MUST_UNDERSTAND_PROPERTY are lost
        if (headers == null) {
            headers = new ArrayList<OMElement>();

     * Add SOAP Header to be sent with outgoing messages.
     * @param header header to be sent (non-<code>null</code>)
    public void addHeader(SOAPHeaderBlock header) {
        if (headers == null) {
            headers = new ArrayList<OMElement>();
/ /wrong...we cannot use an ArrayList<OMElement> to contain ArrayList<SOAPHeaderBlock>
/ / MUST_UNDERSTAND_PROPERTY is lost ..there is no way to retrieve from headers array

noting the difference of OMElement and SOAPHeaderBlock
public interface SOAPHeaderBlock extends OMSourcedElement {  
     * A SOAPHeaderBlock may be represented as an unexpanded OMSourcedElement.
     * In such cases, the underlying OMDataSource may have a property that contains
     * the value of the ROLE/ACTOR, RELAY or MUST_UNDERSTAND setting.
    public String ROLE_PROPERTY = "org.apache.axiom.soap.SOAPHeader.ROLE";
    public String RELAY_PROPERTY = "org.apache.axiom.soap.SOAPHeader.RELAY";
    public String MUST_UNDERSTAND_PROPERTY = "org.apache.axiom.soap.SOAPHeader.MUST_UNDERSTAND";
so the downcast of SOAPHeaderBlock to OMElement to fit into ArrayList<OMElement> loses
the ArrayList<OMElement> needs to be ArrayList<SOAPHeaderBlock>

this is not good and needs to be rectified ASAP
> No Header in response
> ---------------------
>                 Key: AXIS2-5431
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.6.2
>            Reporter: Martin Gainty

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message