You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/03/07 18:54:36 UTC
svn commit: r383942 [2/3] - in /webservices/axis/trunk/c/src/soap:
SoapDeSerializer.cpp SoapSerializer.cpp
Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=383942&r1=383941&r2=383942&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Tue Mar 7 09:54:36 2006
@@ -74,7 +74,8 @@
AXIS_CPP_NAMESPACE_START
#define INITIAL_ARRAY_SIZE 1
- SoapDeSerializer::SoapDeSerializer ()
+
+SoapDeSerializer::SoapDeSerializer ()
{
m_pParser = XMLParserFactory::getParserObject ();
m_pEnv = NULL;
@@ -86,25 +87,20 @@
SoapDeSerializer::~SoapDeSerializer ()
{
if (m_pEnv)
- delete m_pEnv;
+ delete m_pEnv;
if (m_pHeader)
- delete m_pHeader;
+ delete m_pHeader;
if (m_pParser)
- {
- XMLParserFactory::destroyParserObject (m_pParser);
- //delete m_pParser;
- }
- if(pBodyContent)
- delete pBodyContent;
+ XMLParserFactory::destroyParserObject (m_pParser);
+ if(pBodyContent)
+ delete pBodyContent;
}
int
SoapDeSerializer::setInputStream (SOAPTransport * pInputStream)
{
if (NULL == pInputStream)
- {
- return AXIS_FAIL;
- }
+ return AXIS_FAIL;
m_pInputStream = pInputStream;
@@ -117,58 +113,44 @@
Attribute *pAttr = NULL;
if (!m_pNode)
- {
- m_pNode = m_pParser->next ();
- }
+ m_pNode = m_pParser->next ();
if (!m_pNode || (START_ELEMENT != m_pNode->m_type))
- {
- return NULL;
- }
+ return NULL;
if (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (SOAP_VER_1_2).
- pchWords[SKW_ENVELOPE]))
+ SoapKeywordMapping::map (SOAP_VER_1_2).pchWords[SKW_ENVELOPE]))
{
- SoapEnvelope *m_pEnvl = new SoapEnvelope ();
- /* set all attributes of SoapEnvelope */
- std::list<Attribute*> attributeList0;
- pAttr = new Attribute ( attributeList0);
-
- pAttr->setValue (m_pNode->m_pchNamespace);
- m_pEnvl->addNamespaceDecl (pAttr);
-
- if (0 == strcmp (m_pNode->m_pchNamespace,
- SoapKeywordMapping::map (SOAP_VER_1_1).
- pchNamespaceUri))
- {
- m_nSoapVersion = SOAP_VER_1_1;
- }
- else if (0 == strcmp (m_pNode->m_pchNamespace,
- SoapKeywordMapping::map (SOAP_VER_1_2).
- pchNamespaceUri))
- {
- m_nSoapVersion = SOAP_VER_1_2;
- }
- else
- {
- m_nSoapVersion = VERSION_LAST;
- }
-
- /* Set Attributes */
- for (int i = 0; m_pNode->m_pchAttributes[i]; i += 3)
- {
- std::list<Attribute*> attributeList1;
- pAttr = new Attribute (attributeList1);
- pAttr->setLocalName (m_pNode->m_pchAttributes[i]);
- pAttr->setURI (m_pNode->m_pchAttributes[i + 1]);
- pAttr->setValue (m_pNode->m_pchAttributes[i + 2]);
- m_pEnvl->addAttribute (pAttr);
- }
-
- m_pNode = NULL; /* This is to indicate that node is identified
- * and used */
- return m_pEnvl;
+ SoapEnvelope *m_pEnvl = new SoapEnvelope ();
+ /* set all attributes of SoapEnvelope */
+ std::list<Attribute*> attributeList0;
+ pAttr = new Attribute ( attributeList0);
+
+ pAttr->setValue (m_pNode->m_pchNamespace);
+ m_pEnvl->addNamespaceDecl (pAttr);
+
+ if (0 == strcmp (m_pNode->m_pchNamespace,
+ SoapKeywordMapping::map (SOAP_VER_1_1).pchNamespaceUri))
+ m_nSoapVersion = SOAP_VER_1_1;
+ else if (0 == strcmp (m_pNode->m_pchNamespace,
+ SoapKeywordMapping::map (SOAP_VER_1_2).pchNamespaceUri))
+ m_nSoapVersion = SOAP_VER_1_2;
+ else
+ m_nSoapVersion = VERSION_LAST;
+
+ /* Set Attributes */
+ for (int i = 0; m_pNode->m_pchAttributes[i]; i += 3)
+ {
+ std::list<Attribute*> attributeList1;
+ pAttr = new Attribute (attributeList1);
+ pAttr->setLocalName (m_pNode->m_pchAttributes[i]);
+ pAttr->setURI (m_pNode->m_pchAttributes[i + 1]);
+ pAttr->setValue (m_pNode->m_pchAttributes[i + 2]);
+ m_pEnvl->addAttribute (pAttr);
+ }
+
+ m_pNode = NULL; /* This is to indicate that node is identified and used */
+ return m_pEnvl;
}
return NULL;
@@ -182,13 +164,10 @@
*/
IHeaderBlock *
SoapDeSerializer::getHeaderBlock (const AxisChar * pName,
- const AxisChar * pNamespace)
+ const AxisChar * pNamespace)
{
if (!m_pHeader)
- {
- return NULL; /* there has been no <Header> element so there
- * can be no Header blocks */
- }
+ return NULL; /* no <Header> element so there can be no Header blocks */
return m_pHeader->getHeaderBlock (pName, pNamespace, true);
}
@@ -197,272 +176,232 @@
SoapDeSerializer::getHeader ()
{
if (m_pHeader)
- {
- return m_nStatus;
- }
+ return m_nStatus;
m_pNode = m_pParser->next ();
- if (!m_pNode) /* this means a SOAP error */
+ if (!m_pNode) /* this means a SOAP error */
{
- m_nStatus = AXIS_FAIL;
- return m_nStatus;
+ m_nStatus = AXIS_FAIL;
+ return m_nStatus;
}
if ((START_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_HEADER])))
- {
- if (m_pHeader)
- {
- delete m_pHeader;
- }
-
- m_pHeader = new SoapHeader ();
- /* Set any attributes/namspaces to the SoapHeader object */
-
- bool blnMainLoopContStatus = true;
-
- while (blnMainLoopContStatus)
- {
- m_pNode = m_pParser->next (true);
-
- if (!m_pNode)
- {
- m_nStatus = AXIS_FAIL;
- return m_nStatus;
- }
-
- if ((END_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_HEADER])))
- {
- m_pNode = NULL; /* This is to indicate that node is identified
- * and used */
- return m_nStatus;
- break;
- }
-
- /* The following is done to ignore anything (eg : the toplevel
- whitespaces) but a start element. */
- if (START_ELEMENT != m_pNode->m_type)
- continue;
-
- HeaderBlock *pHeaderBlock = new HeaderBlock ();
-
- if (m_pNode->m_pchNamespace)
- {
- pHeaderBlock->setURI (m_pNode->m_pchNamespace);
- }
-
- pHeaderBlock->setLocalName (m_pNode->m_pchNameOrValue);
-
- if ((m_pNode->m_pchAttributes[0]) != NULL)
- {
- int iAttributeArrayIndex = 0;
-
- while (true)
- {
- std::list<Attribute*> attributeList2;
- Attribute *pAttribute = new Attribute (attributeList2);
- pAttribute->setLocalName (m_pNode->
- m_pchAttributes
- [iAttributeArrayIndex++]);
- pAttribute->setURI (m_pNode->
- m_pchAttributes
- [iAttributeArrayIndex++]);
- pAttribute->setValue (m_pNode->
- m_pchAttributes
- [iAttributeArrayIndex++]);
-
- pHeaderBlock->addAttribute (pAttribute);
-
- if (m_pNode->m_pchAttributes
- [iAttributeArrayIndex] == '\0')
- {
- break;
- }
- }
- }
-
- BasicNode **pNodeList = new BasicNode *[10];
- int iListPos = 0;
- int iLevel = 0;
- bool bContinue = true;
-
- while (bContinue)
- {
- m_pNode = m_pParser->next (true);
-
- if (END_ELEMENT == m_pNode->m_type)
- {
- if (iLevel == 0)
- {
- //do nothing
- m_pHeader->addHeaderBlock (pHeaderBlock);
- bContinue = false;
- }
- else if (iLevel == 1)
- {
- if ((pNodeList[0]) != NULL)
- {
- //addToHeaderBlock(pNodeList[0]);
- pHeaderBlock->addChild (pNodeList[0]);
- /* Commented by Rangika since with this part the logic is wrong
- //m_pHeader->addHeaderBlock (pHeaderBlock);
- //m_pParser->next (true); //To skip the end element of the HeaderBlock
- //bContinue = false;
- */
- iListPos--;
- iLevel--;
- }
- }
- else
- {
- //addToImmediateParent(pNodeList, iListPos);
- (pNodeList[iListPos - 2])->
- addChild (pNodeList[iListPos - 1]);
- iListPos--;
- iLevel--;
- }
- }
- else if (START_ELEMENT == m_pNode->m_type)
- {
- //createBaisNode and setValue
- BasicNode *pComplexElement = new ComplexElement ();
-
- if (m_pNode->m_pchNamespace)
- {
- pComplexElement->setURI (m_pNode->m_pchNamespace);
- }
-
- pComplexElement->setLocalName (m_pNode->m_pchNameOrValue);
-
- //addtoList
- pNodeList[iListPos] = pComplexElement;
- iListPos++;
- iLevel++;
- }
- else if (CHARACTER_ELEMENT == m_pNode->m_type)
- {
- //createBasicNode and setValue
- BasicNode *pBasicNode =
- new CharacterElement (m_pNode->m_pchNameOrValue);
-
- //addToImmidiateParent
- if (iLevel == 0)
- {
- pHeaderBlock->addChild (pBasicNode);
- }
- else
- {
- (pNodeList[iListPos - 1])->addChild (pBasicNode);
- }
- }
- } // end while
-
- // Samisa: clean memory
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
+ {
+ if (m_pHeader)
+ delete m_pHeader;
+
+ m_pHeader = new SoapHeader ();
+
+ /* Set any attributes/namspaces to the SoapHeader object */
+ bool blnMainLoopContStatus = true;
+
+ while (blnMainLoopContStatus)
+ {
+ m_pNode = m_pParser->next (true);
+
+ if (!m_pNode)
+ {
+ m_nStatus = AXIS_FAIL;
+ return m_nStatus;
+ }
+
+ if ((END_ELEMENT == m_pNode->m_type) &&
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_HEADER])))
+ {
+ m_pNode = NULL; /* indicate that node is identified and used */
+ return m_nStatus;
+ break;
+ }
+
+ /* The following is done to ignore anything (eg : the toplevel
+ whitespaces) but a start element. */
+ if (START_ELEMENT != m_pNode->m_type)
+ continue;
+
+ HeaderBlock *pHeaderBlock = new HeaderBlock ();
+
+ if (m_pNode->m_pchNamespace)
+ pHeaderBlock->setURI (m_pNode->m_pchNamespace);
+
+ pHeaderBlock->setLocalName (m_pNode->m_pchNameOrValue);
+
+ if ((m_pNode->m_pchAttributes[0]) != NULL)
+ {
+ int iAttributeArrayIndex = 0;
+
+ while (true)
+ {
+ std::list<Attribute*> attributeList2;
+ Attribute *pAttribute = new Attribute (attributeList2);
+ pAttribute->setLocalName (m_pNode->m_pchAttributes[iAttributeArrayIndex++]);
+ pAttribute->setURI (m_pNode->m_pchAttributes[iAttributeArrayIndex++]);
+ pAttribute->setValue (m_pNode->m_pchAttributes[iAttributeArrayIndex++]);
+
+ pHeaderBlock->addAttribute (pAttribute);
+
+ if (m_pNode->m_pchAttributes[iAttributeArrayIndex] == '\0')
+ break;
+ }
+ }
+
+ BasicNode **pNodeList = new BasicNode *[10];
+ int iListPos = 0;
+ int iLevel = 0;
+ bool bContinue = true;
+
+ while (bContinue)
+ {
+ m_pNode = m_pParser->next (true);
+
+ if (END_ELEMENT == m_pNode->m_type)
+ {
+ if (iLevel == 0)
+ {
+ //do nothing
+ m_pHeader->addHeaderBlock (pHeaderBlock);
+ bContinue = false;
+ }
+ else if (iLevel == 1)
+ {
+ if ((pNodeList[0]) != NULL)
+ {
+ //addToHeaderBlock(pNodeList[0]);
+ pHeaderBlock->addChild (pNodeList[0]);
+ /* Commented by Rangika since with this part the logic is wrong
+ //m_pHeader->addHeaderBlock (pHeaderBlock);
+ //m_pParser->next (true); //To skip the end element of the HeaderBlock
+ //bContinue = false;
+ */
+ iListPos--;
+ iLevel--;
+ }
+ }
+ else
+ {
+ //addToImmediateParent(pNodeList, iListPos);
+ (pNodeList[iListPos - 2])->
+ addChild (pNodeList[iListPos - 1]);
+ iListPos--;
+ iLevel--;
+ }
+ }
+ else if (START_ELEMENT == m_pNode->m_type)
+ {
+ //createBaisNode and setValue
+ BasicNode *pComplexElement = new ComplexElement ();
+
+ if (m_pNode->m_pchNamespace)
+ pComplexElement->setURI (m_pNode->m_pchNamespace);
+
+ pComplexElement->setLocalName (m_pNode->m_pchNameOrValue);
+
+ //addtoList
+ pNodeList[iListPos] = pComplexElement;
+ iListPos++;
+ iLevel++;
+ }
+ else if (CHARACTER_ELEMENT == m_pNode->m_type)
+ {
+ //createBasicNode and setValue
+ BasicNode *pBasicNode =
+ new CharacterElement (m_pNode->m_pchNameOrValue);
+
+ //addToImmidiateParent
+ if (iLevel == 0)
+ pHeaderBlock->addChild (pBasicNode);
+ else
+ (pNodeList[iListPos - 1])->addChild (pBasicNode);
+ }
+ } // end while
+
+ // clean memory
delete [] pNodeList;
- }
+ }
}
return m_nStatus;
}
-//Chinthana:This method adds to allow "all" & "choice" constructs to peek head next element.
+// This method adds to allow "all" & "choice" constructs to peek head next element.
const char*
SoapDeSerializer::peekNextElementName ()
-{
-
- if (m_pParser)
-
- {
- const char* name = m_pParser->peek ();
- return name;
-
- }
-
- return NULL;
-
+{
+ if (m_pParser)
+ {
+ const char* name = m_pParser->peek ();
+ return name;
+ }
+
+ return NULL;
}
-//28/04/2005
int
SoapDeSerializer::getBody ()
{
if (!m_pNode)
- {
- m_pNode = m_pParser->next ();
- }
+ m_pNode = m_pParser->next ();
/* previous header searching may have left a node unidentified */
if (m_pNode)
{
- if ((START_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_BODY])))
- {
- /* Set any attributes/namspaces to the SoapBody object */
- m_pNode = NULL; /* This is to indicate that node is identified
- * and used */
-
+ if ((START_ELEMENT == m_pNode->m_type) &&
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY])))
+ {
+ /* Set any attributes/namspaces to the SoapBody object */
+ m_pNode = NULL; /* indicate that node is identified and used */
+
// peek for the method name
m_strMethodNameToInvoke = m_pParser->peek();
- return AXIS_SUCCESS;
- }
+ return AXIS_SUCCESS;
+ }
}
m_nStatus = AXIS_FAIL;
-
return AXIS_FAIL;
}
int
SoapDeSerializer::checkMessageBody (const AxisChar * pName,
- const AxisChar * pNamespace)
+ const AxisChar * pNamespace)
{
/* check and skip the soap body tag */
/*if (AXIS_SUCCESS != getBody ())
{
- //return AXIS_FAIL;
- throw AxisGenException (SERVER_UNKNOWN_ERROR);
+ //return AXIS_FAIL;
+ throw AxisGenException (SERVER_UNKNOWN_ERROR);
}*/
if (!m_pNode)
- {
- m_pNode = m_pParser->next ();
- }
+ m_pNode = m_pParser->next ();
if (!m_pNode || (START_ELEMENT != m_pNode->m_type))
- {
- //return AXIS_FAIL;
- throw AxisGenException (SERVER_UNKNOWN_ERROR);
- }
+ throw AxisGenException (SERVER_UNKNOWN_ERROR);
- //if (0 != strcmp(m_pNode->m_pchNameOrValue, pName)) return AXIS_FAIL;
if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
{
- /* A soap fault has occurred. we will deserialize it as doc literal
- * So we set the style as doc literal. This way of doing things
- * is not so nice. I'll rectify this asap
- */
- setStyle (DOC_LITERAL);
- AXISTRACE1 ("AXISC_NODE_VALUE_MISMATCH_EXCEPTION", CRITICAL);
- throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
+ /* A soap fault has occurred. we will deserialize it as doc literal
+ * So we set the style as doc literal. This way of doing things
+ * is not so nice. I'll rectify this asap
+ */
+ setStyle (DOC_LITERAL);
+ AXISTRACE1 ("AXISC_NODE_VALUE_MISMATCH_EXCEPTION", CRITICAL);
+ throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
}
/* we can check the namespace uri too here. Should we ? */
- m_pNode = NULL; /*This is to indicate that node is identified and used */
+ m_pNode = NULL; /* indicate that node is identified and used */
return AXIS_SUCCESS;
}
void *
SoapDeSerializer::checkForFault (const AxisChar * pName,
- const AxisChar * pNamespace)
+ const AxisChar * pNamespace)
{
const char *pcCmplxFaultName;
char *pcDetail;
@@ -471,64 +410,61 @@
char *pcFaultactor;
if (0 == strcmp ("Fault", pName))
{
-
- if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
- {
- m_nStatus = AXIS_SUCCESS;
- m_pNode = NULL;
- AXISTRACE1 ("AXISC_NODE_VALUE_MISMATCH_EXCEPTION", CRITICAL);
- throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
- }
-
- /* we can check the namespace uri too here. Should we ? */
- m_nStatus = AXIS_SUCCESS;
- m_pNode = NULL; /*This is to indicate that node is identified and used */
- SoapFault *pFault = new SoapFault ();
- pFault->setDeSerializer (this);
- m_nStyle = getStyle ();
-
- /*We deserialize fault code in doc literal. */
- setStyle (DOC_LITERAL);
- pcFaultCode = getElementAsString ("faultcode", 0);
- pFault->setFaultcode (pcFaultCode == NULL ? "" : pcFaultCode);
+ if (0 != strcmp (m_pNode->m_pchNameOrValue, pName))
+ {
+ m_nStatus = AXIS_SUCCESS;
+ m_pNode = NULL;
+ AXISTRACE1 ("AXISC_NODE_VALUE_MISMATCH_EXCEPTION", CRITICAL);
+ throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
+ }
+
+ /* we can check the namespace uri too here. Should we ? */
+ m_nStatus = AXIS_SUCCESS;
+ m_pNode = NULL; /* indicate that node is identified and used */
+ SoapFault *pFault = new SoapFault ();
+ pFault->setDeSerializer (this);
+ m_nStyle = getStyle ();
+
+ /*We deserialize fault code in doc literal. */
+ setStyle (DOC_LITERAL);
+ pcFaultCode = getElementAsString ("faultcode", 0);
+ pFault->setFaultcode (pcFaultCode == NULL ? "" : pcFaultCode);
if ( pcFaultCode )
delete [] pcFaultCode;
-
- pcFaultstring = getElementAsString ("faultstring", 0);
- pFault->setFaultstring (pcFaultstring == NULL ? "" : pcFaultstring);
+
+ pcFaultstring = getElementAsString ("faultstring", 0);
+ pFault->setFaultstring (pcFaultstring == NULL ? "" : pcFaultstring);
if ( pcFaultstring )
delete [] pcFaultstring;
-
- pcFaultactor = getElementAsString ("faultactor", 0);
- pFault->setFaultactor (pcFaultactor == NULL ? "" : pcFaultactor);
+
+ pcFaultactor = getElementAsString ("faultactor", 0);
+ pFault->setFaultactor (pcFaultactor == NULL ? "" : pcFaultactor);
if ( pcFaultactor )
delete [] pcFaultactor;
-
- // FJP Changed the namespace from null to a single space (an impossible
- // value) to help method know that it is parsing a fault message.
- pcDetail = getElementAsString ("detail", " ");
-
- if (pcDetail)
- {
- pFault->setFaultDetail (pcDetail);
- delete [] pcDetail;
- }
- else
- {
- pcCmplxFaultName = getCmplxFaultObjectName ();
- pFault->setCmplxFaultObjectName (pcCmplxFaultName == NULL ? "" : pcCmplxFaultName);
- /* if ( pcCmplxFaultName )
- delete [] (reinterpret_cast <char *> (pcCmplxFaultName) );
- */
- }
-
- setStyle (m_nStyle);
- return pFault;
+
+ // FJP Changed the namespace from null to a single space (an impossible
+ // value) to help method know that it is parsing a fault message.
+ pcDetail = getElementAsString ("detail", " ");
+
+ if (pcDetail)
+ {
+ pFault->setFaultDetail (pcDetail);
+ delete [] pcDetail;
+ }
+ else
+ {
+ pcCmplxFaultName = getCmplxFaultObjectName ();
+ pFault->setCmplxFaultObjectName (pcCmplxFaultName == NULL ? "" : pcCmplxFaultName);
+ /* if ( pcCmplxFaultName )
+ delete [] (reinterpret_cast <char *> (pcCmplxFaultName) );
+ */
+ }
+
+ setStyle (m_nStyle);
+ return pFault;
}
else
- {
- throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
- }
+ throw AxisGenException (AXISC_NODE_VALUE_MISMATCH_EXCEPTION);
}
int
@@ -538,14 +474,14 @@
if (m_pEnv)
{
- delete m_pEnv;
- m_pEnv = NULL;
+ delete m_pEnv;
+ m_pEnv = NULL;
}
if (m_pHeader)
{
- delete m_pHeader;
- m_pHeader = NULL;
+ delete m_pHeader;
+ m_pHeader = NULL;
}
m_nSoapVersion = VERSION_LAST;
@@ -559,12 +495,9 @@
{
if (VERSION_LAST == m_nSoapVersion)
{
- if (m_pEnv)
- {
- delete m_pEnv;
- }
-
- m_pEnv = getEnvelope ();
+ if (m_pEnv)
+ delete m_pEnv;
+ m_pEnv = getEnvelope ();
}
return m_nSoapVersion;
@@ -584,53 +517,55 @@
*
*/
-void SoapDeSerializer::deserializeLiteralComplexArray(Axis_Array * pArray, void *pDZFunct,
- void *pCreFunct, void *pDelFunct, void* pSizeFunct,
- const AxisChar * pName, const AxisChar * pNamespace)
+void SoapDeSerializer::deserializeLiteralComplexArray(Axis_Array * pArray,
+ void *pDZFunct,
+ void *pCreFunct,
+ void *pDelFunct,
+ void* pSizeFunct,
+ const AxisChar * pName,
+ const AxisChar * pNamespace)
{
while(true)
{
const char* elementName = peekNextElementName();
if(strcmp(elementName, pName) == 0)
- {
pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
- }
else
- {
return;
- }
}
}
-void SoapDeSerializer::deserializeEncodedComplexArray(Axis_Array * pArray, void *pDZFunct,
- void *pCreFunct, void *pDelFunct, void* pSizeFunct,
- const AxisChar * pName, const AxisChar * pNamespace, int size)
+void SoapDeSerializer::deserializeEncodedComplexArray(Axis_Array * pArray,
+ void *pDZFunct,
+ void *pCreFunct,
+ void *pDelFunct,
+ void* pSizeFunct,
+ const AxisChar * pName,
+ const AxisChar * pNamespace,
+ int size)
{
for (int count = 0 ; count < size; count++)
{
const char* elementName = peekNextElementName();
if(strcmp(elementName, pName) != 0)
- {
pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
- }
else
- {
return;
- }
}
}
Axis_Array*
-SoapDeSerializer::getCmplxArray ( Axis_Array* pArray, void *pDZFunct,
- void *pCreFunct, void *pDelFunct, void *pSizeFunct,
- const AxisChar * pName, const AxisChar * pNamespace)
+SoapDeSerializer::getCmplxArray ( Axis_Array* pArray,
+ void *pDZFunct,
+ void *pCreFunct,
+ void *pDelFunct,
+ void *pSizeFunct,
+ const AxisChar * pName,
+ const AxisChar * pNamespace)
{
+ /* if anything has gone wrong earlier just do nothing */
if (AXIS_SUCCESS != m_nStatus)
- {
return pArray;
- /* if anything has gone wrong
- * earlier just do nothing */
- }
if (RPC_ENCODED == m_nStyle)
{
@@ -639,15 +574,11 @@
* Ex:<tns:QuoteInfoTypeArray xmlns:tns="http://www.getquote.org/test">
*/
if (!m_pNode)
- {
return pArray;
- }
-// Look for an empty array
+ // Look for an empty array
if (END_ELEMENT == m_pNode->m_type)
- {
return pArray;
- }
int arraySize = getArraySize (m_pNode);
@@ -659,24 +590,21 @@
else if (arraySize > 0)
{
deserializeEncodedComplexArray(pArray, pDZFunct, pCreFunct, pDelFunct,
- pSizeFunct, pName, pNamespace, arraySize);
+ pSizeFunct, pName, pNamespace, arraySize);
if (m_nStatus != AXIS_FAIL)
- {
return pArray;
- }
}
}
else
{
deserializeLiteralComplexArray(pArray, pDZFunct, pCreFunct, pDelFunct,
- pSizeFunct, pName, pNamespace);
+ pSizeFunct, pName, pNamespace);
if (m_nStatus != AXIS_FAIL)
- {
return pArray;
- }
}
+
m_nStatus = AXIS_FAIL;
m_pNode = NULL;
@@ -692,28 +620,25 @@
SoapDeSerializer::getArraySize (const AnyElement * pElement)
{
int nSize = -1;
+
/* first check whether this is a start element node */
-
if (START_ELEMENT != pElement->m_type)
- {
- return nSize;
- }
+ return nSize;
for (int i = 0; pElement->m_pchAttributes[i]; i += 3)
{
- if (URI_ENC == URIMapping::getURI (pElement->m_pchAttributes[i + 1])
- && (0 == strcmp (pElement->m_pchAttributes[i],
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_ARRAYTYPE])))
- {
- QName qn;
-
- qn.splitQNameString (pElement->m_pchAttributes[i + 2], '[');
- nSize = strtol (qn.localname, &m_pEndptr, 10);
- qn.mergeQNameString ('[');
-
- return nSize;
- }
+ if (URI_ENC == URIMapping::getURI (pElement->m_pchAttributes[i + 1])
+ && (0 == strcmp (pElement->m_pchAttributes[i],
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_ARRAYTYPE])))
+ {
+ QName qn;
+
+ qn.splitQNameString (pElement->m_pchAttributes[i + 2], '[');
+ nSize = strtol (qn.localname, &m_pEndptr, 10);
+ qn.mergeQNameString ('[');
+
+ return nSize;
+ }
}
return nSize;
@@ -733,7 +658,11 @@
*
*
*/
-void SoapDeSerializer::deserializeEncodedArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace, int size)
+void SoapDeSerializer::deserializeEncodedArray (Axis_Array* pArray,
+ IAnySimpleType* pSimpleType,
+ const AxisChar* pName,
+ const AxisChar* pNamespace,
+ int size)
{
for (int count = 0 ; count < size; count++)
{
@@ -746,76 +675,69 @@
Axis::AxisDelete(pValue, pSimpleType->getType());
}
else
- {
return;
- }
}
}
-void SoapDeSerializer::deserializeLiteralArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace)
+void SoapDeSerializer::deserializeLiteralArray (Axis_Array* pArray,
+ IAnySimpleType* pSimpleType,
+ const AxisChar* pName,
+ const AxisChar* pNamespace)
{
while(true)
{
const char* elementName = peekNextElementName();
if(strcmp(elementName, pName) == 0)
{
- getElement(pName, pNamespace, pSimpleType);
+ getElement(pName, pNamespace, pSimpleType);
void * pValue = pSimpleType->getValue();
pArray->addElement(pValue);
Axis::AxisDelete(pValue, pSimpleType->getType());
}
else
- {
return;
- }
}
}
Axis_Array*
SoapDeSerializer::getBasicArray (XSDTYPE nType,
- const AxisChar * pName,
- const AxisChar * pNamespace)
+ const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Axis_Array* Array = new Axis_Array();
Array->m_Type = nType;
+ /* if anything has gone wrong earlier just do nothing */
if (AXIS_SUCCESS != m_nStatus)
- {
- return Array;
- }
+ return Array;
- /* if anything has gone wrong earlier just do nothing */
if (RPC_ENCODED == m_nStyle)
- {
- m_pNode = m_pParser->next ();
-
- /* just skip wrapper node with type info Ex: <tns:ArrayOfPhoneNumbers
- * xmlns:tns="http://www.getquote.org/test">
- */
- if (!m_pNode)
- {
- return Array;
- }
-
- int size = getArraySize (m_pNode);
-
- if (size == 0)
- {
- m_pNode = m_pParser->next (); /* skip end element node too */
- return Array;
- }
- else if (size > 0)
+ {
+ m_pNode = m_pParser->next ();
+
+ /* just skip wrapper node with type info Ex: <tns:ArrayOfPhoneNumbers
+ * xmlns:tns="http://www.getquote.org/test">
+ */
+ if (!m_pNode)
+ return Array;
+
+ int size = getArraySize (m_pNode);
+
+ if (size == 0)
+ {
+ m_pNode = m_pParser->next (); /* skip end element node too */
+ return Array;
+ }
+ else if (size > 0)
{
IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(nType);
deserializeEncodedArray(Array, pSimpleType, pName, pNamespace, size);
delete pSimpleType;
if ( m_nStatus != AXIS_FAIL)
- {
- return Array;
- }
+ return Array;
}
- }
+ }
else
{
IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(nType);
@@ -823,10 +745,9 @@
delete pSimpleType;
if ( m_nStatus != AXIS_FAIL)
- {
- return Array;
- }
+ return Array;
}
+
m_nStatus = AXIS_FAIL;
m_pNode = NULL;
@@ -849,137 +770,142 @@
*
*/
void *
-SoapDeSerializer::getCmplxObject (void *pDZFunct, void *pCreFunct,
- void *pDelFunct, const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getCmplxObject (void *pDZFunct,
+ void *pCreFunct,
+ void *pDelFunct,
+ const AxisChar * pName,
+ const AxisChar * pNamespace)
{
- if (AXIS_SUCCESS != m_nStatus)
- return NULL;
/* if anything has gone wrong earlier just do nothing */
+ if (AXIS_SUCCESS != m_nStatus)
+ return NULL;
+
if (RPC_ENCODED == m_nStyle)
{
-
- m_pNode = m_pParser->next ();
- /* just skip wrapper node with type info
- * Ex: <tns:QuoteInfoType xmlns:tns="http://www.getquote.org/test"> */
- if (!m_pNode)
- return NULL;
- /* type can be checked here */
- TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
- void *pObject =
- ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0);
- TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
- if (pObject && pDZFunct)
- {
- if (C_RPC_PROVIDER == getCurrentProviderType ())
- {
- // Disable C support
- //IWrapperSoapDeSerializer_C cWSD;
- //cWSD._object = this;
- //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
- //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)(pObject, &cWSD);
- }
- else
- {
- TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
- m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
- TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
- }
- if (AXIS_SUCCESS == m_nStatus)
- {
- m_pParser->next (); /* skip end node too */
- return pObject;
- }
- else
- {
- TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
- ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
- }
- }
+ m_pNode = m_pParser->next ();
+ /* just skip wrapper node with type info
+ * Ex: <tns:QuoteInfoType xmlns:tns="http://www.getquote.org/test"> */
+ if (!m_pNode)
+ return NULL;
+ /* type can be checked here */
+ TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
+ void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0);
+ TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
+ if (pObject && pDZFunct)
+ {
+ if (C_RPC_PROVIDER == getCurrentProviderType ())
+ {
+ // Disable C support
+ //IWrapperSoapDeSerializer_C cWSD;
+ //cWSD._object = this;
+ //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
+ //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)(pObject, &cWSD);
+ }
+ else
+ {
+ TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
+ m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
+ TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+ }
+
+ if (AXIS_SUCCESS == m_nStatus)
+ {
+ m_pParser->next (); /* skip end node too */
+ return pObject;
+ }
+ else
+ {
+ TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
+ ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
+ TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+ }
+ }
}
else
{
- if (!m_pNode)
- /* if there is an unprocessed node that may be one left from
- * last array deserialization */
- m_pNode = m_pParser->next ();
- /* wrapper node without type info Ex: <result> */
- if (!m_pNode)
- return NULL;
- if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
- {
- /* if this node contain attributes let them be used by the complex
- * type's deserializer
- */
- if (0 != m_pNode->m_pchAttributes[0])
- {
- m_pCurrNode = m_pNode;
- /*
- * Need to verify if the return value is NULL.
- */
- xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
- if (NULL != isNill)
- {
- if(true_ == *isNill)
- {
- m_pParser->next ();
- m_pNode = NULL;
- delete isNill;
- return NULL;
- } else {
- delete isNill;
- }
- }
- }
- m_pNode = NULL; /* node identified and used */
-
- TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
- void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct)(NULL, false, 0);
- TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
-
- if (pObject && pDZFunct)
- {
- if (C_DOC_PROVIDER == getCurrentProviderType ())
- {
- // Disable C support
- //IWrapperSoapDeSerializer_C cWSD;
- //cWSD._object = this;
- //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
- //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)
- // (pObject, &cWSD);
- }
- else
- {
- TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
- m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
- TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
- }
- if (AXIS_SUCCESS == m_nStatus)
- {
- m_pParser->next (); /* skip end node too */
- return pObject;
- }
- else
- {
- TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
- ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
- }
- }
- }
- else
- {
- /*
- * TODO: Need to verify what WS-I 1.0 say
- * about the mandatory of all the elements in the response in case of
- * null value or none filled value. Some Web services servers work
- * like this. This apply for all the rest of the deserializer.
- */
- return NULL;
- }
+ /* if there is an unprocessed node that may be one left from
+ * last array deserialization */
+ if (!m_pNode)
+ m_pNode = m_pParser->next ();
+
+ /* wrapper node without type info Ex: <result> */
+ if (!m_pNode)
+ return NULL;
+
+ if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
+ {
+ /* if this node contain attributes let them be used by the complex
+ * type's deserializer
+ */
+ if (0 != m_pNode->m_pchAttributes[0])
+ {
+ m_pCurrNode = m_pNode;
+ /*
+ * Need to verify if the return value is NULL.
+ */
+ xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
+ if (NULL != isNill)
+ {
+ if(true_ == *isNill)
+ {
+ m_pParser->next ();
+ m_pNode = NULL;
+ delete isNill;
+ return NULL;
+ }
+ else
+ delete isNill;
+ }
+ }
+
+ m_pNode = NULL; /* node identified and used */
+
+ TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
+ void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct)(NULL, false, 0);
+ TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
+
+ if (pObject && pDZFunct)
+ {
+ if (C_DOC_PROVIDER == getCurrentProviderType ())
+ {
+ // Disable C support
+ //IWrapperSoapDeSerializer_C cWSD;
+ //cWSD._object = this;
+ //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
+ //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct) (pObject, &cWSD);
+ }
+ else
+ {
+ TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
+ m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
+ TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+ }
+ if (AXIS_SUCCESS == m_nStatus)
+ {
+ m_pParser->next (); /* skip end node too */
+ return pObject;
+ }
+ else
+ {
+ TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
+ ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
+ TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+ }
+ }
+ }
+ else
+ {
+ /*
+ * TODO: Need to verify what WS-I 1.0 say
+ * about the mandatory of all the elements in the response in case of
+ * null value or none filled value. Some Web services servers work
+ * like this. This apply for all the rest of the deserializer.
+ */
+ return NULL;
+ }
}
- m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
+
+ m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
return NULL;
}
@@ -988,190 +914,188 @@
SoapDeSerializer::getCmplxFaultObjectName ()
{
- if (!m_pNode)
- {
-
- // Skip the faultdetail tag
- m_pParser->next ();
- }
-
- m_nStatus = AXIS_SUCCESS;
+ // Skip the faultdetail tag
+ if (!m_pNode)
+ m_pParser->next ();
+
+ m_nStatus = AXIS_SUCCESS;
if (AXIS_SUCCESS != m_nStatus)
- return NULL;
+ return NULL;
+
/* if anything has gone wrong earlier just do nothing */
if (RPC_ENCODED == m_nStyle)
{
-
- m_pParser->next ();
-
- /* just skip wrapper node with type info
- * Ex: <tns:QuoteInfoType xmlns:tns="http://www.getquote.org/test">
- */
- if (!m_pNode)
- return NULL;
- return m_pNode->m_pchNameOrValue;
+ m_pParser->next ();
+
+ /* just skip wrapper node with type info
+ * Ex: <tns:QuoteInfoType xmlns:tns="http://www.getquote.org/test">
+ */
+ if (!m_pNode)
+ return NULL;
+
+ return m_pNode->m_pchNameOrValue;
}
else
{
- if (!m_pNode)
- {
- /* if there is an unprocessed node that may be one left from
- * last array deserialization */
- m_pNode = m_pParser->next ();
- /* wrapper node without type info Ex: <result> */
- }
- if (!m_pNode)
- return NULL;
- return m_pNode->m_pchNameOrValue;
+ if (!m_pNode)
+ {
+ /* if there is an unprocessed node that may be one left from
+ * last array deserialization */
+ m_pNode = m_pParser->next ();
+ /* wrapper node without type info Ex: <result> */
+ }
+
+ if (!m_pNode)
+ return NULL;
+
+ return m_pNode->m_pchNameOrValue;
}
}
void *
-SoapDeSerializer::getCmplxFaultObject (void *pDZFunct, void *pCreFunct,
- void *pDelFunct,
- const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getCmplxFaultObject (void *pDZFunct,
+ void *pCreFunct,
+ void *pDelFunct,
+ const AxisChar * pName,
+ const AxisChar * pNamespace)
{
if (RPC_ENCODED == m_nStyle)
{
- /* type can be checked here */
- TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
- void *pObject =
- ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0);
- TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
-
- if (pObject && pDZFunct)
- {
- if (C_RPC_PROVIDER == getCurrentProviderType ())
- {
- // Disable C support
- //IWrapperSoapDeSerializer_C cWSD;
- //cWSD._object = this;
- //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
- //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)(pObject, &cWSD);
- }
- else
- {
- TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
- m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
- TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
- }
- if (AXIS_SUCCESS == m_nStatus)
- {
- m_pParser->next (); /* skip end node too */
- return pObject;
- }
- else
- {
- TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
- ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
- }
- }
+ /* type can be checked here */
+ TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
+ void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0);
+ TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
+
+ if (pObject && pDZFunct)
+ {
+ if (C_RPC_PROVIDER == getCurrentProviderType ())
+ {
+ // Disable C support
+ //IWrapperSoapDeSerializer_C cWSD;
+ //cWSD._object = this;
+ //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
+ //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)(pObject, &cWSD);
+ }
+ else
+ {
+ TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
+ m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
+ TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+ }
+
+ if (AXIS_SUCCESS == m_nStatus)
+ {
+ m_pParser->next (); /* skip end node too */
+ return pObject;
+ }
+ else
+ {
+ TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
+ ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
+ TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+ }
+ }
+ }
+ else
+ {
+ if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
+ {
+ /* if this node contain attributes let them be used by the complex
+ * type's deserializer
+ */
+ if (0 != m_pNode->m_pchAttributes[0])
+ {
+ m_pCurrNode = m_pNode;
+ xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
+ if (NULL != isNill)
+ {
+ if(true_ == *isNill)
+ {
+ m_pParser->next ();
+ m_pNode = NULL;
+ delete isNill;
+ return NULL;
+ }
+ else
+ delete isNill;
+ }
+ }
+ m_pNode = NULL; /* node identified and used */
+
+ TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
+ void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct)(NULL, false, 0);
+ TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
+
+ if (pObject && pDZFunct)
+ {
+ if (C_DOC_PROVIDER == getCurrentProviderType ())
+ {
+ // Disable C support
+ //IWrapperSoapDeSerializer_C cWSD;
+ //cWSD._object = this;
+ //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
+ //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)
+ // (pObject, &cWSD);
+ }
+ else
+ {
+ TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
+ m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
+ TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+ }
+ if (AXIS_SUCCESS == m_nStatus)
+ {
+ m_pParser->next (); /* skip end node too */
+ return pObject;
+ }
+ else
+ {
+ TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
+ ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
+ TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+ }
+ }
+ }
+ else
+ {
+ /*
+ * TODO: Need to verify what WS-I 1.0 say
+ * about the mandatory of all the elements in the response in case of
+ * null value or none filled value. Some Web services servers work
+ * like this. This apply for all the rest of the deserializer.
+ */
+ return NULL;
+ }
}
- else
- {
-
- if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
- {
- /* if this node contain attributes let them be used by the complex
- * type's deserializer
- */
- if (0 != m_pNode->m_pchAttributes[0])
- {
- m_pCurrNode = m_pNode;
- xsd__boolean * isNill = getAttributeAsBoolean("nil", 0);
- if (NULL != isNill)
- {
- if(true_ == *isNill)
- {
- m_pParser->next ();
- m_pNode = NULL;
- delete isNill;
- return NULL;
- } else {
- delete isNill;
- }
- }
- }
- m_pNode = NULL; /* node identified and used */
-
- TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
- void *pObject = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct)(NULL, false, 0);
- TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pObject);
-
- if (pObject && pDZFunct)
- {
- if (C_DOC_PROVIDER == getCurrentProviderType ())
- {
- // Disable C support
- //IWrapperSoapDeSerializer_C cWSD;
- //cWSD._object = this;
- //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
- //m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)
- // (pObject, &cWSD);
- }
- else
- {
- TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pObject, this);
- m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pObject, this);
- TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
- }
- if (AXIS_SUCCESS == m_nStatus)
- {
- m_pParser->next (); /* skip end node too */
- return pObject;
- }
- else
- {
- TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pObject, false, 0);
- ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pObject, false, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
- }
- }
- }
- else
- {
- /*
- * TODO: Need to verify what WS-I 1.0 say
- * about the mandatory of all the elements in the response in case of
- * null value or none filled value. Some Web services servers work
- * like this. This apply for all the rest of the deserializer.
- */
- return NULL;
- }
- }
- m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
+ m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
return NULL;
}
int
SoapDeSerializer::getElementForAttributes (const AxisChar * pName,
- const AxisChar * pNamespace)
+ const AxisChar * pNamespace)
{
if (m_pCurrNode)
{
- if (0 == strcmp (pName, m_pCurrNode->m_pchNameOrValue))
- return m_nStatus;
+ if (0 == strcmp (pName, m_pCurrNode->m_pchNameOrValue))
+ return m_nStatus;
}
+
if (!m_pNode)
{
- m_pNode = m_pParser->next ();
- m_pCurrNode = m_pParser->next ();
- }
- else /* previous node not processed. So consider it */
- {
- m_pCurrNode = m_pNode;
+ m_pNode = m_pParser->next ();
+ m_pCurrNode = m_pParser->next ();
}
+ else /* previous node not processed. So consider it */
+ m_pCurrNode = m_pNode;
+
if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
+ m_pNode = NULL;
+ else /* error : current element is not the expected one */
{
- m_pNode = NULL;
- }
- else /* error : current element is not the expected one */
- {
- m_nStatus = AXIS_FAIL;
- m_pCurrNode = NULL;
+ m_nStatus = AXIS_FAIL;
+ m_pCurrNode = NULL;
}
return m_nStatus;
@@ -1193,9 +1117,7 @@
}
}
else
- {
m_nStatus = AXIS_FAIL;
- }
}
return;
}
@@ -1205,17 +1127,17 @@
* current Element to the right Element by calling GetElementForAttributes(..)
*/
xsd__int *
- SoapDeSerializer::getAttributeAsInt (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsInt (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Int simpleType;
getAttribute(pName, pNamespace, &simpleType);
- return simpleType.getInt();
+ return simpleType.getInt();
}
xsd__boolean *
- SoapDeSerializer::getAttributeAsBoolean (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsBoolean (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Boolean simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1223,8 +1145,8 @@
}
xsd__unsignedInt *
- SoapDeSerializer::getAttributeAsUnsignedInt (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsUnsignedInt (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
UnsignedInt simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1232,8 +1154,8 @@
}
xsd__short *
- SoapDeSerializer::getAttributeAsShort (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsShort (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Short simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1241,8 +1163,8 @@
}
xsd__unsignedShort *
- SoapDeSerializer::getAttributeAsUnsignedShort (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsUnsignedShort (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
UnsignedShort simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1250,8 +1172,8 @@
}
xsd__byte *
- SoapDeSerializer::getAttributeAsByte (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsByte (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Byte simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1259,8 +1181,8 @@
}
xsd__unsignedByte *
- SoapDeSerializer::getAttributeAsUnsignedByte (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsUnsignedByte (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
UnsignedByte simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1268,8 +1190,8 @@
}
xsd__long *
- SoapDeSerializer::getAttributeAsLong (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsLong (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Long simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1277,8 +1199,8 @@
}
xsd__integer *
- SoapDeSerializer::getAttributeAsInteger (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsInteger (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Integer simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1286,8 +1208,8 @@
}
xsd__nonNegativeInteger *
- SoapDeSerializer::getAttributeAsNonNegativeInteger (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNonNegativeInteger (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NonNegativeInteger simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1295,8 +1217,8 @@
}
xsd__positiveInteger *
- SoapDeSerializer::getAttributeAsPositiveInteger (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsPositiveInteger (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
PositiveInteger simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1304,8 +1226,8 @@
}
xsd__nonPositiveInteger *
- SoapDeSerializer::getAttributeAsNonPositiveInteger (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNonPositiveInteger (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NonPositiveInteger simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1313,8 +1235,8 @@
}
xsd__negativeInteger *
- SoapDeSerializer::getAttributeAsNegativeInteger (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNegativeInteger (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NegativeInteger simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1322,8 +1244,8 @@
}
xsd__unsignedLong *
- SoapDeSerializer::getAttributeAsUnsignedLong (const AxisChar *pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsUnsignedLong (const AxisChar *pName,
+ const AxisChar * pNamespace)
{
UnsignedLong simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1331,8 +1253,8 @@
}
xsd__float *
- SoapDeSerializer::getAttributeAsFloat (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsFloat (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Float simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1340,8 +1262,8 @@
}
xsd__double *
- SoapDeSerializer::getAttributeAsDouble (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsDouble (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Double simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1349,8 +1271,8 @@
}
xsd__decimal *
- SoapDeSerializer::getAttributeAsDecimal (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsDecimal (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Decimal simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1358,8 +1280,8 @@
}
xsd__NOTATION
- SoapDeSerializer::getAttributeAsNOTATION (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNOTATION (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NOTATION simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1367,8 +1289,8 @@
}
xsd__string
- SoapDeSerializer::getAttributeAsString (const AxisChar * pName, const
- AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsString (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
String simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1376,8 +1298,8 @@
}
xsd__normalizedString
- SoapDeSerializer::getAttributeAsNormalizedString (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNormalizedString (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NormalizedString simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1385,8 +1307,8 @@
}
xsd__token
- SoapDeSerializer::getAttributeAsToken (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsToken (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Token simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1394,8 +1316,8 @@
}
xsd__language
- SoapDeSerializer::getAttributeAsLanguage (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsLanguage (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Language simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1403,8 +1325,8 @@
}
xsd__NMTOKEN
- SoapDeSerializer::getAttributeAsNMTOKEN (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNMTOKEN (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NMTOKEN simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1412,8 +1334,8 @@
}
xsd__NMTOKENS
- SoapDeSerializer::getAttributeAsNMTOKENS (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsNMTOKENS (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
NMTOKENS simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1421,8 +1343,8 @@
}
xsd__Name
- SoapDeSerializer::getAttributeAsName (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsName (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Name simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1430,7 +1352,7 @@
}
xsd__NCName
- SoapDeSerializer::getAttributeAsNCName (const AxisChar * pName,
+SoapDeSerializer::getAttributeAsNCName (const AxisChar * pName,
const AxisChar * pNamespace)
{
NCName simpleType;
@@ -1440,8 +1362,8 @@
xsd__ID
- SoapDeSerializer::getAttributeAsID (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsID (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
ID simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1449,8 +1371,8 @@
}
xsd__IDREF
- SoapDeSerializer::getAttributeAsIDREF (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsIDREF (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
IDREF simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1458,7 +1380,7 @@
}
xsd__IDREFS
- SoapDeSerializer::getAttributeAsIDREFS (const AxisChar * pName,
+SoapDeSerializer::getAttributeAsIDREFS (const AxisChar * pName,
const AxisChar * pNamespace)
{
IDREFS simpleType;
@@ -1467,8 +1389,8 @@
}
xsd__ENTITY
- SoapDeSerializer::getAttributeAsENTITY (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsENTITY (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
ENTITY simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1476,8 +1398,8 @@
}
xsd__ENTITIES
- SoapDeSerializer::getAttributeAsENTITIES (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsENTITIES (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
ENTITIES simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1485,8 +1407,8 @@
}
xsd__anyURI
- SoapDeSerializer::getAttributeAsAnyURI (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsAnyURI (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
AnyURI simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1494,8 +1416,8 @@
}
xsd__QName
- SoapDeSerializer::getAttributeAsQName (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsQName (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
XSD_QName simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1503,8 +1425,8 @@
}
xsd__hexBinary *
- SoapDeSerializer::getAttributeAsHexBinary (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsHexBinary (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
HexBinary simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1512,8 +1434,8 @@
}
xsd__base64Binary *
- SoapDeSerializer::getAttributeAsBase64Binary (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsBase64Binary (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Base64Binary simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1521,8 +1443,8 @@
}
xsd__dateTime *
- SoapDeSerializer::getAttributeAsDateTime (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsDateTime (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
DateTime simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1530,8 +1452,8 @@
}
xsd__date *
- SoapDeSerializer::getAttributeAsDate (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsDate (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Date simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1539,8 +1461,8 @@
}
xsd__time *
- SoapDeSerializer::getAttributeAsTime (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsTime (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Time simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1548,8 +1470,8 @@
}
xsd__gDay*
- SoapDeSerializer::getAttributeAsGDay (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsGDay (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
GDay simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1557,8 +1479,8 @@
}
xsd__gMonth*
- SoapDeSerializer::getAttributeAsGMonth (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsGMonth (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
GMonth simpleType;
@@ -1567,8 +1489,8 @@
}
xsd__gMonthDay*
- SoapDeSerializer::getAttributeAsGMonthDay (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsGMonthDay (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
GMonthDay simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1576,8 +1498,8 @@
}
xsd__gYear*
- SoapDeSerializer::getAttributeAsGYear (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsGYear (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
GYear simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1585,8 +1507,8 @@
}
xsd__gYearMonth*
- SoapDeSerializer::getAttributeAsGYearMonth (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsGYearMonth (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
GYearMonth simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1594,8 +1516,8 @@
}
xsd__duration *
- SoapDeSerializer::getAttributeAsDuration (const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getAttributeAsDuration (const AxisChar * pName,
+ const AxisChar * pNamespace)
{
Duration simpleType;
getAttribute(pName, pNamespace, &simpleType);
@@ -1603,221 +1525,208 @@
}
void SoapDeSerializer::getElement (const AxisChar * pName,
- const AxisChar * pNamespace,
- IAnySimpleType * pSimpleType,
- bool isArrayElement)
+ const AxisChar * pNamespace,
+ IAnySimpleType * pSimpleType,
+ bool isArrayElement)
{
if (AXIS_SUCCESS != m_nStatus)
return;
if (RPC_ENCODED == m_nStyle)
{
- bool bNillFound = false;
- m_pNode = m_pParser->next ();
+ bool bNillFound = false;
+ m_pNode = m_pParser->next ();
+
// wrapper node with type info Ex: <i xsi:type="xsd:int">
if (!m_pNode)
- {
return;
- }
- if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
- {
- for (int i = 0; m_pNode->m_pchAttributes[i] && !bNillFound; i += 3)
- {
- string sLocalName = m_pNode->m_pchAttributes[i];
- string sValue = m_pNode->m_pchAttributes[i + 2];
-
- if( strcmp( "nil", sLocalName.c_str()) == 0 &&
- strcmp( "true", sValue.c_str()) == 0)
- {
- bNillFound = true;
-
- }
- }
- }
+
+ if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
+ {
+ for (int i = 0; m_pNode->m_pchAttributes[i] && !bNillFound; i += 3)
+ {
+ string sLocalName = m_pNode->m_pchAttributes[i];
+ string sValue = m_pNode->m_pchAttributes[i + 2];
+
+ if (strcmp( "nil", sLocalName.c_str()) == 0 &&
+ strcmp( "true", sValue.c_str()) == 0)
+ bNillFound = true;
+ }
+ }
if (bNillFound || isArrayElement || (pSimpleType->getType() == getXSDType (m_pNode)))
{
- m_pNode = m_pParser->next (true); /* charactor node */
- if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
- {
- const AxisChar* elementValue = m_pNode->m_pchNameOrValue;
-
- // FJP Added this code for fault finding. If detail is
- // followed by CR/LF or CR/LF then CR/LF then assume that
- // it is not a simple object. As added protection against
- // false findings, the namespace has been set to an invalid
- // value of a single space character.
- if (strlen (elementValue) < 3 && pNamespace != NULL)
- {
- if (*pNamespace == ' ')
- {
- bool bReturn = false;
-
- if (strlen (elementValue) == 0)
- {
- bReturn = true;
- }
- if (strlen (elementValue) == 1 && (*elementValue == '\n' || *elementValue == '\r'))
- {
- bReturn = true;
- }
- if (strlen (elementValue) == 2
- && ((*elementValue == '\n' || *elementValue == '\r')
- && (*(elementValue + 1) == '\n' || *(elementValue + 1) == '\r')))
- {
- bReturn = true;
- }
-
- if (bReturn)
- {
- m_pNode = m_pParser->next (); /* skip end element node too */
- return;
- }
- }
- }
- pSimpleType->deserialize(elementValue);
- m_pNode = m_pParser->next (); /* skip end element node too */
- m_pNode = NULL;
- return;
- }
- else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound ) //xsi:nil="true"
- {
- pSimpleType->deserialize(NULL);
- m_pNode = NULL;
- return;
- }
-
- else if (END_ELEMENT == m_pNode->m_type) // We have an empty string - Jira AXISCPP-93
- {
- pSimpleType->deserialize("");
- m_pNode = m_pParser->next();
- return;
- }
- else
- {
- // simpleType may have xsi:nill="true" */
- //m_pNode = NULL;
- // this is important when deserializing
- // arrays
-
- return;
- }
+ m_pNode = m_pParser->next (true); /* charactor node */
+ if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
+ {
+ const AxisChar* elementValue = m_pNode->m_pchNameOrValue;
+
+ // FJP Added this code for fault finding. If detail is
+ // followed by CR/LF or CR/LF then CR/LF then assume that
+ // it is not a simple object. As added protection against
+ // false findings, the namespace has been set to an invalid
+ // value of a single space character.
+ if (strlen (elementValue) < 3 && pNamespace != NULL)
+ {
+ if (*pNamespace == ' ')
+ {
+ bool bReturn = false;
+
+ if (strlen (elementValue) == 0)
+ bReturn = true;
+
+ if (strlen (elementValue) == 1 && (*elementValue == '\n' || *elementValue == '\r'))
+ bReturn = true;
+
+ if (strlen (elementValue) == 2
+ && ((*elementValue == '\n' || *elementValue == '\r')
+ && (*(elementValue + 1) == '\n' || *(elementValue + 1) == '\r')))
+ bReturn = true;
+
+ if (bReturn)
+ {
+ m_pNode = m_pParser->next (); /* skip end element node too */
+ return;
+ }
+ }
+ }
+
+ pSimpleType->deserialize(elementValue);
+ m_pNode = m_pParser->next (); /* skip end element node too */
+ m_pNode = NULL;
+ return;
+ }
+ else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound ) //xsi:nil="true"
+ {
+ pSimpleType->deserialize(NULL);
+ m_pNode = NULL;
+ return;
+ }
+
+ else if (END_ELEMENT == m_pNode->m_type) // We have an empty string - Jira AXISCPP-93
+ {
+ pSimpleType->deserialize("");
+ m_pNode = m_pParser->next();
+ return;
+ }
+ else
+ {
+ // simpleType may have xsi:nill="true" */
+ //m_pNode = NULL;
+ // this is important when deserializing
+ // arrays
+
+ return;
+ }
}
else
{
-
- /* it is an error if type is different or not present */
+
+ /* it is an error if type is different or not present */
}
}
else
{
- //DOC_LITERAL
-
- if (!m_pNode)
+ //DOC_LITERAL
+
/* if there is an unprocessed node that may be one left from last
* array deserialization
*/
- m_pNode = m_pParser->next ();
-
- /* wrapper node without type info Ex: <i> */
- if (!m_pNode)
- return;
-
- if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
- {
- bool bNillFound = false;
- for (int i = 0; m_pNode->m_pchAttributes[i] && !bNillFound; i += 3)
- {
- string sLocalName = m_pNode->m_pchAttributes[i];
- string sValue = m_pNode->m_pchAttributes[i + 2];
-
- if( strcmp( "nil", sLocalName.c_str()) == 0 &&
- strcmp( "true", sValue.c_str()) == 0)
+ if (!m_pNode)
+ m_pNode = m_pParser->next ();
+
+ /* wrapper node without type info Ex: <i> */
+ if (!m_pNode)
+ return;
+
+ if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
+ {
+ bool bNillFound = false;
+ for (int i = 0; m_pNode->m_pchAttributes[i] && !bNillFound; i += 3)
{
- bNillFound = true;
+ string sLocalName = m_pNode->m_pchAttributes[i];
+ string sValue = m_pNode->m_pchAttributes[i + 2];
+
+ if( strcmp( "nil", sLocalName.c_str()) == 0 &&
+ strcmp( "true", sValue.c_str()) == 0)
+ bNillFound = true;
}
- }
-
- m_pNode = m_pParser->next (true); /* charactor node */
- if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
- {
-
- const AxisChar* elementValue = m_pNode->m_pchNameOrValue;
- // FJP Added this code for fault finding. If detail is
- // followed by CR/LF or CR/LF then CR/LF then assume that
- // it is not a simple object. As added protection against
- // false findings, the namespace has been set to an invalid
- // value of a single space character.
- if (strlen (elementValue) < 3 && pNamespace != NULL)
+
+ m_pNode = m_pParser->next (true); /* charactor node */
+ if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
{
- if (*pNamespace == ' ')
+ const AxisChar* elementValue = m_pNode->m_pchNameOrValue;
+ // FJP Added this code for fault finding. If detail is
+ // followed by CR/LF or CR/LF then CR/LF then assume that
+ // it is not a simple object. As added protection against
+ // false findings, the namespace has been set to an invalid
+ // value of a single space character.
+ if (strlen (elementValue) < 3 && pNamespace != NULL)
{
- bool bReturn = false;
-
- if (strlen (elementValue) == 0)
- {
- bReturn = true;
- }
- if (strlen (elementValue) == 1 && (*elementValue == '\n' || *elementValue == '\r'))
- {
- bReturn = true;
- }
- if (strlen (elementValue) == 2
- && ((*elementValue == '\n' || *elementValue == '\r')
- && (*(elementValue + 1) == '\n' || *(elementValue + 1) == '\r')))
- {
- bReturn = true;
- }
-
- if (bReturn)
+ if (*pNamespace == ' ')
{
- m_pNode = m_pParser->next (); /* skip end element node too */
- return;
+ bool bReturn = false;
+
+ if (strlen (elementValue) == 0)
+ bReturn = true;
+
+ if (strlen (elementValue) == 1 && (*elementValue == '\n' || *elementValue == '\r'))
+ bReturn = true;
+
+ if (strlen (elementValue) == 2
+ && ((*elementValue == '\n' || *elementValue == '\r')
+ && (*(elementValue + 1) == '\n' || *(elementValue + 1) == '\r')))
+ bReturn = true;
+
+ if (bReturn)
+ {
+ m_pNode = m_pParser->next (); /* skip end element node too */
+ return;
+ }
}
}
+
+ pSimpleType->deserialize(elementValue);
+ m_pNode = m_pParser->next (); /* skip end element node too */
+ m_pNode = NULL;
+ /* this is important in doc/lit style when deserializing
+ * arrays
+ */
+ return;
}
-
- pSimpleType->deserialize(elementValue);
- m_pNode = m_pParser->next (); /* skip end element node too */
- m_pNode = NULL;
- /* this is important in doc/lit style when deserializing
- * arrays
- */
- return;
- }
- else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound ) //xsi:nil="true"
- {
- pSimpleType->deserialize(NULL);
- m_pNode = NULL;
- return;
- }
- else if (m_pNode && (END_ELEMENT == m_pNode->m_type) ) // empty tag case <tag/>
- {
- pSimpleType->deserialize("");
-// m_pNode = m_pParser->next();
- m_pNode = NULL;
- return;
- }
+ else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound ) //xsi:nil="true"
+ {
+ pSimpleType->deserialize(NULL);
+ m_pNode = NULL;
+ return;
+ }
+ else if (m_pNode && (END_ELEMENT == m_pNode->m_type) ) // empty tag case <tag/>
+ {
+ pSimpleType->deserialize("");
+ // m_pNode = m_pParser->next();
+ m_pNode = NULL;
+ return;
+ }
+ else
+ {
+ /* simpleType may have xsi:nill="true" */
+ // m_pNode = NULL;
+ /* this is important in doc/lit style when deserializing
+ * arrays
+ */
+ return;
+ }
+ }
else
{
- /* simpleType may have xsi:nill="true" */
-// m_pNode = NULL;
- /* this is important in doc/lit style when deserializing
- * arrays
- */
return;
+ /* Not a must : m_nStatus = AXIS_FAIL; unexpected SOAP stream */
}
- }
- else
- {
- return;
- /* Not a must : m_nStatus = AXIS_FAIL; unexpected SOAP stream */
- }
}
+
m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
return;
-
}
/*
@@ -2224,12 +2133,12 @@
SoapDeSerializer::decodeFromBase64Binary (const AxisChar * pValue)
{
xsd__base64Binary value;
- xsd__int size = apr_base64_decode_len (pValue);
- xsd__unsignedByte * pTemp = new xsd__unsignedByte[size + 1];
+ xsd__int size = apr_base64_decode_len (pValue);
+ xsd__unsignedByte * pTemp = new xsd__unsignedByte[size + 1];
size = apr_base64_decode_binary (pTemp, pValue);
pTemp[size] = 0; // Null terminate so it could used as a string
- value.set(pTemp, size);
- delete [] pTemp;
+ value.set(pTemp, size);
+ delete [] pTemp;
return value;
}
@@ -2237,10 +2146,10 @@
{
xsd__hexBinary value;
xsd__int size = strlen (pValue) / 2;
- xsd__unsignedByte * pTemp = new xsd__unsignedByte[size + 1];
+ xsd__unsignedByte * pTemp = new xsd__unsignedByte[size + 1];
Hex_Decode (pTemp, pValue);
- pTemp[size] = 0; // Null terminate so it could be used as a string
- value.set(pTemp, size);
+ pTemp[size] = 0; // Null terminate so it could be used as a string
+ value.set(pTemp, size);
delete [] pTemp;
return value;
}
@@ -2277,9 +2186,8 @@
{
/* first check whether this is a start element node */
if (START_ELEMENT != pElement->m_type)
- {
return XSD_UNKNOWN;
- }
+
for (int i = 0; pElement->m_pchAttributes[i]; i += 3)
{
if (URI_XSI == URIMapping::getURI (pElement->m_pchAttributes[i + 1]))
@@ -2291,9 +2199,7 @@
if (pNS)
{
if (URI_XSD == URIMapping::getURI (pNS) || URI_ENC == URIMapping::getURI (pNS))
- {
type = TypeMapping::map (qn.localname);
- }
}
qn.mergeQNameString (':');
return type;
@@ -2313,7 +2219,7 @@
SoapDeSerializer::getHeaderBlock ()
{
if (!m_pHeader)
- return NULL;
+ return NULL;
return (HeaderBlock *) m_pHeader->getHeaderBlock (true);
}
@@ -2326,7 +2232,7 @@
SoapDeSerializer::addHeaderBlock (IHeaderBlock * pBlk)
{
if (!m_pHeader)
- m_pHeader = new SoapHeader ();
+ m_pHeader = new SoapHeader ();
m_pHeader->addHeaderBlock ((HeaderBlock *) pBlk);
return AXIS_SUCCESS;
}
@@ -2343,60 +2249,51 @@
/* TODO */
//AxisChar *
- //pBodyContent = (AxisChar *) malloc (1000);
- //Chinthana:Remove malloc
- pBodyContent = new AxisChar[1000];
+ //pBodyContent = (AxisChar *) malloc (1000);
+ //Chinthana:Remove malloc
+ pBodyContent = new AxisChar[1000];
pBodyContent[0] = '\0';
m_pNode = m_pParser->next ();
if ((START_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_BODY])))
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY])))
{
- /* This is done to skip the BODY element declaration */
- m_pNode = m_pParser->next ();
+ /* This is done to skip the BODY element declaration */
+ m_pNode = m_pParser->next ();
}
while (!((END_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_BODY]))))
- {
- strcat (pBodyContent, (AnyElemntUtils::toString (m_pNode)).c_str ());
- }
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY]))))
+ strcat (pBodyContent, (AnyElemntUtils::toString (m_pNode)).c_str ());
return decodeFromBase64Binary (pBodyContent);
-
}
AxisChar *
SoapDeSerializer::getBodyAsChar ()
{
//AxisChar *pBodyContent = (AxisChar *) malloc (1000);
- //Chinthana:Remove malloc
- pBodyContent = new AxisChar[1000];
+ //Chinthana:Remove malloc
+ pBodyContent = new AxisChar[1000];
pBodyContent[0] = '\0';
m_pNode = m_pParser->next ();
if ((START_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_BODY])))
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY])))
{
- /* This is done to skip the BODY element declaration */
- m_pNode = m_pParser->next ();
+ /* This is done to skip the BODY element declaration */
+ m_pNode = m_pParser->next ();
}
while (!((END_ELEMENT == m_pNode->m_type) &&
- (0 == strcmp (m_pNode->m_pchNameOrValue,
- SoapKeywordMapping::map (m_nSoapVersion).
- pchWords[SKW_BODY]))))
- {
- strcat (pBodyContent, (AnyElemntUtils::toString (m_pNode)).c_str ());
- }
+ (0 == strcmp (m_pNode->m_pchNameOrValue,
+ SoapKeywordMapping::map (m_nSoapVersion).pchWords[SKW_BODY]))))
+ strcat (pBodyContent, (AnyElemntUtils::toString (m_pNode)).c_str ());
return pBodyContent;
}
@@ -2419,11 +2316,12 @@
{
int nChars = 100;
char pBuffer[100];
+
if (!m_pInputStream)
- return AXIS_FAIL;
- while (TRANSPORT_IN_PROGRESS ==
- m_pInputStream->getBytes (pBuffer, &nChars));
-
+ return AXIS_FAIL;
+
+ while (TRANSPORT_IN_PROGRESS == m_pInputStream->getBytes (pBuffer, &nChars));
+
return AXIS_SUCCESS;
}
@@ -2444,95 +2342,83 @@
list < AxisString > lstXML;
if (!m_pNode)
- {
- m_pNode = m_pParser->anyNext();
- }
+ m_pNode = m_pParser->anyNext();
while ((END_ELEMENT != m_pNode->m_type) || (tagCount >= 0) || bContinue)
{
// Continue if processing start prefix,
// as we haven't yet found the true start of the tag
if (START_PREFIX == m_pNode->m_type)
- {
[... 526 lines stripped ...]