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 Thu, 13 Jan 2005 07:11:21 GMT
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