axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McCullough, Ryan" <rmccullo...@rightnow.com>
Subject RE: No answers?
Date Thu, 22 May 2008 20:21:32 GMT
*** In SoapDeSerializer.h, around line 157, after 'IHeaderBlock*
getHeaderBlock(const AxisChar* pName, const AxisChar* pNamespace);'
    IHeaderBlock* getHeaderBlock(const AxisChar* pName, 
        const AxisChar* pNamespace, bool bRemoveOrNot);

*** In SoapDeSerializer.cpp, Change 'SoapDeSerializer::getHeaderBlock (const
AxisChar * pName, const AxisChar * pNamespace)' to:
/*
 * Header block parsing should be done differently for different SOAP
versions.
 * Since the Header blocks may be requested in a different order than it is
in 
 * the SOAP stream there must be a mechanism to manage the situation.
Possibly 
 * to re-parse the stream part which has unused header blocks.
 */

IHeaderBlock *
SoapDeSerializer::getHeaderBlock (const AxisChar * pName,
				  const AxisChar * pNamespace)
{
	#ifdef ENABLE_AXISTRACE
		if (axiscpp::AxisTrace::isTraceOn())
			axiscpp::AxisTrace::traceEntry("SoapDeSerializer",
"getHeaderBlock", this, 2,
					TRACETYPE_STRING, 0,
((void*)&pName),
					TRACETYPE_STRING, 0,
((void*)&pNamespace));	  /* AUTOINSERTED TRACE */
	#endif
	#ifdef ENABLE_AXISTRACE
		IHeaderBlock* traceRet = (getHeaderBlock (pName, pNamespace,
true));
		if (axiscpp::AxisTrace::isTraceOn())
			axiscpp::AxisTrace::traceExit("SoapDeSerializer",
"getHeaderBlock", this, 2,
				TRACETYPE_POINTER, sizeof(IHeaderBlock),
((void*)&traceRet));	  /* AUTOINSERTED TRACE */
		return traceRet;
	#else
		return getHeaderBlock (pName, pNamespace, true);
	#endif
}

/*
 * Header block parsing should be done differently for different SOAP
versions.
 * Since the Header blocks may be requested in a different order than it is
in 
 * the SOAP stream there must be a mechanism to manage the situation.
Possibly 
 * to re-parse the stream part which has unused header blocks.
 */

IHeaderBlock *
SoapDeSerializer::getHeaderBlock (const AxisChar * pName,
				  const AxisChar * pNamespace, bool
bRemoveOrNot)
{
	#ifdef ENABLE_AXISTRACE
		if (axiscpp::AxisTrace::isTraceOn())
			axiscpp::AxisTrace::traceEntry("SoapDeSerializer",
"getHeaderBlock", this, 2,
					TRACETYPE_STRING, 0,
((void*)&pName),
					TRACETYPE_STRING, 0,
((void*)&pNamespace),
					TRACETYPE_BOOL,   0,
((void*)bRemoveOrNot));	  /* AUTOINSERTED TRACE */
	#endif

    if (!m_pHeader)
    {
		{
		#ifdef ENABLE_AXISTRACE
			IHeaderBlock* traceRet = (NULL);
			if (axiscpp::AxisTrace::isTraceOn())
	
axiscpp::AxisTrace::traceExit("SoapDeSerializer", "getHeaderBlock", this, 1,
					TRACETYPE_POINTER,
sizeof(IHeaderBlock), ((void*)&traceRet));	  /* AUTOINSERTED TRACE */
			return traceRet;
		#else
			return NULL;
		#endif
	}
		/* there has been no <Header> element so there
				 * can be no Header blocks */
    }
    	{
		#ifdef ENABLE_AXISTRACE
			IHeaderBlock* traceRet = (m_pHeader->getHeaderBlock
(pName, pNamespace, bRemoveOrNot));
			if (axiscpp::AxisTrace::isTraceOn())
	
axiscpp::AxisTrace::traceExit("SoapDeSerializer", "getHeaderBlock", this, 2,
					TRACETYPE_POINTER,
sizeof(IHeaderBlock), ((void*)&traceRet));	  /* AUTOINSERTED TRACE */
			return traceRet;
		#else
			return m_pHeader->getHeaderBlock (pName, pNamespace,
bRemoveOrNot);
		#endif
	}

}

*** In Call.hpp, around line 402, add:
    /**
     * Returns the DeSerialized response header.
     */
    IHeaderBlock* getDeSerHeaderBlock(const AxisChar * pName, const AxisChar
* pNamespace);

*** In Call.cpp, around line 3376, add:
IHeaderBlock* Call::getDeSerHeaderBlock(const AxisChar * pName, const
AxisChar * pNamespace)
{
    if (m_pIWSDZ != NULL) {
        return m_pIWSDZ->getHeaderBlock(pName, pNamespace, false);
    } else {
        return NULL;
    }
}

I have also attached the files. If there is a better way to get the response
soap header (it appears the header in the Call class is always the request
header), or if my code is ugly (which it is, and I am missing the trace in
Call::getDeSerHeaderBlock()), I would appreciate feedback.

I am going to now get the SVN code and merge it with my tree.

-Ryan

-----Original Message-----
From: Nadir Amra [mailto:amra@us.ibm.com] 
Sent: Thursday, May 22, 2008 2:07 PM
To: Apache AXIS C User List
Cc: Apache AXIS C User List
Subject: RE: No answers?

Ryan,

minOccurs="0" and nillable-"true" are both handled as pointers. 

As far as response headers, I will have to do some investigation because I 
do not know the answer off hand.  However, just in case I would need to 
implement, we would be interested in the code that you added to 
SoapDeSerializer.cpp and Call.cpp.

Nadir Amra


"McCullough, Ryan" <rmccullough@rightnow.com> wrote on 05/22/2008 01:54:15 
PM:

> As an update, I think I found answers to both questions.
> 
> It looks like elements with minOccurs of 0 (nullable elements) are 
pointers.
> 
> I exposed the response headers by adding some code to 
SoapDeSerializer.cpp
> and Call.cpp. Is there a better way?
> 
> -Ryan
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Mime
View raw message