axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dushshantha Chandradasa (JIRA)" <>
Subject [jira] Commented: (AXISCPP-573) problem in setURI() API in IAttribute class
Date Tue, 07 Jun 2005 07:09:44 GMT
    [ ] 

Dushshantha Chandradasa commented on AXISCPP-573:

Here the problem is that the method setURI (const AxisChar* uri) just set a string variable.
The engine uses the prifix which is also a string variable in the Attribute object to get
the namespace declaration. If we call the setURI(const AxisChar* uri) method while there is
a prevously set  prefix, it only changes m_uri string variable in the Attribute object which
is the return value of getURI() method. Engine still uses the namespace prefix to get the
namespace declaration. 

I think , removing the setURI() from the API list is not a good idea as one need to set the
URI when the prifix is empty. 

Among the other two options, the best one is option 1. Here if there is a previously set prefix,
setURI() shoul dautomatically set the prefix accordingly. And there is no predefined namespace
with that URI, the prefix should be set to empty.

Any thoughts on this???

> problem in setURI() API in IAttribute class
> -------------------------------------------
>          Key: AXISCPP-573
>          URL:
>      Project: Axis-C++
>         Type: Bug
>   Components: Client - Engine
>     Reporter: James Jose
>     Assignee: Dushshantha Chandradasa

> If the prefix of the attribute is empty and if I use setURI() then the Attribute class
correctly serialize by adding the correct prefix and if necessary will even add the namespace
declaration to the serialized output.
> IAttribute *attr1=phb->createAttribute("Name","","axis");
> attr1->setURI("");
> will create the following soap message
> <ns:TestHeader xmlns:ns="" xmlns:ns2=""
> Here setURI() results in generating a namespace declaration for the uri ""
and used the generated prefix 'ns2' as the prefix for 'Name' attribute.
>  But if the attribute prefix is not empty, then this setURI() does not change its prefix.
> INamespace *nsp=phb->createNamespaceDecl ("nsp","");
> IAttribute *attr1=phb->createAttribute("Name","nsp","axis");
> attr1->setURI("");
> results in 
> <ns:TestHeader xmlns:ns="" nsp:Name="axis" xmlns:nsp="">
> attr1->getPrefix() will return 'nsp'
> attr1->getURI() will return ''
> but there is no namespace declaration for this combination.
> So either
>  1.setURI() should also change the prefix value accordingly.
>  2.setURI() should not change the URI if prefix is already set.
>  3.setURI() should be removed from the API list.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message