You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2017/08/30 23:42:46 UTC
svn commit: r1806746 - in /santuario/xml-security-cpp/trunk: ./ xsec/dsig/
xsec/framework/ xsec/tools/cipher/ xsec/tools/threadTest/
xsec/tools/xklient/ xsec/tools/xtest/ xsec/utils/
Author: scantor
Date: Wed Aug 30 23:42:46 2017
New Revision: 1806746
URL: http://svn.apache.org/viewvc?rev=1806746&view=rev
Log:
Assume Xerces 3 - remove XSEC_XERCES_DOMLSSERIALIZER
Modified:
santuario/xml-security-cpp/trunk/configure.ac
santuario/xml-security-cpp/trunk/xsec/dsig/DSIGTransformXSL.cpp
santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in
santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp
santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp
santuario/xml-security-cpp/trunk/xsec/tools/threadTest/threadtest.cpp
santuario/xml-security-cpp/trunk/xsec/tools/xklient/xklient.cpp
santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp
santuario/xml-security-cpp/trunk/xsec/utils/XSECSOAPRequestorSimple.cpp
Modified: santuario/xml-security-cpp/trunk/configure.ac
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/configure.ac?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/configure.ac (original)
+++ santuario/xml-security-cpp/trunk/configure.ac Wed Aug 30 23:42:46 2017
@@ -163,15 +163,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#in
AC_DEFINE([XSEC_XERCES_XMLSTRING_HAS_RELEASE],[1],[Define to 1 if Xerces XMLString has release method.])],
[AC_MSG_RESULT([no])])
-# For Xerces 3.x we now have a stricter DOM L3 implementation
-AC_MSG_CHECKING([whether Xerces DOMImplementationLS has DOMLSSerializer])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
- DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(NULL);
- DOMLSSerializer *ls = ((DOMImplementationLS*)impl)->createLSSerializer();
- ]])],[AC_MSG_RESULT([yes])
- AC_DEFINE([XSEC_XERCES_DOMLSSERIALIZER],[1],[Define to 1 if Xerces has DOMLSSerializer.])],
- [AC_MSG_RESULT([no])])
-
AC_MSG_CHECKING([whether Xerces DOMEntity uses getInputEncoding()])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xercesc/dom/DOM.hpp>]], [[using namespace XERCES_CPP_NAMESPACE;
DOMEntity *t;
Modified: santuario/xml-security-cpp/trunk/xsec/dsig/DSIGTransformXSL.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/dsig/DSIGTransformXSL.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/dsig/DSIGTransformXSL.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/dsig/DSIGTransformXSL.cpp Wed Aug 30 23:42:46 2017
@@ -65,26 +65,16 @@ XSECDomToSafeBuffer::XSECDomToSafeBuffer
MemBufFormatTarget* target = new MemBufFormatTarget;
Janitor<MemBufFormatTarget> j_target(target);
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
DOMLSSerializer* theSerializer = impl->createLSSerializer();
Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
DOMLSOutput *theOutput = impl->createLSOutput();
Janitor<DOMLSOutput> j_theOutput(theOutput);
theOutput->setByteStream(target);
-#else
- DOMWriter* theSerializer = impl->createDOMWriter();
- Janitor<DOMWriter> j_theSerializer(theSerializer);
-#endif
try
{
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
theSerializer->write(node, theOutput);
-#else
- theSerializer->writeNode(target, *node);
-#endif
m_buffer.sbMemcpyIn(0, target->getRawBuffer(), target->getLen());
}
catch(const XMLException&)
Modified: santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECConfig.hpp.in Wed Aug 30 23:42:46 2017
@@ -48,9 +48,6 @@
/* Define to 1 if Xerces DOMEntity has getInputEncoding. */
#undef XSEC_XERCES_DOMENTITYINPUTENCODING
-/* Define to 1 if Xerces has DOMLSSerializer. */
-#undef XSEC_XERCES_DOMLSSERIALIZER
-
/* Define to 1 if Xerces XMLFormatter requires version. */
#undef XSEC_XERCES_FORMATTER_REQUIRES_VERSION
Modified: santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/framework/XSECW32Config.hpp Wed Aug 30 23:42:46 2017
@@ -40,11 +40,6 @@
#if (XERCES_VERSION_MAJOR >= 3)
-/* 3.0 no longer supports DOMWriter, must use DOMLSSerializer instead
-*/
-
-# define XSEC_XERCES_DOMLSSERIALIZER 1
-
/* 3.0 now uses getInputEncoding rather than getEncoding to determine
encoding that was found in input document */
Modified: santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/cipher/cipher.cpp Wed Aug 30 23:42:46 2017
@@ -766,8 +766,6 @@ int evaluate(int argc, char ** argv) {
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(core);
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
@@ -784,16 +782,6 @@ int evaluate(int argc, char ** argv) {
theSerializer->write(doc, theOutput);
-#else
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
- Janitor<DOMWriter> j_theSerializer(theSerializer);
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- theSerializer->writeNode(formatTarget, *doc);
-#endif
cout << endl;
}
Modified: santuario/xml-security-cpp/trunk/xsec/tools/threadTest/threadtest.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/threadTest/threadtest.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/threadTest/threadtest.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/threadTest/threadtest.cpp Wed Aug 30 23:42:46 2017
@@ -108,31 +108,21 @@ void outputDoc (DOMImplementation *impl,
XMLFormatTarget *formatTarget = new StdOutFormatTarget();
- // Output a doc to stdout
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
-
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
-
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
-
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
-
- theSerializer->write(doc, theOutput);
-#else
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
- theSerializer->writeNode(formatTarget, *doc);
-#endif
+ // Output a doc to stdout
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
+ theSerializer->write(doc, theOutput);
cout << endl;
@@ -147,31 +137,21 @@ void addDocToQueue (DOMImplementation *i
MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
-
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
-
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
-
- theSerializer->write(doc, theOutput);
-#else
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
- theSerializer->writeNode(formatTarget, *doc);
-#endif
+ theSerializer->write(doc, theOutput);
// Copy to a new buffer
xsecsize_t len = formatTarget->getLen();
Modified: santuario/xml-security-cpp/trunk/xsec/tools/xklient/xklient.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/xklient/xklient.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/xklient/xklient.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/xklient/xklient.cpp Wed Aug 30 23:42:46 2017
@@ -216,9 +216,6 @@ void outputDoc(DOMDocument * doc) {
cerr << endl;
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
-
- // DOM L3 version as per Xerces 3.0 API
DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
// Get the config so we can set up pretty printing
@@ -234,18 +231,6 @@ void outputDoc(DOMDocument * doc) {
theSerializer->write(doc, theOutput);
-#else
-
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- theSerializer->writeNode(formatTarget, *doc);
-
-#endif
-
cout << endl;
cerr << endl;
Modified: santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/tools/xtest/xtest.cpp Wed Aug 30 23:42:46 2017
@@ -427,39 +427,23 @@ void outputDoc(DOMImplementation * impl,
XMLFormatTarget *formatTarget = new StdOutFormatTarget();
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ // DOM L3 version as per Xerces 3.0 API
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
-
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
-
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
-
-#else
-
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
-#endif
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
+
cerr << endl;
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- theSerializer->write(doc, theOutput);
-#else
- theSerializer->writeNode(formatTarget, *doc);
-#endif
+ theSerializer->write(doc, theOutput);
cout << endl;
@@ -481,36 +465,21 @@ bool reValidateSig(DOMImplementation *im
try {
MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
- theSerializer->write(inDoc,theOutput);
-#else
-
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
-
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
-
- theSerializer->writeNode(formatTarget, *inDoc);
-
-#endif
+ theSerializer->write(inDoc,theOutput);
// Copy to a new buffer
xsecsize_t len = formatTarget->getLen();
@@ -1415,33 +1384,20 @@ count(ancestor-or-self::dsig:Signature)"
MemBufFormatTarget *formatTarget = new MemBufFormatTarget();
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
-
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
-
- theSerializer->write(doc,theOutput);
-#else
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- theSerializer->writeNode(formatTarget, *doc);
-#endif
+ theSerializer->write(doc,theOutput);
// Copy to a new buffer
len = formatTarget->getLen();
Modified: santuario/xml-security-cpp/trunk/xsec/utils/XSECSOAPRequestorSimple.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/utils/XSECSOAPRequestorSimple.cpp?rev=1806746&r1=1806745&r2=1806746&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/utils/XSECSOAPRequestorSimple.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/utils/XSECSOAPRequestorSimple.cpp Wed Aug 30 23:42:46 2017
@@ -110,36 +110,21 @@ char * XSECSOAPRequestorSimple::wrapAndS
XMLCh tempStr[100];
XMLString::transcode("Core", tempStr, 99);
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- // DOM L3 version as per Xerces 3.0 API
- DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
- Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
-
- // Get the config so we can set up pretty printing
- DOMConfiguration *dc = theSerializer->getDomConfig();
- dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
-
- // Now create an output object to format to UTF-8
- DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
- Janitor<DOMLSOutput> j_theOutput(theOutput);
- MemBufFormatTarget *formatTarget = new MemBufFormatTarget;
- Janitor<MemBufFormatTarget> j_formatTarget(formatTarget);
-
- theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- theOutput->setByteStream(formatTarget);
-
-#else
- DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
- Janitor<DOMWriter> j_theSerializer(theSerializer);
-
- theSerializer->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
- if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false))
- theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+ DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
+ Janitor<DOMLSSerializer> j_theSerializer(theSerializer);
+ // Get the config so we can set up pretty printing
+ DOMConfiguration *dc = theSerializer->getDomConfig();
+ dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, false);
+
+ // Now create an output object to format to UTF-8
+ DOMLSOutput *theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+ Janitor<DOMLSOutput> j_theOutput(theOutput);
MemBufFormatTarget *formatTarget = new MemBufFormatTarget;
Janitor<MemBufFormatTarget> j_formatTarget(formatTarget);
-#endif
+ theOutput->setEncoding(MAKE_UNICODE_STRING("UTF-8"));
+ theOutput->setByteStream(formatTarget);
if (m_envelopeType != ENVELOPE_NONE) {
@@ -191,20 +176,12 @@ char * XSECSOAPRequestorSimple::wrapAndS
// OK - Now we have the SOAP request as a document, we serialise to a string buffer
// and return
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- theSerializer->write(doc, theOutput);
-#else
- theSerializer->writeNode(formatTarget, *doc);
-#endif
+ theSerializer->write(doc, theOutput);
doc->release();
}
else {
-#if defined (XSEC_XERCES_DOMLSSERIALIZER)
- theSerializer->write(request, theOutput);
-#else
- theSerializer->writeNode(formatTarget, *request);
-#endif
+ theSerializer->write(request, theOutput);
}
// Now replicate the buffer