Serialization of EndpointReferences (or of Element represeting an 
EndpointReference) strips the <wsa:EndpointReference> root
----------------------------------------------------------------------------------------------------------------------------

                 Key: MUSE-250
                 URL: https://issues.apache.org/jira/browse/MUSE-250
             Project: Muse
          Issue Type: Bug
          Components: Core Engine - Routing and Serialization
            Reporter: Bogdan Solomon
            Assignee: Dan Jemiolo
            Priority: Minor
             Fix For: 2.2.0


Having a method that returns an EndpointReference or an Element that comes from 
doing Endpointreference.toXML() results in the root of the EndpointReference to 
be striped. This in turn results in the client not being able to generate an 
EPR from the Element it receives.

The bug is caused by the way XmlUtils treats serialization of Elements and of 
XmlSerializable. In both those cases the method 

public static Element createElement(Document doc, QName qname, Object value)

will set the value of embed to true and then call 

createElement(Document doc,  QName qname, Node value, boolean embedChildren)

This causes XmlUtils to embed the properties and children of the given Node 
into the root of the reply and thus causes the root of the EndpointReference to 
be lost.

A simple fix for this would be to modify line 454 in XmlUtils from

 if (embedChildren) 

to 

if (embedChildren && 
!(value.getLocalName().equals("EndpointReference")&&value.getNamespaceURI().equals(WsaConstants.NAMESPACE_URI)))

This will cause the EPR to be treated correctly.

-- 
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]

Reply via email to