Hi Bogdan,
Are you sure that won't break current functionality? It is possible to
create an EPR with a localpart different than "EndpointReference", and
it should still be valid as long as the namespace is correct. Or am I
wrong?
I have an operation which does return an EPR. But I do have to register
a custom serializer for it, which has the code below. It works for me:)
/** */
public Object fromXML(Element xml)
throws SoapFault
{
// Return null for empty/invalid elements, since we can't
distinguish between the two.
try
{
return new EndpointReference(xml);
}
catch (Exception exc)
{
exc.printStackTrace();
}
return null;
}
/** */
public Element toXML(Object obj, QName qname)
throws SoapFault
{
if (obj == null)
return XmlUtils.createElement(qname);
Element xml = ((XmlSerializable)obj).toXML();
return XmlUtils.createElement(XmlUtils.EMPTY_DOC, qname, xml);
}
-----Original Message-----
From: Bogdan Solomon (JIRA) [mailto:[EMAIL PROTECTED]
Sent: Friday, July 13, 2007 10:25 AM
To: [email protected]
Subject: [jira] Updated: (MUSE-250) Serialization of EndpointReferences
(or of Element represeting an EndpointReference) strips the
<wsa:EndpointReference> root
[
https://issues.apache.org/jira/browse/MUSE-250?page=com.atlassian.jira.p
lugin.system.issuetabpanels:all-tabpanel ]
Bogdan Solomon updated MUSE-250:
--------------------------------
Attachment: XmlUtils.java
Fixed XmlUtils for EPR serialization
> 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
>
> Attachments: XmlUtils.java
>
>
> 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.getNamespace
> URI().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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]