ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bogdan Solomon <>
Subject RE: [jira] Updated: (MUSE-250) Serialization of EndpointReferences (or of Element represeting an EndpointReference) strips the <wsa:EndpointReference> root
Date Mon, 16 Jul 2007 19:04:10 GMT

Vinh Nguyen (vinguye2) wrote:
> My code works in both 2.1 and 2.2.  The spec you pointed out is correct.
> But, it should also be valid to have different element names with the
> same namespace.
> For the Subscribe operation, Muse already sends these messages:
>         <wsnt:Subscribe xmlns:wsnt="">
>             <wsnt:ConsumerReference>
>                 <wsa:Address
> xmlns:wsa="">...</wsa:Address>
>                 <wsa:ReferenceParameters
> xmlns:wsa="">
>                     <muse-wsa:ResourceId
> xmlns:muse-wsa="">...</muse-wsa:Reso
> urceId>
>                 </wsa:ReferenceParameters>
>             </wsnt:ConsumerReference>
>         </wsnt:Subscribe>
>         <wsnt:SubscribeResponse
>             xmlns:tns=""
> xmlns:wsnt="">
>             <wsnt:SubscriptionReference>
>                 <wsa:Address>...</wsa:Address>
>                 <wsa:ReferenceParameters>
>                     <muse-wsa:ResourceId
> xmlns:muse-wsa="">...</muse-wsa:Reso
> urceId>
>                 </wsa:ReferenceParameters>
>             </wsnt:SubscriptionReference>
> <wsnt:CurrentTime>2007-07-13T11:25:09-07:00</wsnt:CurrentTime>
>         </wsnt:SubscribeResponse>
> So your new code may work sometimes, but not all the time, like with the
> above.

1. Tried to use a custom Serializer that would return the
XmlUtils(EMPTY_DOC,namespace,epr) created element. On my machine this also
failed, as the EndpointReference root continues to be stripped. What your
Serializer is doing in toXML() is the same as what the
XmlSerializableSerializer is doing:

    public Element toXML(Object obj, QName qname)
        if (obj == null)
            return XmlUtils.createElement(qname);
        Element xml = ((XmlSerializable)obj).toXML();
        return XmlUtils.createElement(XmlUtils.EMPTY_DOC, qname, xml);

so, I do not think you really need a serializer for it on the server side
(the side that is returning the EPR), as EndpointReference implements

Did a bit more digging around the Muse source code, to figure out why the
subscription part is being serialized correctly. The Subscribe, and
SubscribeResponse messages are being generated as having the root already as
Subscribe and SubscribeResponse in their respective toXML() methods, and
inside that root is added the EndpointReference. So the EndpointReference is
not the first level element and doesn't get stripped on XML response

However doing this in my code:

Element root =
XmlUtils.setElement(root, WsaConstants.EPR_QNAME, epr.toXML());
return root; 

actually works, as the outside root that I create gets stripped and the
correct EndpointReference is returned.
View this message in context:
Sent from the Muse - Dev mailing list archive at

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

View raw message