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 Samisa Abeysinghe <sa...@yahoo.com> on 2004/04/20 12:22:29 UTC

Setting HTTP headers from C++ stubs

Hi All,
    I tried to set HTTP headers from the C++ stub and fond that it is not supported in current
Axis C++.
    Hence I tried to write a stub to set HTTP headers from the stub. I used the interop base
sample.
    
    I crated a new class called ServiceStub and inherited InteropTestPortType class from this (by
the  way, can we change InteropTestPortType classname to a more meaningful name)
    I think it is good to have a base class for the stubs (as in Axis Java). One can use the
ServiceStub class that I have written as the base class. This makes life easier when it comes to
extending stub functionality.

    Also When I wanted to set the HTTP headers, I found that the existing API does not have a
mechanism to do so. Hence I added a setHTTPHeader methods to both Call and AxisTransport classes.
( I made the assumtion that the transport is always HTTP, which is reasonable for current Axis C++
codebase, However need to change this to support new transports)

    I have attached my code here. And I think it is very important to allow flexibility on client
side and the consept of inheriting stub from a base class like ServiceStub is very important.

    Also I tried to adhere to the suggested coding convention when I was writing ServiceStub
class.  
    I tested this code with both C++ and Java Axis servers and it worked.
    Only setHTTPHeaders work for the moment. The other methods such as setEndPointUrl could 

    Please add this concept to Axis C++. 

    Also we could build on this to achieve setting various properties from client stub.

Thanks,
Samisa...
 


	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash

Re: Setting HTTP headers from C++ stubs

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Something like setHTTPHeader belongs in the HTTPTransport class. I thought
we had a transport abstraction in place .. maybe I'm confusing with
Axis/Java?

Sanjiva.

----- Original Message ----- 
From: "John Hawkins" <HA...@uk.ibm.com>
To: "Apache AXIS C Developers List" <ax...@ws.apache.org>
Sent: Tuesday, April 20, 2004 10:12 PM
Subject: Re: Setting HTTP headers from C++ stubs





Hi Samisa,

My perspective was from the OO side. Having a thing called set HTTPHeader
on a generic Call interface doesn't sound right to me.

However, I see that having as much commonality as possible with Java would
be good. Can we point to other areas in the code where we have simalarity
to justify this approach?




John Hawkins,

Tel:
Internal:  (7) 24-7131
External: (+44 ) (0) 1962 817131

Mailpoint 188,
IBM UK,
Hursley Park,
Winchester,
UK.
SO21 2JN



             Samisa Abeysinghe
             <samisa_abeysingh
             e@yahoo.com>                                               To
                                       Apache AXIS C Developers List
             20/04/2004 15:12          <ax...@ws.apache.org>
                                                                        cc

             Please respond to                                     Subject
              "Apache AXIS C           Re: Setting HTTP headers from C++
             Developers List"          stubs










If you look at Java, it uses direct simple API calls for simple things as
setHTTPHeader. I think if we are to use handlers it would make a simple
tasks such as set HTTP heders more difficult. Also users will have the
extra burden of setting up handlers even for simple tasks.

But for setting custom SOAP headers, Handlers would be a good idea.

Therefor I think we have to draw a line and define what are to be supported
with handlers and what are not to be supported by handlers.

For setHTTPHeader I would still preffer the way that I have suggested,
rhather than handlers.
But for complex SOAP headers such as security related ones, lets use
handlers.

Thanks,
Samisa...



damitha@opensource.lk wrote:
 Hi,
 +1. This should be the way I think

 damitha

 > Good short-term answer Samisa - how about we move to a handler model on
 > the
 > client side to enable Transport handlers to be registered which could do
 > this in a more generic way? I believe there is a model for this already
 in
 > Java Axis? But I'm not familiar with it yet.
 >
 >
 >
 >
 > John Hawkins,
 >
 > Tel:
 > Internal: (7) 24-7131
 > External: (+44 ) (0) 1962 817131
 >
 > Mailpoint 188,
 > IBM UK,
 > Hursley Park,
 > Winchester,
 > UK.
 > SO21 2JN
 >
 >
 >
 > Samisa Abeysinghe
 > > e@yahoo.com> To
 > Apache AXIS C Developers List
 > 20/04/2004 11:22
 > cc
 >
 > Please respond to Subject
 > ! "Apache AXIS C Setting HTTP headers from C++ stubs
 > Developers List"
 >
 >
 >
 >
 >
 >
 >
 >
 >
 > Hi All,
 > I tried to set HTTP headers from the C++ stub and fond that it is not
 > supported in current
 > Axis C++.
 > Hence I tried to write a stub to set HTTP headers from the stub. I
 > used
 > the interop base
 > sample.
 >
 > I crated a new class called ServiceStub and inherited
 > InteropTestPortType class from this (by
 > the way, can we change InteropTestPortType classname to a more
 meaningful
 > name)
 > I think it is good to have a base class for the stubs (as in Axis
 > Java). One can use the
 > ServiceStub class that I have written as the base class. This makes life
 > easier when it comes to
 > extending stub functionality.
 >
 > Also When I wanted to set the HTTP headers, I found that the existing
 > API does not h! ave a
 > mechanism to do so. Hence I added a setHTTPHeader methods to both Call
 and
 > AxisTransport classes.
 > ( I made the assumtion that the transport is always HTTP, which is
 > reasonable for current Axis C++
 > codebase, However need to change this to support new transports)
 >
 > I have attached my code here. And I think it is very important to
 > allow
 > flexibility on client
 > side and the consept of inheriting stub from a base class like
 ServiceStub
 > is very important.
 >
 > Also I tried to adhere to the suggested coding convention when I was
 > writing ServiceStub
 > class.
 > I tested this code with both C++ and Java Axis servers and it worked.
 > Only setHTTPHeaders work for the moment. The other methods such as
 > setEndPointUrl could
 >
 > Please add this concept to Axis C++.
 >
 > Also we could build on this to achieve setting various properties fro! m
 > client stub.
 >
 > Thanks,
 > Samisa...
 >
 >
 >
 >
 >
 > __________________________________
 > Do you Yahoo!?
 > Yahoo! Photos: High-quality 4x6 digital prints for 25¢
 > http://photos.yahoo.com/ph/print_splash(See attached file: base.tar.gz)


Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢





Re: Setting HTTP headers from C++ stubs

Posted by John Hawkins <HA...@uk.ibm.com>.



Hi Samisa,

My perspective was from the OO side. Having a thing called set HTTPHeader
on a generic Call interface doesn't sound right to me.

However, I see that having as much commonality as possible with Java would
be good. Can we point to other areas in the code where we have simalarity
to justify this approach?




John Hawkins,

Tel:
Internal:  (7) 24-7131
External: (+44 ) (0) 1962 817131

Mailpoint 188,
IBM UK,
Hursley Park,
Winchester,
UK.
SO21 2JN


                                                                           
             Samisa Abeysinghe                                             
             <samisa_abeysingh                                             
             e@yahoo.com>                                               To 
                                       Apache AXIS C Developers List       
             20/04/2004 15:12          <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           Re: Setting HTTP headers from C++   
             Developers List"          stubs                               
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




If you look at Java, it uses direct simple API calls for simple things as
setHTTPHeader. I think if we are to use handlers it would make a simple
tasks such as set HTTP heders more difficult. Also users will have the
extra burden of setting up handlers even for simple tasks.

But for setting custom SOAP headers, Handlers would be a good idea.

Therefor I think we have to draw a line and define what are to be supported
with handlers and what are not to be supported by handlers.

For setHTTPHeader I would still preffer the way that I have suggested,
rhather than handlers.
But for complex SOAP headers such as security related ones, lets use
handlers.

Thanks,
Samisa...



damitha@opensource.lk wrote:
 Hi,
 +1. This should be the way I think

 damitha

 > Good short-term answer Samisa - how about we move to a handler model on
 > the
 > client side to enable Transport handlers to be registered which could do
 > this in a more generic way? I believe there is a model for this already
 in
 > Java Axis? But I'm not familiar with it yet.
 >
 >
 >
 >
 > John Hawkins,
 >
 > Tel:
 > Internal: (7) 24-7131
 > External: (+44 ) (0) 1962 817131
 >
 > Mailpoint 188,
 > IBM UK,
 > Hursley Park,
 > Winchester,
 > UK.
 > SO21 2JN
 >
 >
 >
 > Samisa Abeysinghe
 > > e@yahoo.com> To
 > Apache AXIS C Developers List
 > 20/04/2004 11:22
 > cc
 >
 > Please respond to Subject
 > ! "Apache AXIS C Setting HTTP headers from C++ stubs
 > Developers List"
 >
 >
 >
 >
 >
 >
 >
 >
 >
 > Hi All,
 > I tried to set HTTP headers from the C++ stub and fond that it is not
 > supported in current
 > Axis C++.
 > Hence I tried to write a stub to set HTTP headers from the stub. I
 > used
 > the interop base
 > sample.
 >
 > I crated a new class called ServiceStub and inherited
 > InteropTestPortType class from this (by
 > the way, can we change InteropTestPortType classname to a more
 meaningful
 > name)
 > I think it is good to have a base class for the stubs (as in Axis
 > Java). One can use the
 > ServiceStub class that I have written as the base class. This makes life
 > easier when it comes to
 > extending stub functionality.
 >
 > Also When I wanted to set the HTTP headers, I found that the existing
 > API does not h! ave a
 > mechanism to do so. Hence I added a setHTTPHeader methods to both Call
 and
 > AxisTransport classes.
 > ( I made the assumtion that the transport is always HTTP, which is
 > reasonable for current Axis C++
 > codebase, However need to change this to support new transports)
 >
 > I have attached my code here. And I think it is very important to
 > allow
 > flexibility on client
 > side and the consept of inheriting stub from a base class like
 ServiceStub
 > is very important.
 >
 > Also I tried to adhere to the suggested coding convention when I was
 > writing ServiceStub
 > class.
 > I tested this code with both C++ and Java Axis servers and it worked.
 > Only setHTTPHeaders work for the moment. The other methods such as
 > setEndPointUrl could
 >
 > Please add this concept to Axis C++.
 >
 > Also we could build on this to achieve setting various properties fro! m
 > client stub.
 >
 > Thanks,
 > Samisa...
 >
 >
 >
 >
 >
 > __________________________________
 > Do you Yahoo!?
 > Yahoo! Photos: High-quality 4x6 digital prints for 25¢
 > http://photos.yahoo.com/ph/print_splash(See attached file: base.tar.gz)


Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢




Re: Setting HTTP headers from C++ stubs

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
If you look at Java, it uses direct simple API calls for simple things as setHTTPHeader. I think if we are to use handlers it would make a simple tasks such as set HTTP heders more difficult. Also users will have the extra burden of setting up handlers even for simple tasks.
 
But for setting custom SOAP headers, Handlers would be a good idea.
 
Therefor I think we have to draw a line and define what are to be supported with handlers and what are not to be supported by handlers.
 
For setHTTPHeader I would still preffer the way that I have suggested, rhather than handlers.
But for complex SOAP headers such as security related ones, lets use handlers.
 
Thanks,
Samisa...
 


damitha@opensource.lk wrote:
Hi,
+1. This should be the way I think

damitha

> Good short-term answer Samisa - how about we move to a handler model on
> the
> client side to enable Transport handlers to be registered which could do
> this in a more generic way? I believe there is a model for this already in
> Java Axis? But I'm not familiar with it yet.
>
>
>
>
> John Hawkins,
>
> Tel:
> Internal: (7) 24-7131
> External: (+44 ) (0) 1962 817131
>
> Mailpoint 188,
> IBM UK,
> Hursley Park,
> Winchester,
> UK.
> SO21 2JN
>
>
>
> Samisa Abeysinghe
> > e@yahoo.com> To
> Apache AXIS C Developers List
> 20/04/2004 11:22 
> cc
>
> Please respond to Subject
> "Apache AXIS C Setting HTTP headers from C++ stubs
> Developers List"
>
>
>
>
>
>
>
>
>
> Hi All,
> I tried to set HTTP headers from the C++ stub and fond that it is not
> supported in current
> Axis C++.
> Hence I tried to write a stub to set HTTP headers from the stub. I
> used
> the interop base
> sample.
>
> I crated a new class called ServiceStub and inherited
> InteropTestPortType class from this (by
> the way, can we change InteropTestPortType classname to a more meaningful
> name)
> I think it is good to have a base class for the stubs (as in Axis
> Java). One can use the
> ServiceStub class that I have written as the base class. This makes life
> easier when it comes to
> extending stub functionality.
>
> Also When I wanted to set the HTTP headers, I found that the existing
> API does not have a
> mechanism to do so. Hence I added a setHTTPHeader methods to both Call and
> AxisTransport classes.
> ( I made the assumtion that the transport is always HTTP, which is
> reasonable for current Axis C++
> codebase, However need to change this to support new transports)
>
> I have attached my code here. And I think it is very important to
> allow
> flexibility on client
> side and the consept of inheriting stub from a base class like ServiceStub
> is very important.
>
> Also I tried to adhere to the suggested coding convention when I was
> writing ServiceStub
> class.
> I tested this code with both C++ and Java Axis servers and it worked.
> Only setHTTPHeaders work for the moment. The other methods such as
> setEndPointUrl could
>
> Please add this concept to Axis C++.
>
> Also we could build on this to achieve setting various properties from
> client stub.
>
> Thanks,
> Samisa...
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25�
> http://photos.yahoo.com/ph/print_splash(See attached file: base.tar.gz)

		
---------------------------------
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�

Re: Setting HTTP headers from C++ stubs

Posted by da...@opensource.lk.
Hi,
 +1. This should be the way I think

damitha

> Good short-term answer Samisa - how about we move to a handler model on
> the
> client side to enable Transport handlers to be registered which could do
> this in a more generic way? I believe there is a model for this already in
> Java Axis? But I'm not familiar with it yet.
>
>
>
>
> John Hawkins,
>
> Tel:
> Internal:  (7) 24-7131
> External: (+44 ) (0) 1962 817131
>
> Mailpoint 188,
> IBM UK,
> Hursley Park,
> Winchester,
> UK.
> SO21 2JN
>
>
>
>              Samisa Abeysinghe
>              <samisa_abeysingh
>              e@yahoo.com>                                               To
>                                        Apache AXIS C Developers List
>              20/04/2004 11:22          <ax...@ws.apache.org>
>                                                                         cc
>
>              Please respond to                                     Subject
>               "Apache AXIS C           Setting HTTP headers from C++ stubs
>              Developers List"
>
>
>
>
>
>
>
>
>
> Hi All,
>     I tried to set HTTP headers from the C++ stub and fond that it is not
> supported in current
> Axis C++.
>     Hence I tried to write a stub to set HTTP headers from the stub. I
> used
> the interop base
> sample.
>
>     I crated a new class called ServiceStub and inherited
> InteropTestPortType class from this (by
> the  way, can we change InteropTestPortType classname to a more meaningful
> name)
>     I think it is good to have a base class for the stubs (as in Axis
> Java). One can use the
> ServiceStub class that I have written as the base class. This makes life
> easier when it comes to
> extending stub functionality.
>
>     Also When I wanted to set the HTTP headers, I found that the existing
> API does not have a
> mechanism to do so. Hence I added a setHTTPHeader methods to both Call and
> AxisTransport classes.
> ( I made the assumtion that the transport is always HTTP, which is
> reasonable for current Axis C++
> codebase, However need to change this to support new transports)
>
>     I have attached my code here. And I think it is very important to
> allow
> flexibility on client
> side and the consept of inheriting stub from a base class like ServiceStub
> is very important.
>
>     Also I tried to adhere to the suggested coding convention when I was
> writing ServiceStub
> class.
>     I tested this code with both C++ and Java Axis servers and it worked.
>     Only setHTTPHeaders work for the moment. The other methods such as
> setEndPointUrl could
>
>     Please add this concept to Axis C++.
>
>     Also we could build on this to achieve setting various properties from
> client stub.
>
> Thanks,
> Samisa...
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash(See attached file: base.tar.gz)


Re: Setting HTTP headers from C++ stubs

Posted by John Hawkins <HA...@uk.ibm.com>.




Good short-term answer Samisa - how about we move to a handler model on the
client side to enable Transport handlers to be registered which could do
this in a more generic way? I believe there is a model for this already in
Java Axis? But I'm not familiar with it yet.




John Hawkins,

Tel:
Internal:  (7) 24-7131
External: (+44 ) (0) 1962 817131

Mailpoint 188,
IBM UK,
Hursley Park,
Winchester,
UK.
SO21 2JN


                                                                           
             Samisa Abeysinghe                                             
             <samisa_abeysingh                                             
             e@yahoo.com>                                               To 
                                       Apache AXIS C Developers List       
             20/04/2004 11:22          <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           Setting HTTP headers from C++ stubs 
             Developers List"                                              
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi All,
    I tried to set HTTP headers from the C++ stub and fond that it is not
supported in current
Axis C++.
    Hence I tried to write a stub to set HTTP headers from the stub. I used
the interop base
sample.

    I crated a new class called ServiceStub and inherited
InteropTestPortType class from this (by
the  way, can we change InteropTestPortType classname to a more meaningful
name)
    I think it is good to have a base class for the stubs (as in Axis
Java). One can use the
ServiceStub class that I have written as the base class. This makes life
easier when it comes to
extending stub functionality.

    Also When I wanted to set the HTTP headers, I found that the existing
API does not have a
mechanism to do so. Hence I added a setHTTPHeader methods to both Call and
AxisTransport classes.
( I made the assumtion that the transport is always HTTP, which is
reasonable for current Axis C++
codebase, However need to change this to support new transports)

    I have attached my code here. And I think it is very important to allow
flexibility on client
side and the consept of inheriting stub from a base class like ServiceStub
is very important.

    Also I tried to adhere to the suggested coding convention when I was
writing ServiceStub
class.
    I tested this code with both C++ and Java Axis servers and it worked.
    Only setHTTPHeaders work for the moment. The other methods such as
setEndPointUrl could

    Please add this concept to Axis C++.

    Also we could build on this to achieve setting various properties from
client stub.

Thanks,
Samisa...





__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash(See attached file: base.tar.gz)