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: IHandlerSoapSerializer->getHeaderBlock()
Date Mon, 17 Jan 2005 09:19:36 GMT
hi Andrew,

>As can be seen a call to getHeaderBlock(name, namespace) returns the
> correct header block, but a call the getCurrentHeaderBlock() does not
> return the same block just returned.
Do you think that we need this functionality? If so we can work on it. 
Or if it is OK, we can just update the API commnts as you say.

Which of those two do you prefer to have?

Roshan

On Fri, 2005-01-14 at 20:18, Andrew Perry2 wrote:
> 
> 
> Roshan,
> 
> Thanks for creating the new getCurrentHeaderBlock() method as it makes
> things clearer.
> 
> The getHeaderBlock(name, namespace) method does not seem to reposition the
> HeaderBlock iterator and it is not clear from the API documentation what
> the correct outcome should be.
> 
> The output of my test is:
> 
> getFirstHeaderBlock()               - hb1:child(1) - Value = Test1
> getNextHeaderBlock()                - hb2:child(1) - Value = Test2
> getNextHeaderBlock()                - hb3:child(1) - Value = Test3
> getNextHeaderBlock()                - HeaderBlock is NULL
> getHeaderBlock("hb2", namespace)    - hb2:child(1) - Value = Test2
> getCurrentHeaderBlock()       - HeaderBlock is NULL
> getHeaderBlock("hb3", namespace)    - hb3:child(1) - Value = Test3
> getHeaderBlock("hb1", namespace)    - hb1:child(1) - Value = Test1
> getFirstHeaderBlock()               - hb1:child(1) - Value = Test1
> getNextHeaderBlock()                - hb2:child(1) - Value = Test2
> getCurrentHeaderBlock()       - hb2:child(1) - Value = Test2
> 
> As can be seen a call to getHeaderBlock(name, namespace) returns the
> correct header block, but a call the getCurrentHeaderBlock() does not
> return the same block just returned. This may be completely valid but the
> API docs should be updated to say that the HeaderBlock iterator is not
> effected by this call.
> 
> Regards,
> 
> Andrew Perry
> IBM Web Services Client for C/C++
> perryan@uk.ibm.com
> Mail Point 127
> IBM UK Laboratories. Hursley Park, Winchester, Hants. SO21 2JN
> Tel. Internal 249828  External + 44 (0)1962 819828
> Fax. + 44(0)1962 818080
> 
> Roshan Weerasuriya <roshan@opensource.lk> wrote on 13/01/2005 09:39:15:
> 
> > hi Andrew,
> >
> > > 2) If getFirstHeaderBlock() has been called and any number of
> > > > getNextHeaderBlock() calls have been made, getHeaderBlock() always
> returns
> > > > the first header block, but doesn't reposition in the list like
> > > > getFirstHeaderBlock() does. So what's the point of
> > getHeaderBlock()? Can it
> > > > be removed?
> >
> > Ok, I added a new method called "getCurrentHeaderBlock()". Also I
> > commented the method "getHeaderBlock()", and put a comment stating that
> > this method has to be removed. When I checkd I found that
> > "IHandlerSoapSerializer->getHeaderBlock()" is not used any where in the
> > code.
> >
> > Roshan
> >
> > On Thu, 2005-01-13 at 13:11, Roshan Weerasuriya wrote:
> > > hi Andrew,
> > >
> > > 1) If it is called before getFirstHeaderBlock() is called the
> > > > handler/client just crashes without an exception (SIGSEGV). Should
> just
> > > > return NULL.
> > >
> > > I tested this in both linux and window just before writing this mail.
> > > And it works fine. It just returns NULL. The following the code in my
> > > client handler.
> > >
> > > //-----code in my invoke method of the client handler
> > > ..
> > > ....
> > >  } else {
> > >                 /*this is a request*/
> > >
> 
> > >                 IHandlerSoapSerializer* pISZ;
> > >                 pIMsg->getSoapSerializer(&pISZ);
> > >
> 
> > >                 //---added on 13Jan2005
> > >                 IHeaderBlock* pIHB = pISZ->getHeaderBlock();
> > >                 //----end added
> > >
> 
> > >                 IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
> > >
> 
> > >                 pIHeaderBlock->setLocalName("echoMeString");
> > >
> > > pIHeaderBlock->setUri("http://soapinterop.org/echoheader/");
> > >
> 
> > >                 string tmp;
> > >
> 
> > >                 if (pIHB == NULL) {
> > >                         tmp = "is null";
> > >                 } else {
> > >                         tmp = "is not null";
> > >                 }
> > >
> 
> > >                 const AxisChar* pachHeaderVal = tmp.c_str();
> > >
> 
> > >                 BasicNode* pBasicNode =
> > > pIHeaderBlock->createChild(CHARACTER_NODE);
> > >                 pBasicNode->setValue(pachHeaderVal);
> > >
> 
> > >                 pIHeaderBlock->addChild(pBasicNode);
> > >       .....
> > >       .......
> > > //-----end of code in my invoke method of the client handler
> > >
> > > It gives me the folloiwng out put
> > >
> > > <?xml version='1.0' encoding='utf-8' ?>
> > > <SOAP-ENV:Envelope
> > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > > <SOAP-ENV:Header><ns2:echoMeString
> > > xmlns:ns2="http://soapinterop.org/echoheader/">is
> > > null</ns2:echoMeString></SOAP-ENV:Header>
> > > ...
> > > .....
> > >
> > > So it returns NULL and works fine for me. It doesn't crash both windows
> > > and linux.
> > >
> > > Roshan
> > >
> > > On Wed, 2005-01-12 at 22:14, Andrew Perry2 wrote:
> > > >
> > > >
> > > > I'm writing function tests for all the handler and related APIs and
> was
> > > > wondering what the IHandlerSoapSerializer->getHeaderBlock() API
> > is meant to
> > > > do. This is the method with no parameters.
> > > >
> > > > 2 problems.
> > > >
> > > > 1) If it is called before getFirstHeaderBlock() is called the
> > > > handler/client just crashes without an exception (SIGSEGV). Should
> just
> > > > return NULL.
> > > >
> > > > 2) If getFirstHeaderBlock() has been called and any number of
> > > > getNextHeaderBlock() calls have been made, getHeaderBlock() always
> returns
> > > > the first header block, but doesn't reposition in the list like
> > > > getFirstHeaderBlock() does. So what's the point of
> > getHeaderBlock()? Can it
> > > > be removed?
> > > >
> > > > If there is a point to keeping it then I'll raise a jira about
> problem 1.
> > > >
> > > > Comments please.
> > > >
> > > > Regards,
> > > >
> > > > Andrew Perry
> > > > IBM C/C++ Web Services Client
> > > > perryan@uk.ibm.com
> > > > Mail Point 127
> > > > IBM UK Laboratories. Hursley Park, Winchester, Hants. SO21 2JN
> > > > Tel. Internal 249828  External + 44 (0)1962 819828
> > > > Fax. + 44(0)1962 818080
> > > >
> > > >
> > >
> > >
> >
> 
> 


Mime
View raw message