Closed sephiroth-j closed 1 year ago
@lukasj, would be great if you could have look at this issue. In June we talked about it in https://github.com/eclipse-ee4j/metro-jax-ws/issues/226
While testing with the changes of #173 I found the reason for this error and the fix is quite easy.
Similar to removeAttributeNode(Attr)
in ElementImpl
, setIdAttributeNode(Attr, boolean)
must be invoked with the actual delegate attribute instance and not with the instance of com.sun.xml.messaging.saaj.soap.impl.AttrImpl
. Because element
is of type com.sun.org.apache.xerces.internal.dom.ElementNSImpl
and the owner element of the given attribute is of type com.sun.xml.messaging.saaj.soap.impl.ElementImpl
calling element.setIdAttributeNode
with the SAAJ attribute does not work.
removeAttributeNode
https://github.com/eclipse-ee4j/metro-saaj/blob/f4dc3e38e9b426766e17c513c302d9f546d1088d/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementImpl.java#L109-L115
So, this will fix the error. https://github.com/eclipse-ee4j/metro-saaj/blob/f4dc3e38e9b426766e17c513c302d9f546d1088d/saaj-ri/src/main/java/com/sun/xml/messaging/saaj/soap/impl/ElementImpl.java#L1676-L1679
@Override
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
- element.setIdAttributeNode(idAttr, isId);
+ if (idAttr instanceof AttrImpl) {
+ element.setIdAttributeNode(((AttrImpl)idAttr).delegate, isId);
+ } else {
+ element.setIdAttributeNode(idAttr, isId);
+ }
}
After updating to jaxws-rt 2.3.4 with saaj-impl 1.5.3 an exception occurs when validating incoming SOAP messages secured with ws-security using wssx-impl 2.4.5.
This as been also reported as SANTUARIO-570 and it might be related to #171.
How to reproduce
Please see the attached sample project. It contains a README how to reproduce the error. metro-jax-ws-issue-226.zip
Exception