axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@tmax.co.kr>
Subject RE: unexpected behaviour with MessageElement constructors ..
Date Wed, 23 Jun 2004 03:02:17 GMT
> Ick.
> 
> I would think these two constructors would be the "right" thing:
> 
>    public MessageElement(String localPart, String prefix, 
> String namespace)
>    public MessageElement(String localPart, String prefix, 
> String namespace, Object value)
> 
> But I suppose there is no way to reorder the existing arguments.
> 
> How about we add the prefix argument to the second call? Like:
> 
>    public MessageElement(String localPart, String namespace, 
> String prefix, Object value)

+1 because it gives us more clarity to use constructors in MessageElement.

Thanks,

Ias

> 
> --
> Tom Jordahl
> Macromedia Server Development
> 
> -----Original Message-----
> From: Sanjiva Weerawarana [mailto:sanjiva@opensource.lk]
> Sent: Tuesday, June 22, 2004 1:25 AM
> To: axis-dev@ws.apache.org
> Subject: unexpected behaviour with MessageElement constructors ..
> 
> org.apache.axis.message.MessageElement has as constructors 
> the following (amongst others):
> 
>     public MessageElement(String localPart, String prefix, 
> String namespace)
>     public MessageElement(String namespace, String localPart, 
> Object value)
> 
> I wanted to create the following as a header:
>     <a:yy xmlns:a="urn:xx">hello</a:yy>
> 
> So, I did:
>     new MessageElement ("urn:xx", "yy", "hello") of course 
> that doesn't work .. it uses the wrong constructor and creates
>     <yy:urn:xx xmlns:yy="hello"/>
> 
> Not quite the same thing. I of course could work around it by 
> casting "hello" like this: (Object)"hello".
> 
> While strictly not a bug, this is a bit weird and error-prone 
> and hence should be fixed IMO. My preference would be to 
> remove the first of the above constructors .. but clearly 
> that's not backwards compatible.
> 
> Sanjiva.
> 


Mime
View raw message