[
https://issues.apache.org/jira/browse/AXIS2-3575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577878#action_12577878
]
Davanum Srinivas commented on AXIS2-3575:
-----------------------------------------
I believe this is already fixed. Stub.java latest svn looks like this
protected void addHeader(OMElement omElementToadd,
SOAPEnvelope envelop,
boolean mustUnderstand){
SOAPHeaderBlock soapHeaderBlock =
envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(),omElementToadd.getNamespace());
soapHeaderBlock.setMustUnderstand(mustUnderstand);
OMNode omNode = null;
// add child elements
for (Iterator iter = omElementToadd.getChildren(); iter.hasNext();){
omNode = (OMNode) iter.next();
soapHeaderBlock.addChild(omNode);
}
OMAttribute omatribute = null;
// add attributes
for (Iterator iter = omElementToadd.getAllAttributes();
iter.hasNext();){
omatribute = (OMAttribute) iter.next();
soapHeaderBlock.addAttribute(omatribute);
}
}
> org.apache.axis2.client.Stub addHeader ignores custom header attributes
> -----------------------------------------------------------------------
>
> Key: AXIS2-3575
> URL: https://issues.apache.org/jira/browse/AXIS2-3575
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: kernel
> Affects Versions: 1.3
> Environment: Java5
> Reporter: Frank Heyder
>
> We are using a 3rd party webservice, which requires us to add a custom object
> to the soap header. This custom object has a required attribute. Debugging
> shows that the omElementToadd in the addHeader function of
> org.apache.axis2.client.Stub has the correct attribut, but the attributes are
> not transfered to the soapHeaderBlock.
> I have build fix for our case by adding
> Iterator atribIterator = omElementToadd.getAllAttributes();
> while (atribIterator.hasNext())
> {
> OMAttribute omAttribute = (OMAttribute)atribIterator.next();
> if (soapHeaderBlock.getAttribute(omAttribute.getQName()) == null)
> {
> soapHeaderBlock.addAttribute(omAttribute);
> }
> }
> to the addHeader function. I'm not sure, if this is a valid solution but it
> works for us.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]