You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Adrian Dick <ad...@uk.ibm.com> on 2004/06/25 09:54:06 UTC

Extensions to API for Handlers




Hi,

We have made the following modifications, affecting the API, which allow a
custom handler to do the following:
   Add additional namespaces to an header block
   Add attributes to a ComplexElement within an header block.

The functionality of the first was already available in the code, but not
on the IHeaderBlock API.  We also provided two methods to assist in
building the namespace attribute - mimicking the current behaviour of a
regular attribute
   int addNamespaceDecl(Attribute *pAttribute)
   Attribute* createNamespaceDecl(const AxisChar* localname,
      const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
   Attribute* createNamespaceDecl(const AxisChar* localname,
      const AxisChar* prefix, const AxisChar* value)

Affecting the following files:
   include/axis/server/IHeaderBlock.h(See attached file:
   IHeaderBlock.h.patch)
   include/axis/server/HeaderBlock.h(See attached file:
   HeaderBlock.h.patch)
   src/soap/HeaderBlock.cpp(See attached file: HeaderBlock.cpp.patch)


The functionality of the second needed to be introduced anew.  The
implementation of which was taken from HeaderBlock. We have provided the
following methods on BasicNode:
   Attribute* createAttribute(const AxisChar* localname,
       const AxisChar* prefix, const AxisChar* uri, const AxisChar* value)
   Attribute* createAttribute(const AxisChar* localname,
       const AxisChar* prefix, const AxisChar* value)
These We have then over-ridden on CharacterElement (to have no effect) and
ComplexElement (having the desired effect), affecting these files:
   include/axis/server/BasicNode.h(See attached file: BasicNode.h.patch)
   include/axis/server/CharacterElement.h(See attached file:
   CharacterElement.h.patch)
   src/soap/ComplexElement.h(See attached file: ComplexElement.h.patch)
   src/soap/ComplexElement.cpp(See attached file: ComplexElement.cpp.patch)

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)

Re: Extensions to API for Handlers

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Hi Adrian,

> On some levels I agree with you, but at a most basic level, a namespace
> declaration is an attribute which has special meaning.
> Also, when writing this I was taking the simplest approach of just
exposing
> the functionality already in place - which uses Attributes to create
> Namespaces.

OK ..

> I have now adjusted to become:
>    Attribute* createNamespaceDecl(const AxisChar *prefix,
>        const AxisChar *uri)

Cool.

> (See attached file: IHeaderBlock.h.patch)(See attached file:
> HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
> It would probably also make sense to overload addNamespaceDecl to have the
> same parameters.

We should just remove the other add.. methods; the other params are
just wrong.

Sanjiva.


Re: Extensions to API for Handlers

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi,

In linux I noticed that when I send the request to Axis C++ Server, in
the response SOAP Message, it doens't include the Attributes &
namespaces which were added from the client. We have to fix this. This
is not a Axis C++ client problme, but a Axis C++ server problem.

Request SOAP Message, SOAP Headers.
-------------------------------
<SOAP-ENV:Header>
<ns2:TestHeader xmlns:ns2="http://ws.apache.org/axisCppTest/"
xmlns:namesp1="http://mynamespace.com">
<Credentials ns2:type="normal">
<username ns2:usertype="normal_user">Test User</username>
<password>Test Password</password>
</Credentials>
</ns2:TestHeader>
</SOAP-ENV:Header>


Response SOAP Message, SOAP Headers.
-------------------------------
<SOAP-ENV:Header>
<ns2:TestHeader xmlns:ns2="http://ws.apache.org/axisCppTest/">
<Credentials>
<username>Test User</username>
<password>Test Password</password>
</Credentials>
</ns2:TestHeader>
</SOAP-ENV:Header>

Roshan

On Tue, 2004-08-03 at 16:14, Roshan Weerasuriya wrote:
> hi,
> 
> The test case for this is available at
> <CVS_AXISCPP_HOME>/tests/client/soapHeader/test9.
> 
> I tested this in Linux but not in windows. If some one could test it on
> windows that would be great.
> 
> Roshan
> 
> On Mon, 2004-08-02 at 20:23, Roshan Weerasuriya wrote:
> > hi Adrian,
> > 
> > I applied the patch which you submitted. I did a slight change by
> > introducing the IAttribute interface and making some minor changes
> > inorder to avoid static linkage. Thanks for your pathch.
> > 
> > Roshan
> > 
> > On Fri, 2004-06-25 at 15:13, Adrian Dick wrote:
> > > 
> > > 
> > > Hi,
> > > 
> > > On some levels I agree with you, but at a most basic level, a namespace
> > > declaration is an attribute which has special meaning.
> > > Also, when writing this I was taking the simplest approach of just exposing
> > > the functionality already in place - which uses Attributes to create
> > > Namespaces.
> > > 
> > > I understand your comments on the additional parameters, and agree with you
> > > that I should have left out localname and value.
> > > 
> > > I have now adjusted to become:
> > >    Attribute* createNamespaceDecl(const AxisChar *prefix,
> > >        const AxisChar *uri)
> > > 
> > > (See attached file: IHeaderBlock.h.patch)(See attached file:
> > > HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
> > > It would probably also make sense to overload addNamespaceDecl to have the
> > > same parameters.
> > > 
> > > Regards,
> > > Adrian
> > > _______________________________________
> > > Adrian Dick (adrian.dick@uk.ibm.com)
> > > 
> > > 
> > > 
> > >                                                                            
> > >              "Sanjiva                                                      
> > >              Weerawarana"                                                  
> > >              <sanjiva@opensour                                          To 
> > >              ce.lk>                    "Apache AXIS C Developers List"     
> > >                                        <ax...@ws.apache.org>          
> > >              25-06-04 09:30                                             cc 
> > >                                                                            
> > >                                                                    Subject 
> > >              Please respond to         Re: Extensions to API for Handlers  
> > >               "Apache AXIS C                                               
> > >              Developers List"                                              
> > >                                                                            
> > >                                                                            
> > >                                                                            
> > >                                                                            
> > > 
> > > 
> > > 
> > > 
> > > "Adrian Dick" <ad...@uk.ibm.com> writes:
> > > >
> > > >    int addNamespaceDecl(Attribute *pAttribute)
> > > 
> > > IMO this is not the right style .. namespace declarations are not
> > > attributes.
> > > 
> > > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> > > >       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
> > > value);
> > > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> > > >       const AxisChar* prefix, const AxisChar* value)
> > > 
> > > What are all these parameters?? A namespace declaration should
> > > be a tuple: a namespace name (a URI) and a prefix (an NCName). I
> > > don't understand what localname and value mean.
> > > 
> > > Sanjiva.
> > > 
> > 
> > 
> 
> 


Re: Extensions to API for Handlers

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi lahiru,

Thanks for the effort. I commited them.

Roshan

On Wed, 2004-08-04 at 16:41, lahiru@opensource.lk wrote:
> Hi
> 
>   I have tested the Test9 and Test10 on windows with Apache2,expat. And
> tests are working. And also I have created VC projects for the tests.
> Project files are attached.
> 
> Lahiru Wimalasiri
> 
> 
> > hi,
> >
> > The test case for this is available at
> > <CVS_AXISCPP_HOME>/tests/client/soapHeader/test9.
> >
> > I tested this in Linux but not in windows. If some one could test it on
> > windows that would be great.
> >
> > Roshan
> >
> > On Mon, 2004-08-02 at 20:23, Roshan Weerasuriya wrote:
> >> hi Adrian,
> >>
> >> I applied the patch which you submitted. I did a slight change by
> >> introducing the IAttribute interface and making some minor changes
> >> inorder to avoid static linkage. Thanks for your pathch.
> >>
> >> Roshan
> >>
> >> On Fri, 2004-06-25 at 15:13, Adrian Dick wrote:
> >> >
> >> >
> >> > Hi,
> >> >
> >> > On some levels I agree with you, but at a most basic level, a
> >> namespace
> >> > declaration is an attribute which has special meaning.
> >> > Also, when writing this I was taking the simplest approach of just
> >> exposing
> >> > the functionality already in place - which uses Attributes to create
> >> > Namespaces.
> >> >
> >> > I understand your comments on the additional parameters, and agree
> >> with you
> >> > that I should have left out localname and value.
> >> >
> >> > I have now adjusted to become:
> >> >    Attribute* createNamespaceDecl(const AxisChar *prefix,
> >> >        const AxisChar *uri)
> >> >
> >> > (See attached file: IHeaderBlock.h.patch)(See attached file:
> >> > HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
> >> > It would probably also make sense to overload addNamespaceDecl to have
> >> the
> >> > same parameters.
> >> >
> >> > Regards,
> >> > Adrian
> >> > _______________________________________
> >> > Adrian Dick (adrian.dick@uk.ibm.com)
> >> >
> >> >
> >> >
> >> >
> >> >              "Sanjiva
> >> >              Weerawarana"
> >> >              <sanjiva@opensour
> >>  To
> >> >              ce.lk>                    "Apache AXIS C Developers List"
> >> >                                        <ax...@ws.apache.org>
> >> >              25-06-04 09:30
> >>  cc
> >> >
> >> >                                                                    Subject
> >> >              Please respond to         Re: Extensions to API for
> >> Handlers
> >> >               "Apache AXIS C
> >> >              Developers List"
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > "Adrian Dick" <ad...@uk.ibm.com> writes:
> >> > >
> >> > >    int addNamespaceDecl(Attribute *pAttribute)
> >> >
> >> > IMO this is not the right style .. namespace declarations are not
> >> > attributes.
> >> >
> >> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> >> > >       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
> >> > value);
> >> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> >> > >       const AxisChar* prefix, const AxisChar* value)
> >> >
> >> > What are all these parameters?? A namespace declaration should
> >> > be a tuple: a namespace name (a URI) and a prefix (an NCName). I
> >> > don't understand what localname and value mean.
> >> >
> >> > Sanjiva.
> >> >
> >>
> >>
> >
> >
> >


Re: Extensions to API for Handlers

Posted by la...@opensource.lk.
Hi

  I have tested the Test9 and Test10 on windows with Apache2,expat. And
tests are working. And also I have created VC projects for the tests.
Project files are attached.

Lahiru Wimalasiri


> hi,
>
> The test case for this is available at
> <CVS_AXISCPP_HOME>/tests/client/soapHeader/test9.
>
> I tested this in Linux but not in windows. If some one could test it on
> windows that would be great.
>
> Roshan
>
> On Mon, 2004-08-02 at 20:23, Roshan Weerasuriya wrote:
>> hi Adrian,
>>
>> I applied the patch which you submitted. I did a slight change by
>> introducing the IAttribute interface and making some minor changes
>> inorder to avoid static linkage. Thanks for your pathch.
>>
>> Roshan
>>
>> On Fri, 2004-06-25 at 15:13, Adrian Dick wrote:
>> >
>> >
>> > Hi,
>> >
>> > On some levels I agree with you, but at a most basic level, a
>> namespace
>> > declaration is an attribute which has special meaning.
>> > Also, when writing this I was taking the simplest approach of just
>> exposing
>> > the functionality already in place - which uses Attributes to create
>> > Namespaces.
>> >
>> > I understand your comments on the additional parameters, and agree
>> with you
>> > that I should have left out localname and value.
>> >
>> > I have now adjusted to become:
>> >    Attribute* createNamespaceDecl(const AxisChar *prefix,
>> >        const AxisChar *uri)
>> >
>> > (See attached file: IHeaderBlock.h.patch)(See attached file:
>> > HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
>> > It would probably also make sense to overload addNamespaceDecl to have
>> the
>> > same parameters.
>> >
>> > Regards,
>> > Adrian
>> > _______________________________________
>> > Adrian Dick (adrian.dick@uk.ibm.com)
>> >
>> >
>> >
>> >
>> >              "Sanjiva
>> >              Weerawarana"
>> >              <sanjiva@opensour
>>  To
>> >              ce.lk>                    "Apache AXIS C Developers List"
>> >                                        <ax...@ws.apache.org>
>> >              25-06-04 09:30
>>  cc
>> >
>> >                                                                    Subject
>> >              Please respond to         Re: Extensions to API for
>> Handlers
>> >               "Apache AXIS C
>> >              Developers List"
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > "Adrian Dick" <ad...@uk.ibm.com> writes:
>> > >
>> > >    int addNamespaceDecl(Attribute *pAttribute)
>> >
>> > IMO this is not the right style .. namespace declarations are not
>> > attributes.
>> >
>> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
>> > >       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
>> > value);
>> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
>> > >       const AxisChar* prefix, const AxisChar* value)
>> >
>> > What are all these parameters?? A namespace declaration should
>> > be a tuple: a namespace name (a URI) and a prefix (an NCName). I
>> > don't understand what localname and value mean.
>> >
>> > Sanjiva.
>> >
>>
>>
>
>
>

Re: Extensions to API for Handlers

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi,

The test case for this is available at
<CVS_AXISCPP_HOME>/tests/client/soapHeader/test9.

I tested this in Linux but not in windows. If some one could test it on
windows that would be great.

Roshan

On Mon, 2004-08-02 at 20:23, Roshan Weerasuriya wrote:
> hi Adrian,
> 
> I applied the patch which you submitted. I did a slight change by
> introducing the IAttribute interface and making some minor changes
> inorder to avoid static linkage. Thanks for your pathch.
> 
> Roshan
> 
> On Fri, 2004-06-25 at 15:13, Adrian Dick wrote:
> > 
> > 
> > Hi,
> > 
> > On some levels I agree with you, but at a most basic level, a namespace
> > declaration is an attribute which has special meaning.
> > Also, when writing this I was taking the simplest approach of just exposing
> > the functionality already in place - which uses Attributes to create
> > Namespaces.
> > 
> > I understand your comments on the additional parameters, and agree with you
> > that I should have left out localname and value.
> > 
> > I have now adjusted to become:
> >    Attribute* createNamespaceDecl(const AxisChar *prefix,
> >        const AxisChar *uri)
> > 
> > (See attached file: IHeaderBlock.h.patch)(See attached file:
> > HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
> > It would probably also make sense to overload addNamespaceDecl to have the
> > same parameters.
> > 
> > Regards,
> > Adrian
> > _______________________________________
> > Adrian Dick (adrian.dick@uk.ibm.com)
> > 
> > 
> > 
> >                                                                            
> >              "Sanjiva                                                      
> >              Weerawarana"                                                  
> >              <sanjiva@opensour                                          To 
> >              ce.lk>                    "Apache AXIS C Developers List"     
> >                                        <ax...@ws.apache.org>          
> >              25-06-04 09:30                                             cc 
> >                                                                            
> >                                                                    Subject 
> >              Please respond to         Re: Extensions to API for Handlers  
> >               "Apache AXIS C                                               
> >              Developers List"                                              
> >                                                                            
> >                                                                            
> >                                                                            
> >                                                                            
> > 
> > 
> > 
> > 
> > "Adrian Dick" <ad...@uk.ibm.com> writes:
> > >
> > >    int addNamespaceDecl(Attribute *pAttribute)
> > 
> > IMO this is not the right style .. namespace declarations are not
> > attributes.
> > 
> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> > >       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
> > value);
> > >    Attribute* createNamespaceDecl(const AxisChar* localname,
> > >       const AxisChar* prefix, const AxisChar* value)
> > 
> > What are all these parameters?? A namespace declaration should
> > be a tuple: a namespace name (a URI) and a prefix (an NCName). I
> > don't understand what localname and value mean.
> > 
> > Sanjiva.
> > 
> 
> 


Re: Extensions to API for Handlers

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi Adrian,

I applied the patch which you submitted. I did a slight change by
introducing the IAttribute interface and making some minor changes
inorder to avoid static linkage. Thanks for your pathch.

Roshan

On Fri, 2004-06-25 at 15:13, Adrian Dick wrote:
> 
> 
> Hi,
> 
> On some levels I agree with you, but at a most basic level, a namespace
> declaration is an attribute which has special meaning.
> Also, when writing this I was taking the simplest approach of just exposing
> the functionality already in place - which uses Attributes to create
> Namespaces.
> 
> I understand your comments on the additional parameters, and agree with you
> that I should have left out localname and value.
> 
> I have now adjusted to become:
>    Attribute* createNamespaceDecl(const AxisChar *prefix,
>        const AxisChar *uri)
> 
> (See attached file: IHeaderBlock.h.patch)(See attached file:
> HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
> It would probably also make sense to overload addNamespaceDecl to have the
> same parameters.
> 
> Regards,
> Adrian
> _______________________________________
> Adrian Dick (adrian.dick@uk.ibm.com)
> 
> 
> 
>                                                                            
>              "Sanjiva                                                      
>              Weerawarana"                                                  
>              <sanjiva@opensour                                          To 
>              ce.lk>                    "Apache AXIS C Developers List"     
>                                        <ax...@ws.apache.org>          
>              25-06-04 09:30                                             cc 
>                                                                            
>                                                                    Subject 
>              Please respond to         Re: Extensions to API for Handlers  
>               "Apache AXIS C                                               
>              Developers List"                                              
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> "Adrian Dick" <ad...@uk.ibm.com> writes:
> >
> >    int addNamespaceDecl(Attribute *pAttribute)
> 
> IMO this is not the right style .. namespace declarations are not
> attributes.
> 
> >    Attribute* createNamespaceDecl(const AxisChar* localname,
> >       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
> value);
> >    Attribute* createNamespaceDecl(const AxisChar* localname,
> >       const AxisChar* prefix, const AxisChar* value)
> 
> What are all these parameters?? A namespace declaration should
> be a tuple: a namespace name (a URI) and a prefix (an NCName). I
> don't understand what localname and value mean.
> 
> Sanjiva.
> 


Re: Extensions to API for Handlers

Posted by Adrian Dick <ad...@uk.ibm.com>.



Hi,

On some levels I agree with you, but at a most basic level, a namespace
declaration is an attribute which has special meaning.
Also, when writing this I was taking the simplest approach of just exposing
the functionality already in place - which uses Attributes to create
Namespaces.

I understand your comments on the additional parameters, and agree with you
that I should have left out localname and value.

I have now adjusted to become:
   Attribute* createNamespaceDecl(const AxisChar *prefix,
       const AxisChar *uri)

(See attached file: IHeaderBlock.h.patch)(See attached file:
HeaderBlock.h.patch)(See attached file: HeaderBlock.cpp.patch)
It would probably also make sense to overload addNamespaceDecl to have the
same parameters.

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)



                                                                           
             "Sanjiva                                                      
             Weerawarana"                                                  
             <sanjiva@opensour                                          To 
             ce.lk>                    "Apache AXIS C Developers List"     
                                       <ax...@ws.apache.org>          
             25-06-04 09:30                                             cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: Extensions to API for Handlers  
              "Apache AXIS C                                               
             Developers List"                                              
                                                                           
                                                                           
                                                                           
                                                                           




"Adrian Dick" <ad...@uk.ibm.com> writes:
>
>    int addNamespaceDecl(Attribute *pAttribute)

IMO this is not the right style .. namespace declarations are not
attributes.

>    Attribute* createNamespaceDecl(const AxisChar* localname,
>       const AxisChar* prefix, const AxisChar* uri, const AxisChar*
value);
>    Attribute* createNamespaceDecl(const AxisChar* localname,
>       const AxisChar* prefix, const AxisChar* value)

What are all these parameters?? A namespace declaration should
be a tuple: a namespace name (a URI) and a prefix (an NCName). I
don't understand what localname and value mean.

Sanjiva.


Re: Extensions to API for Handlers

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
"Adrian Dick" <ad...@uk.ibm.com> writes:
>
>    int addNamespaceDecl(Attribute *pAttribute)

IMO this is not the right style .. namespace declarations are not
attributes.

>    Attribute* createNamespaceDecl(const AxisChar* localname,
>       const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
>    Attribute* createNamespaceDecl(const AxisChar* localname,
>       const AxisChar* prefix, const AxisChar* value)

What are all these parameters?? A namespace declaration should
be a tuple: a namespace name (a URI) and a prefix (an NCName). I
don't understand what localname and value mean.

Sanjiva.