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 2009/01/12 07:10:03 UTC
svn commit: r733631 - in /webservices/axis/trunk/c/src: common/
engine/client/ platforms/aix/ platforms/hp-ux/ platforms/os400/
platforms/unix/ platforms/windows/ soap/ soap/xsd/
Author: nadiramra
Date: Sun Jan 11 22:10:02 2009
New Revision: 733631
URL: http://svn.apache.org/viewvc?rev=733631&view=rev
Log:
AXISCPP-1061 - Client does not work when running ebcdic turkish code page
Modified:
webservices/axis/trunk/c/src/common/ArrayBean.cpp
webservices/axis/trunk/c/src/common/BasicTypeSerializer.cpp
webservices/axis/trunk/c/src/engine/client/Call.cpp
webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp
webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp
webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.cpp
webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp
webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp
webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp
webservices/axis/trunk/c/src/soap/Attribute.cpp
webservices/axis/trunk/c/src/soap/ComplexElement.cpp
webservices/axis/trunk/c/src/soap/HeaderBlock.cpp
webservices/axis/trunk/c/src/soap/Namespace.cpp
webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
webservices/axis/trunk/c/src/soap/SoapMethod.cpp
webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.cpp
webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.hpp
Modified: webservices/axis/trunk/c/src/common/ArrayBean.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/common/ArrayBean.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/ArrayBean.cpp (original)
+++ webservices/axis/trunk/c/src/common/ArrayBean.cpp Sun Jan 11 22:10:02 2009
@@ -128,7 +128,7 @@
pSZ.serialize("<", pPrefix, ":", m_ItemName.c_str(), NULL);
if (blnIsNewPrefix)
{
- pSZ.serialize(" xmlns:", pPrefix, "=\"", pNamespace, "\"", NULL);
+ pSZ.serialize(" xmlns:", pPrefix, "=", PLATFORM_DOUBLE_QUOTE_S, pNamespace, PLATFORM_DOUBLE_QUOTE_S, NULL);
}
}
else
Modified: webservices/axis/trunk/c/src/common/BasicTypeSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/common/BasicTypeSerializer.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/BasicTypeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/common/BasicTypeSerializer.cpp Sun Jan 11 22:10:02 2009
@@ -87,16 +87,19 @@
{
m_sSZ += " xmlns:";
m_sSZ += pPrefix;
- m_sSZ += "=\"";
+ m_sSZ += "=";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
m_sSZ += pNamespace;
- m_sSZ += "\"";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
}
if (RPC_ENCODED == m_nStyle)
{
- m_sSZ += " xsi:type=\"xsd:";
+ m_sSZ += " xsi:type=";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
+ m_sSZ += "xsd:";
m_sSZ += basicTypeStr (pSimpleType->getType());
- m_sSZ += "\"";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
}
m_sSZ += ">";
@@ -117,11 +120,16 @@
{
m_sSZ += " xmlns:";
m_sSZ += pPrefix;
- m_sSZ += "=\"";
+ m_sSZ += "=";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
m_sSZ += pNamespace;
- m_sSZ += "\"";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
}
- m_sSZ += " xsi:nil=\"true\">";
+ m_sSZ += " xsi:nil=";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
+ m_sSZ += "true";
+ m_sSZ += PLATFORM_DOUBLE_QUOTE_S;
+ m_sSZ += ">";
}
else
m_sSZ += pSimpleType->serialize();
Modified: webservices/axis/trunk/c/src/engine/client/Call.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/Call.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Call.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Call.cpp Sun Jan 11 22:10:02 2009
@@ -451,7 +451,7 @@
if( tempvalue != NULL)
{
- sprintf( tempvalue, "\"%s\"", value);
+ sprintf( tempvalue, "%s%s%s", PLATFORM_DOUBLE_QUOTE_S, value, PLATFORM_DOUBLE_QUOTE_S);
m_pTransport->setTransportProperty(type, tempvalue);
delete [] tempvalue;
}
Modified: webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/aix/PlatformSpecificAIX.hpp Sun Jan 11 22:10:02 2009
@@ -73,6 +73,15 @@
#define PLATFORM_STRTOASC( x ) ( x )
#define PLATFORM_ASCTOSTR( x ) ( x )
+// Turkish double quote in EBCDIC is not invariant (i.e. the hexadecimal
+// value for double quote is different in turkish locale than when running
+// in english locale). This, when using double quotes we must reference the
+// following, which will be set to proper value on EBCDIC-based systems.
+#define PLATFORM_DOUBLE_QUOTE_S "\""
+#define PLATFORM_DOUBLE_QUOTE_C '\"'
+
+#define PLATFORM_XML_ENTITY_REFERENCE_CHARS_S "<>&\"\'"
+
// =============================================================
// Miscellaneous
// =============================================================
Modified: webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/hp-ux/PlatformSpecificHP-UX.hpp Sun Jan 11 22:10:02 2009
@@ -76,6 +76,11 @@
#define PLATFORM_STRTOASC( x ) ( x )
#define PLATFORM_ASCTOSTR( x ) ( x )
+#define PLATFORM_DOUBLE_QUOTE_S "\""
+#define PLATFORM_DOUBLE_QUOTE_C '\"'
+
+#define PLATFORM_XML_ENTITY_REFERENCE_CHARS_S "<>&\"\'"
+
// =============================================================
// Miscellaneous
// =============================================================
Modified: webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.cpp (original)
+++ webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.cpp Sun Jan 11 22:10:02 2009
@@ -31,6 +31,65 @@
#include <iconv.h> // iconv_t, iconv()
#include <qtqiconv.h> // QtqCode_T, QtqIconvOpen()
#include <errno.h>
+#include <qwcrtvca.h> // Retrieve job's ccsid API prototype
+
+
+
+/**********************************************************************/
+/* Function: */
+/* retrieveJobCcsid */
+/* Description: */
+/* Retrieves the ccsid of the current job. */
+/* If the current job's ccsid is 65535, the job's default ccsid is */
+/* returned. */
+/* If the ccsid cannot be retrieved (error occurs), -1 is returned. */
+/* Return: */
+/* int status of call. if 0, success; -1 failure. */
+/**********************************************************************/
+
+#define RTV_CCSID_ATTR_LEN 512
+
+static int retrieveJobCcsid(int *ccsid, char *langID)
+{
+ char receiverVariable[RTV_CCSID_ATTR_LEN];
+ char format[8] = {'R', 'T', 'V', 'C', '0', '1', '0', '0'};
+ int numberOfAttributes = 3;
+ int attributeKeys[3] = {QWCA_KEY_CCSID, QWCA_KEY_DEFAULTCCSID, QWCA_KEY_LANGID};
+ Qwc_RTVC_Attribute_Data_t *attribute;
+ int defaultCcsid;
+ char errorCode[8];
+ int i;
+ memset(errorCode, 0x00, sizeof(errorCode));
+
+#pragma exception_handler(RetrieveJobCcsidError,0,_C1_ALL,_C2_ALL,_CTLA_HANDLE)
+ QWCRTVCA(receiverVariable,RTV_CCSID_ATTR_LEN,format,numberOfAttributes,attributeKeys,&errorCode);
+#pragma disable_handler
+ if (((Qwc_RTVC0100_t *)receiverVariable)->Number_Fields_Rtnd != 3)
+ {
+ /* Unable to retrieve the ccsid information */
+ return -1;
+ }
+ /* Retrieved ccsid, default CCSID and language ID */
+ attribute = (Qwc_RTVC_Attribute_Data_t *)(receiverVariable + sizeof(int));
+ for (i=0; i < 3; i++)
+ {
+ if (attribute->Key_Field == QWCA_KEY_CCSID)
+ *ccsid = *(int *)((char *)attribute + sizeof(Qwc_RTVC_Attribute_Data_t));
+ else if (attribute->Key_Field == QWCA_KEY_DEFAULTCCSID)
+ defaultCcsid = *(int *)((char *)attribute + sizeof(Qwc_RTVC_Attribute_Data_t));
+ else
+ strncpy(langID, ((char *)attribute + sizeof(Qwc_RTVC_Attribute_Data_t)), 3);
+ attribute = (Qwc_RTVC_Attribute_Data_t *)((char *)attribute + attribute->Length_Field_Info_Rtnd);
+ }
+ if (*ccsid == 65535)
+ *ccsid = defaultCcsid;
+
+ return 0;
+
+ RetrieveJobCcsidError:
+ return -1;
+}
+
typedef int HMODULE;
@@ -337,4 +396,34 @@
return toBuf;
}
+char PLATFORM_DOUBLE_QUOTE_S[] = "\"";
+char PLATFORM_DOUBLE_QUOTE_C = '\"';
+char PLATFORM_XML_ENTITY_REFERENCE_CHARS_S[] = "<>&\"\'";
+
+static int initializePlatform()
+{
+ char *language= "En_US";
+ char langID[3] = {'E' , 'N' , 'U'};
+ int jobCCSID = 37;
+
+ int rc = retrieveJobCcsid(&jobCCSID, langID);
+ if (rc == 0)
+ {
+ // double quote character is not invariant when running
+ // turkish ccsid (1026). That is, the hexadecimal value
+ // of double quote is different than when running in
+ // any other language. So use correct double quote character.
+ if (jobCCSID == 1026)
+ {
+ strcpy(PLATFORM_DOUBLE_QUOTE_S, "\xFC");
+ PLATFORM_DOUBLE_QUOTE_C = '\xFC';
+ strcpy(PLATFORM_XML_ENTITY_REFERENCE_CHARS_S, "<>&\xFC\'");
+ }
+ }
+
+ return rc;
+}
+
+static int platformRc = initializePlatform();
+
Modified: webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/os400/PlatformSpecificOS400.hpp Sun Jan 11 22:10:02 2009
@@ -73,7 +73,7 @@
// STRTOASC is to translate single byte 'native' character representation to ASCII
// ASCTOSTR is to translate single byte ascii representation to 'native' character (EBCDIC)
-// CANNOT be used with constants
+// CANNOT be used with constants.
extern char* strtoasc( char* );
extern char* asctostr( char* );
#define PLATFORM_STRTOASC( x ) strtoasc( (char*)(x) )
@@ -85,6 +85,16 @@
// Following returns a buffer that must be free'ed by caller.
extern char *toUTF8(char *b, int len);
+// Turkish double quote in EBCDIC is not invariant (i.e. the hexadecimal
+// value for double quote is different in turkish locale than when running
+// in english locale). This, when using double quotes we must reference the
+// following, which will be set to proper value on EBCDIC-based systems.
+
+extern char PLATFORM_DOUBLE_QUOTE_S[];
+extern char PLATFORM_DOUBLE_QUOTE_C;
+
+extern char PLATFORM_XML_ENTITY_REFERENCE_CHARS_S[];
+
// =============================================================
// Miscellaneous
// =============================================================
Modified: webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/unix/PlatformSpecificUnix.hpp Sun Jan 11 22:10:02 2009
@@ -77,6 +77,11 @@
#define PLATFORM_STRTOASC( x ) ( x )
#define PLATFORM_ASCTOSTR( x ) ( x )
+#define PLATFORM_DOUBLE_QUOTE_S "\""
+#define PLATFORM_DOUBLE_QUOTE_C '\"'
+
+#define PLATFORM_XML_ENTITY_REFERENCE_CHARS_S "<>&\"\'"
+
// =============================================================
// Miscellaneous
// =============================================================
Modified: webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp (original)
+++ webservices/axis/trunk/c/src/platforms/windows/PlatformSpecificWindows.hpp Sun Jan 11 22:10:02 2009
@@ -109,6 +109,11 @@
#define PLATFORM_STRTOASC( x ) ( x )
#define PLATFORM_ASCTOSTR( x ) ( x )
+#define PLATFORM_DOUBLE_QUOTE_S "\""
+#define PLATFORM_DOUBLE_QUOTE_C '\"'
+
+#define PLATFORM_XML_ENTITY_REFERENCE_CHARS_S "<>&\"\'"
+
// =============================================================
// Miscellaneous
// =============================================================
Modified: webservices/axis/trunk/c/src/soap/Attribute.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/Attribute.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/Attribute.cpp (original)
+++ webservices/axis/trunk/c/src/soap/Attribute.cpp Sun Jan 11 22:10:02 2009
@@ -281,7 +281,7 @@
pSZ.serialize(m_prefix.c_str(), ":", NULL);
}
- pSZ.serialize(m_localname.c_str(), "=\"", m_value.c_str(), "\"", NULL);
+ pSZ.serialize(m_localname.c_str(), "=", PLATFORM_DOUBLE_QUOTE_S, m_value.c_str(), PLATFORM_DOUBLE_QUOTE_S, NULL);
intStatus= AXIS_SUCCESS;
}
@@ -321,13 +321,13 @@
if (blnIsNewNamespace)
{
lstTmpNameSpaceStack.push_back((AxisChar*)m_uri.c_str());
- pSZ.serialize("xmlns:", m_prefix.c_str(), "=\"", m_uri.c_str(), "\" ", NULL);
+ pSZ.serialize("xmlns:", m_prefix.c_str(), "=", PLATFORM_DOUBLE_QUOTE_S, m_uri.c_str(), PLATFORM_DOUBLE_QUOTE_S, " ", NULL);
}
pSZ.serialize(m_prefix.c_str(), ":", NULL);
}
- pSZ.serialize(m_localname.c_str(), "=\"", m_value.c_str(), "\"", NULL);
+ pSZ.serialize(m_localname.c_str(), "=", PLATFORM_DOUBLE_QUOTE_S, m_value.c_str(), PLATFORM_DOUBLE_QUOTE_S, NULL);
intStatus= AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/soap/ComplexElement.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/ComplexElement.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/ComplexElement.cpp (original)
+++ webservices/axis/trunk/c/src/soap/ComplexElement.cpp Sun Jan 11 22:10:02 2009
@@ -231,8 +231,7 @@
if ((NULL!=m_pachPrefix) && (strlen(m_pachPrefix)!=0) &&
(NULL!=m_pachURI) && (strlen(m_pachURI)!=0))
{
- pSZ.serialize(" xmlns:", m_pachPrefix, "=\"", m_pachURI, "\"",
- NULL);
+ pSZ.serialize(" xmlns:", m_pachPrefix, "=", PLATFORM_DOUBLE_QUOTE_S, m_pachURI, PLATFORM_DOUBLE_QUOTE_S, NULL);
}
pSZ.serialize(">", NULL);
iStatus= serializeChildren(pSZ);
@@ -317,8 +316,7 @@
( (m_pachURI != NULL) && (strlen(m_pachURI) != 0)) &&
(blnIsNewNamespace))
{
- pSZ.serialize(" xmlns:", m_pachPrefix, "=\"", m_pachURI, "\"",
- NULL);
+ pSZ.serialize(" xmlns:", m_pachPrefix, "=", PLATFORM_DOUBLE_QUOTE_S, m_pachURI, PLATFORM_DOUBLE_QUOTE_S, NULL);
}
iStatus= attrSerialize(pSZ, lstTmpNameSpaceStack);
Modified: webservices/axis/trunk/c/src/soap/HeaderBlock.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/HeaderBlock.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/HeaderBlock.cpp (original)
+++ webservices/axis/trunk/c/src/soap/HeaderBlock.cpp Sun Jan 11 22:10:02 2009
@@ -277,7 +277,7 @@
pSZ.serialize(m_sPrefix.c_str(), ":", m_localname.c_str(), NULL);
if (blnIsNewNamespace)
- pSZ.serialize(" xmlns:", m_sPrefix.c_str(), "=\"", m_uri.c_str(), "\"", NULL);
+ pSZ.serialize(" xmlns:", m_sPrefix.c_str(), "=", PLATFORM_DOUBLE_QUOTE_S, m_uri.c_str(), PLATFORM_DOUBLE_QUOTE_S, NULL);
iStatus= attrSerialize(pSZ, lstTmpNameSpaceStack);
if(iStatus==AXIS_FAIL)
Modified: webservices/axis/trunk/c/src/soap/Namespace.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/Namespace.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/Namespace.cpp (original)
+++ webservices/axis/trunk/c/src/soap/Namespace.cpp Sun Jan 11 22:10:02 2009
@@ -86,7 +86,7 @@
*/
lstTmpNameSpaceStack.push_back((AxisChar*)m_asURI.c_str());
- pSZ.serialize(" xmlns:", m_asPrefix.c_str(), "=\"", m_asURI.c_str(), "\"", NULL);
+ pSZ.serialize(" xmlns:", m_asPrefix.c_str(), "=", PLATFORM_DOUBLE_QUOTE_S, m_asURI.c_str(), PLATFORM_DOUBLE_QUOTE_S, NULL);
return AXIS_SUCCESS;
}
Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Sun Jan 11 22:10:02 2009
@@ -2203,9 +2203,10 @@
nsDecls += ":";
nsDecls += m_pNode->m_pchNameOrValue;
}
- nsDecls += "=\"";
+ nsDecls += "=";
+ nsDecls += PLATFORM_DOUBLE_QUOTE_S;
nsDecls += m_pNode->m_pchNamespace;
- nsDecls += "\"";
+ nsDecls += PLATFORM_DOUBLE_QUOTE_S;
}
else if (CHARACTER_ELEMENT != m_pNode->m_type)
{
@@ -2330,9 +2331,10 @@
}
xmlStr += node->m_pchAttributes[j];
- xmlStr += "=\"";
+ xmlStr += "=";
+ xmlStr += PLATFORM_DOUBLE_QUOTE_S;
xmlStr += node->m_pchAttributes[j + 2];
- xmlStr += "\"";
+ xmlStr += PLATFORM_DOUBLE_QUOTE_S;
}
else
break;
Modified: webservices/axis/trunk/c/src/soap/SoapMethod.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapMethod.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapMethod.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapMethod.cpp Sun Jan 11 22:10:02 2009
@@ -117,7 +117,7 @@
{
pSZ.serialize("<", m_strPrefix.c_str(), ":", m_strLocalname.c_str(),
" xmlns:", m_strPrefix.c_str(),
- "=\"", m_strUri.c_str(), "\"", NULL);
+ "=", PLATFORM_DOUBLE_QUOTE_S, m_strUri.c_str(), PLATFORM_DOUBLE_QUOTE_S, NULL);
list<AxisChar*> lstTmpNameSpaceStack;
@@ -180,7 +180,7 @@
// Serialize an empty element request.
pSZ.serialize("<", nsToUse, ":", m_strLocalname.c_str(),
- " xmlns:", nsToUse, "=\"", m_strUri.c_str(), "\" />", NULL);
+ " xmlns:", nsToUse, "=", PLATFORM_DOUBLE_QUOTE_S, m_strUri.c_str(), PLATFORM_DOUBLE_QUOTE_S, " />", NULL);
// remove the current NS from the NS stack
pSZ.removeNamespacePrefix(m_strUri.c_str());
Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapSerializer.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.cpp Sun Jan 11 22:10:02 2009
@@ -1202,16 +1202,11 @@
{
serialize( "<",
pName,
- " xsi:type=\"",
- pPrefix,
- ":",
- pName,
- "\" xmlns:",
- pPrefix,
- "=\"",
- pNamespace,
- "\">",
- NULL);
+ " xsi:type=",
+ PLATFORM_DOUBLE_QUOTE_S, pPrefix, ":", pName, PLATFORM_DOUBLE_QUOTE_S,
+ " xmlns:",
+ pPrefix, "=",
+ PLATFORM_DOUBLE_QUOTE_S, pNamespace, PLATFORM_DOUBLE_QUOTE_S, ">", NULL);
}
else
serialize( "<", pName, ">", NULL);
Modified: webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.cpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.cpp (original)
+++ webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.cpp Sun Jan 11 22:10:02 2009
@@ -20,6 +20,7 @@
AXIS_CPP_NAMESPACE_START
+
IAnySimpleType::
IAnySimpleType():m_Buf(NULL), m_isNil(true)
{
@@ -97,7 +98,7 @@
if (value.empty ())
return value;
- unsigned long nPos = value.find_first_of (XML_ENTITY_REFERENCE_CHARS);
+ unsigned long nPos = value.find_first_of (PLATFORM_XML_ENTITY_REFERENCE_CHARS_S);
if (AxisString::npos == nPos)
return value;
@@ -115,7 +116,7 @@
if (inValue.empty ())
return;
- unsigned long nPos = inValue.find_first_of (XML_ENTITY_REFERENCE_CHARS);
+ unsigned long nPos = inValue.find_first_of (PLATFORM_XML_ENTITY_REFERENCE_CHARS_S);
if (AxisString::npos == nPos)
{
outValue = inValue;
@@ -125,36 +126,40 @@
// Loop through character string, replacing any entity characters
unsigned long nOldIdx = 0;
while (AxisString::npos != nPos)
- {
- switch (inValue.at (nPos))
- {
- case LESSER_THAN_CHAR: // Process < character
- outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
- outValue.append (ENCODED_LESSER_STR);
- break;
- case GREATER_THAN_CHAR: // Process > character
- outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
- outValue.append (ENCODED_GREATER_STR);
- break;
- case AMPERSAND_CHAR: // Process & character
- outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
- outValue.append (ENCODED_AMPERSAND_STR);
- break;
- case DOUBLE_QUOTE_CHAR: // Process " character
- outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
- outValue.append (ENCODED_DBL_QUOTE_STR);
- break;
- case SINGLE_QUOTE_CHAR: // Process ' character
- outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
- outValue.append (ENCODED_SGL_QUOTE_STR);
- break;
+ {
+ char c = inValue.at (nPos);
+
+ if (c == '<')
+ {
+ outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
+ outValue.append (ENCODED_LESSER_STR);
+ }
+ else if (c == '>')
+ {
+ outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
+ outValue.append (ENCODED_GREATER_STR);
+ }
+ else if (c == '&')
+ {
+ outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
+ outValue.append (ENCODED_AMPERSAND_STR);
+ }
+ else if (c == PLATFORM_DOUBLE_QUOTE_C)
+ {
+ outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
+ outValue.append (ENCODED_DBL_QUOTE_STR);
+ }
+ else if (c == '\'')
+ {
+ outValue.append (inValue.substr (nOldIdx, nPos - nOldIdx));
+ outValue.append (ENCODED_SGL_QUOTE_STR);
}
// Get old position
nOldIdx = ++nPos;
// Find the next entity reference characters from previous found position
- nPos = inValue.find_first_of (XML_ENTITY_REFERENCE_CHARS, nPos);
+ nPos = inValue.find_first_of (PLATFORM_XML_ENTITY_REFERENCE_CHARS_S, nPos);
}
// Apend the remaining data
Modified: webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.hpp?rev=733631&r1=733630&r2=733631&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.hpp (original)
+++ webservices/axis/trunk/c/src/soap/xsd/IAnySimpleType.hpp Sun Jan 11 22:10:02 2009
@@ -33,9 +33,6 @@
AXIS_CPP_NAMESPACE_START
-/* Entity reference characters */
-const AxisChar XML_ENTITY_REFERENCE_CHARS[] = "<>&\"\'";
-
/* Encoded string for less than character */
const AxisChar ENCODED_LESSER_STR[] = "<";
@@ -153,18 +150,6 @@
*/
Pattern* getPattern();
- /**
- * Reserved Characters
- */
- enum
- {
- GREATER_THAN_CHAR = '>', /* Greater than character */
- LESSER_THAN_CHAR = '<', /* Less than character */
- SINGLE_QUOTE_CHAR = '\'', /* Single quotation character */
- DOUBLE_QUOTE_CHAR = '\"', /* Double quotation character */
- AMPERSAND_CHAR = '&' /* Ampersand character */
- };
-
AxisChar* m_Buf;
private: