axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan Weerasuriya <ros...@opensource.lk>
Subject Re: Regarding createAttribute() in IHeaderBlock
Date Tue, 18 Jan 2005 10:09:10 GMT
hi All,

I would like to sujjest the following.

Currently IHeaderBlock has the following 2 API functions to create
Attributesl

 - IAttribute* createAttribute(const AxisChar* localname,
        const AxisChar* prefix,
        const AxisChar* uri, const AxisChar* value) = 0;

  - IAttribute* createAttribute(const AxisChar *localname,
        const AxisChar *prefix, const AxisChar *value) = 0;

Having this conversation I would like to propose the two following
methods instead of the above 2. (Actualy the first one is the same)

- IAttribute* createAttribute(const AxisChar* localname,
        const AxisChar* prefix,
        const AxisChar* uri, const AxisChar* value) = 0;

  - IAttribute* createAttribute(const AxisChar *localname,
        const AxisChar *namespaceURI, const AxisChar *value) = 0;

I would like to get comments from all of you rgding this issue.

Roshan



On Tue, 2005-01-18 at 09:26, Roshan Weerasuriya wrote:
> hi All,
> 
> Any issues of adapting this API as James suggest?
> 
> Roshan
> 
> On Mon, 2005-01-17 at 17:58, James Jose wrote:
> > Roshan,
> >     There are two APIs for creating attributes in  IHeaderBlock.
> > 
> >     1. createAttribute(const AxisChar *localname, const AxisChar
> > *prefix, const AxisChar *value)=0 
> > 
> >      2.createAttribute(const AxisChar *localname, const AxisChar
> > *prefix, const AxisChar *uri, const AxisChar *value)=0 
> > 
> >    In the second Type if we pass prefix then its functionality is same
> > as first type. 
> >    So is this possible to change the second type to  
> >       createAttribute(const AxisChar *localname,const AxisChar *uri,
> > const AxisChar *value)=0 
> > 
> >    Is this help a little?
> > 
> > 
> > Regards
> > James
> > --------------------------------------------------
> > James Jose
> > Messaging Clients Team, WMQDDC
> > IBM Software Labs, India
> > Direct: 91-80- 25094331  Ext :2331
> > E-mail: jamejose@in.ibm.com
> > 
> > 
> > 
> > 
> > Roshan Weerasuriya
> > <roshan@opensource.lk>
> > 
> > 17/01/2005 16:43
> >          Please respond to
> >   "Apache AXIS C Developers List"
> >                To
> > Apache AXIS C
> > Developers List
> > <axis-c-dev@ws.apache.org>
> >                cc
> > 
> >           Subject
> > Re: Regarding
> > createAttribute()
> > in IHeaderBlock
> > 
> > 
> > 
> > 
> > hi James,
> > 
> > >     URI of an attribute means uri associated with its namespace
> > >prefix. Is this right?
> > Yes
> > 
> > Actualy what matters is not the prefix, the namespace. So what we
> > thought initialy was not to let the user spacify the prefix, but only
> > to
> > specify the namespaceURI, and that the engine will decide the
> > corrosponding prefix properly and correctly and will also look after
> > declaring namespace if needed.
> > But later there was a requirement by the users to also specify the
> > prefix when ever they want. We allowed this even though it was not the
> > correct way of doing things. Because when users also specify there
> > prefixes then there can be prefix clashes. Any how we allowed this.
> > 
> > So the situation (or the logic) inside the Attribute class is this:
> > - If a user specify his/her prefix, it is the duty of the user to
> > create the namespace declaratoin as well.So that the Attribute class
> > will not even bother to see the current namespaceURI. So in your case
> > what happens is that Attibute class will not bother about the
> > namespaceURI provided.
> > - If the user doesn't specify the prefix, but only the namespaceURI,
> > the Attribute class correctly serialize by adding the correct prefix
> > and
> > if necessory will even add the namespace declaration to the serialized
> > out put.
> > 
> > >     phb->createNamespaceDecl("np","http://axis.com");
> > >    
> > > *attr=phb->createAttribute("Name","np","http://apache.com","AXIS");
> > >       In this prefix of Name become 'np'. But uri of Name will be
> > > "http://apache.com".
> > So according to the above explanation you will realize that even
> > thought
> > the uri of the Attribute is specified as "http://apache.com", in the
> > serialized out put it is actualy not "http://apache.com", but it is
> > "http://axis.com". 
> > 
> > I even see some problems here. Can you come up with your
> > idea/suggestion
> > for this. Any thing which you think we have to do in our code...
> > 
> > Roshan
> > 
> > 
> > On Mon, 2005-01-17 at 16:42, James Jose wrote:
> > > Roshan,
> > > 
> > >       URI of an attribute really confusing me -
> > >      ---------------------------------------------------------
> > >      phb->createNamespaceDecl("np","http://axis.com");
> > >    
> > > *attr=phb->createAttribute("Name","np","http://apache.com","AXIS");
> > >       In this prefix of Name become 'np'. But uri of Name will be
> > > "http://apache.com".
> > >      URI of an attribute means uri associated with its namespace
> > > prefix. Is this right?
> > > 
> > > 
> > > Thanks & Regards
> > > James
> > > --------------------------------------------------
> > > James Jose
> > > Messaging Clients Team, WMQDDC
> > > IBM Software Labs, India
> > > Direct: 91-80- 25094331  Ext :2331
> > > E-mail: jamejose@in.ibm.com
> > > 
> > > 
> > > 
> > > 
> > > Roshan Weerasuriya
> > > <roshan@opensource.lk>
> > > 
> > > 17/01/2005 14:46
> > >          Please respond to
> > >   "Apache AXIS C Developers List"
> > >                To
> > > Apache AXIS C
> > > Developers List
> > > <axis-c-dev@ws.apache.org>
> > >                cc
> > > 
> > >           Subject
> > > Re: Regarding
> > > createAttribute()
> > > in IHeaderBlock
> > > 
> > > 
> > > 
> > > 
> > > hi James,
> > > 
> > > >   But In this API call if I give all the four parameters then it
> > > does
> > > not create a namespace declaration.
> > > >            IHeaderBlock
> > > >
> > >
> > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.apache.com");
> > > >         IAttribute
> > > >
> > *attr=phb->createAttribute("Name","np","http://apache.com","AXIS");
> > > >    The resultant SOAP Header is
> > > >         <SOAP-ENV:Header>
> > > >              <ns2:TestHeader xmlns:ns2="http://axis.apache.com"
> > > > np:Name="AXIS">
> > > >              </ns2:TestHeader>
> > > >         </SOAP-ENV:Header>
> > > > 
> > > >    Is this a bug?
> > > Actualy if the user is specifing his/her own prefix, the current way
> > > of
> > > doing things is that the user also has to add the namespace
> > > declaration
> > > to match his/her prefix (using the createNamespaceDecl() method).
> > > Since
> > > the namespace declaration is not given, you get this out put. Is
> > this
> > > approach OK?
> > > 
> > > >   if I pass prefix as empty string and all other parameters like
> > the
> > > >following.
> > > >              HeaderBlock
> > > >
> > >
> > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.apache.com");
> > > >              IAttribute
> > > > *attr=phb->createAttribute("Name","","http://apache.com","AXIS");
> > > >    This will create a namespace declaration.
> > > >   <SOAP-ENV:Header>
> > > >       <ns2:TestHeader xmlns:ns2="http://axis.apache.com"
> > > > xmlns:ns3="http://apache.com" ns3:Name="AXIS">
> > > >       </ns2:TestHeader>
> > > >    </SOAP-ENV:Header>
> > > 
> > > Here the namespace "http://apache.com" is declared twice. Is this OK
> > > or 
> > > should we check this and declare only one?
> > > 
> > > Roshan
> > > 
> > > On Fri, 2005-01-14 at 19:15, James Jose wrote:
> > > > Hi Roshan,
> > > > 
> > > >    A small doubt in createAttribute (const AxisChar *localname,
> > > const
> > > > AxisChar *prefix, const AxisChar *uri, const AxisChar *value) API
> > in
> > > > IHeaderBlock
> > > >
> > >
> > -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > > > 
> > > >    
> > > >    if I pass prefix as empty string and all other parameters like
> > > the
> > > > following.
> > > >              HeaderBlock
> > > >
> > >
> > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.apache.com");
> > > >              IAttribute
> > > > *attr=phb->createAttribute("Name","","http://apache.com","AXIS");
> > > >    This will create a namespace declaration.
> > > >   <SOAP-ENV:Header>
> > > >       <ns2:TestHeader xmlns:ns2="http://axis.apache.com"
> > > > xmlns:ns3="http://apache.com" ns3:Name="AXIS">
> > > >       </ns2:TestHeader>
> > > >    </SOAP-ENV:Header>
> > > > 
> > > >    But In this API call if I give all the four parameters then it
> > > does
> > > > not create a namespace declaration.
> > > >            IHeaderBlock
> > > >
> > >
> > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.apache.com");
> > > >         IAttribute
> > > >
> > *attr=phb->createAttribute("Name","np","http://apache.com","AXIS");
> > > >    The resultant SOAP Header is
> > > >         <SOAP-ENV:Header>
> > > >              <ns2:TestHeader xmlns:ns2="http://axis.apache.com"
> > > > np:Name="AXIS">
> > > >              </ns2:TestHeader>
> > > >         </SOAP-ENV:Header>
> > > > 
> > > >    Is this a bug?
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Regards
> > > > James
> > > > --------------------------------------------------
> > > > James Jose
> > > > Messaging Clients Team, WMQDDC
> > > > IBM Software Labs, India
> > > > Direct: 91-80- 25094331  Ext :2331
> > > > E-mail: jamejose@in.ibm.com
> > > > 
> > > 
> > > 
> > 
> > 
> 
> 


Mime
View raw message