ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinh Nguyen \(vinguye2\)" <vingu...@cisco.com>
Subject RE: [jira] Updated: (MUSE-250) Serialization of EndpointReferences (or of Element represeting an EndpointReference) strips the <wsa:EndpointReference> root
Date Fri, 13 Jul 2007 20:11:55 GMT
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="http://docs.oasis-open.org/wsn/b-2">
            <wsnt:ConsumerReference>
                <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">...</wsa:Address>
                <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing">
                    <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">...</muse-wsa:Reso
urceId>
                </wsa:ReferenceParameters>
            </wsnt:ConsumerReference>
        </wsnt:Subscribe>

        <wsnt:SubscribeResponse
            xmlns:tns="http://axis2.platform.core.muse.apache.org"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
            <wsnt:SubscriptionReference>
                <wsa:Address>...</wsa:Address>
                <wsa:ReferenceParameters>
                    <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">...</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.


-----Original Message-----
From: Bogdan Solomon [mailto:bsolomon@ncct.uottawa.ca] 
Sent: Friday, July 13, 2007 11:16 AM
To: muse-dev@ws.apache.org
Subject: RE: [jira] Updated: (MUSE-250) Serialization of
EndpointReferences (or of Element represeting an EndpointReference)
strips the <wsa:EndpointReference> root


I don't think it should break any functionality. According to the
WS-Addressing-2005_08.xsd spec, the endpoint reference is defined as
{http://www.w3.org/2005/08/addressing}EndpointReference, which is what
the code is checking for. Since it is defined as:

<xs:element name="EndpointReference" type="tns:EndpointReferenceType" />

I assume the local part should be EndpointReference.

Looking at your code, I am a bit surprised it works. Since it is
basically doing the same thing that the ElementSerializer is doing. Does
the message sent include the <wsa:EndpointReference> root? And is it
Muse 2.1 or 2.2?


Vinh Nguyen (vinguye2) wrote:
> 
> 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);
>     }
>  
> 

--
View this message in context:
http://www.nabble.com/-jira--Created%3A-%28MUSE-250%29-Serialization-of-
EndpointReferences-%28or-of-Element-represeting-an-EndpointReference%29-
strips-the-%3Cwsa%3AEndpointReference%3E-root-tf4075785.html#a11584783
Sent from the Muse - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


Mime
View raw message