[mapguide-commits] r7268 - in sandbox/jng/streaming: Common/MapGuideCommon/Services Common/PlatformBase/Services Server/src/Services/Feature Web/src/ApacheAgent Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Dec 14 06:17:47 PST 2012


Author: jng
Date: 2012-12-14 06:17:47 -0800 (Fri, 14 Dec 2012)
New Revision: 7268

Modified:
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.cpp
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.h
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.h
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.h
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp
   sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.h
   sandbox/jng/streaming/Common/PlatformBase/Services/Reader.h
   sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.cpp
   sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.h
   sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.cpp
   sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.h
   sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
   sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.h
   sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.cpp
   sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.h
   sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.cpp
   sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.h
   sandbox/jng/streaming/Web/src/HttpHandler/HttpExecuteSqlQuery.cpp
   sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeatures.cpp
   sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeaturesSpatially.cpp
Log:
#2194: First cut of streamed http responses. This submission adds new abstract methods to the MgReader class to support outputting various parts of the XML response (varies from reader to reader):

 - The response content start
 - The response content header
 - The response body start
 - The content of each individual reader record
 - The response body end
 - The response content end

The associated operations in the HttpHandler now do not call ToXml() on the respective readers (which would've fully buffered out the reader contents). Instead, such operations store the reader itself as the operation result.

The actual mapagent handler (currently ApacheAgent) similarly does not call ToXml() on the reader. Instead we write out the reader contents as we're iterating through the reader. Because we don't know the full content size up-front, we don't (and can't) specify a Content-Length response header. Instead we use chunked transfer encoding to start streaming out the reader content.

The results of this is readily apparent. Observing the memory usage of a SELECTFEATURES operation against the Sheboygan parcels (no filter, all 17k results):

 * Current implementation: ~50mb spike before steadying. This is the ToXml() internal buffering to a string that's causing the spike.
 * This submission: 500k-1mb variation. This is the streaming chunked response. The variation is due to the varying size of each individual record being iterated through.

Server implementations of MgReader do not require XML output so such methods throw exceptions when called (they'll never be called server-side)

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.cpp
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -701,6 +701,50 @@
     str += "</PropertySet>";
 }
 
+void MgProxyDataReader::ResponseStartUtf8(string& str)
+{
+	str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+    str += "<PropertySet>";
+}
+
+void MgProxyDataReader::ResponseEndUtf8(string& str)
+{
+	str += "</PropertySet>";
+}
+
+void MgProxyDataReader::BodyStartUtf8(string& str)
+{
+	str += "<Properties>";
+}
+
+void MgProxyDataReader::BodyEndUtf8(string& str)
+{
+	str += "</Properties>";
+}
+
+void MgProxyDataReader::HeaderToStringUtf8(string& str)
+{
+    if (NULL != (MgPropertyDefinitionCollection*)m_propDefCol)
+	{
+		m_propDefCol->ToXml(str);
+	}
+}
+
+void MgProxyDataReader::CurrentToStringUtf8(string& str)
+{
+	if (NULL != (MgBatchPropertyCollection*)m_set)
+	{
+		Ptr<MgPropertyCollection> propCol = m_set->GetItem(m_currRecord-1);
+		INT32 cnt = propCol->GetCount();
+		if (propCol != NULL && cnt > 0)
+		{
+			str += "<PropertyCollection>";
+			propCol->ToXml(str, false);
+			str += "</PropertyCollection>";
+		}
+	}
+}
+
 void MgProxyDataReader::SetService(MgFeatureService* service)
 {
     CHECKNULL(service, L"MgProxyDataReader.SetService");

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.h
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyDataReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -515,6 +515,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Gets the string value of the specified property. No conversion is

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -851,6 +851,49 @@
     }
 }
 
+void MgProxyFeatureReader::ResponseStartUtf8(string& str)
+{
+	str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+    str += "<FeatureSet>";
+}
+
+void MgProxyFeatureReader::ResponseEndUtf8(string& str)
+{
+	str += "</FeatureSet>";
+}
+
+void MgProxyFeatureReader::BodyStartUtf8(string& str)
+{
+	str += "<Features>";
+}
+
+void MgProxyFeatureReader::BodyEndUtf8(string& str)
+{
+	str += "</Features>";
+}
+
+void MgProxyFeatureReader::HeaderToStringUtf8(string& str)
+{
+	Ptr<MgClassDefinition> classDef = this->GetClassDefinition();
+    if (classDef != NULL)
+	{
+		classDef->ToXml(str);
+	}
+}
+
+void MgProxyFeatureReader::CurrentToStringUtf8(string& str)
+{
+	if (NULL != (MgFeatureSet*)m_set)
+	{
+		Ptr<MgPropertyCollection> propCol = m_set->GetFeatureAt(m_currRecord-1);
+		INT32 cnt = propCol->GetCount();
+		if (propCol != NULL && cnt > 0)
+		{
+			propCol->ToFeature(str);
+		}
+	}
+}
+
 void MgProxyFeatureReader::SetService(MgFeatureService* service)
 {
     CHECKNULL(service, L"MgProxyFeatureReader.SetService");

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.h
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyFeatureReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -488,6 +488,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Gets the definition of the object currently being read. If the user

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -786,6 +786,49 @@
     }
 }
 
+void MgProxyGwsFeatureReader::ResponseStartUtf8(string& str)
+{
+	str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+    str += "<FeatureSet>";
+}
+
+void MgProxyGwsFeatureReader::ResponseEndUtf8(string& str)
+{
+	str += "</FeatureSet>";
+}
+
+void MgProxyGwsFeatureReader::BodyStartUtf8(string& str)
+{
+	str += "<Features>";
+}
+
+void MgProxyGwsFeatureReader::BodyEndUtf8(string& str)
+{
+	str += "</Features>";
+}
+
+void MgProxyGwsFeatureReader::HeaderToStringUtf8(string& str)
+{
+	Ptr<MgClassDefinition> classDef = this->GetClassDefinition();
+    if (classDef != NULL)
+	{
+		classDef->ToXml(str);
+	}
+}
+
+void MgProxyGwsFeatureReader::CurrentToStringUtf8(string& str)
+{
+	if (NULL != (MgFeatureSet*)m_set)
+	{
+		Ptr<MgPropertyCollection> propCol = m_set->GetFeatureAt(m_currRecord-1);
+		INT32 cnt = propCol->GetCount();
+		if (propCol != NULL && cnt > 0)
+		{
+			propCol->ToFeature(str);
+		}
+	}
+}
+
 void MgProxyGwsFeatureReader::SetService(MgFeatureService* service)
 {
     CHECKNULL(service, L"MgProxyGwsFeatureReader.SetService");

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.h
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxyGwsFeatureReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -462,6 +462,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Gets the definition of the object currently being read. If the user

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -697,6 +697,48 @@
     str += "</RowSet>";
 }
 
+void MgProxySqlDataReader::ResponseStartUtf8(string& str)
+{
+	str += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+    str += "<RowSet>";
+}
+
+void MgProxySqlDataReader::ResponseEndUtf8(string& str)
+{
+	str += "</RowSet>";
+}
+
+void MgProxySqlDataReader::BodyStartUtf8(string& str)
+{
+	str += "<Rows>";
+}
+
+void MgProxySqlDataReader::BodyEndUtf8(string& str)
+{
+	str += "</Rows>";
+}
+
+void MgProxySqlDataReader::HeaderToStringUtf8(string& str)
+{
+    if (NULL != (MgPropertyDefinitionCollection*)m_propDefCol)
+	{
+		m_propDefCol->ToColumnDefinitions(str);
+	}
+}
+
+void MgProxySqlDataReader::CurrentToStringUtf8(string& str)
+{
+	if (NULL != (MgBatchPropertyCollection*)m_set)
+	{
+		Ptr<MgPropertyCollection> propCol = m_set->GetItem(m_currRecord-1);
+		INT32 cnt = propCol->GetCount();
+		if (propCol != NULL && cnt > 0)
+		{
+			propCol->ToRow(str);
+		}
+	}
+}
+
 void MgProxySqlDataReader::SetService(MgFeatureService* service)
 {
     CHECKNULL(service, L"MgProxySqlDataReader.SetService");

Modified: sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.h
===================================================================
--- sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/MapGuideCommon/Services/ProxySqlDataReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -485,6 +485,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Gets the string value of the specified property. No conversion is

Modified: sandbox/jng/streaming/Common/PlatformBase/Services/Reader.h
===================================================================
--- sandbox/jng/streaming/Common/PlatformBase/Services/Reader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Common/PlatformBase/Services/Reader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -1138,6 +1138,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	virtual void ResponseStartUtf8(string& str) = 0;
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	virtual void ResponseEndUtf8(string& str) = 0;
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	virtual void BodyStartUtf8(string& str) = 0;
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	virtual void BodyEndUtf8(string& str) = 0;
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+    virtual void HeaderToStringUtf8(string& str) = 0;
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    virtual void CurrentToStringUtf8(string& str) = 0;
+
     //////////////////////////////////////////////////////////////////
     /// \brief
     /// Gets the string value of the specified property. No conversion is

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.cpp
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -1512,6 +1512,42 @@
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
+void MgServerDataReader::ResponseStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerDataReader.ResponseStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerDataReader::ResponseEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerDataReader.ResponseEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerDataReader::BodyStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerDataReader.BodyStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerDataReader::BodyEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerDataReader.BodyEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerDataReader::HeaderToStringUtf8(string& str)
+{
+    throw new MgInvalidOperationException(L"MgServerDataReader.HeaderToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerDataReader::CurrentToStringUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerDataReader.CurrentToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
 MgByteReader* MgServerDataReader::GetRaster(INT32 xSize, INT32 ySize, STRING rasterPropName)
 {
     CHECKNULL(m_dataReader, L"MgServerDataReader.GetRaster");

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.h
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerDataReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -436,6 +436,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// <summary>
     /// Gets the string value of the specified property. No conversion is

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.cpp
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -865,7 +865,42 @@
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
+void MgServerFeatureReader::ResponseStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerFeatureReader.ResponseStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
 
+void MgServerFeatureReader::ResponseEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerFeatureReader.ResponseEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerFeatureReader::BodyStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerFeatureReader.BodyStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerFeatureReader::BodyEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerFeatureReader.BodyEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerFeatureReader::HeaderToStringUtf8(string& str)
+{
+    throw new MgInvalidOperationException(L"MgServerFeatureReader.HeaderToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerFeatureReader::CurrentToStringUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerFeatureReader.CurrentToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// Releases all the resources of feature reader.

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.h
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerFeatureReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -401,6 +401,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// <summary>
     /// Gets the definition of the object currently being read. If the user

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -1234,7 +1234,42 @@
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
+void MgServerGwsFeatureReader::ResponseStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.ResponseStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
 
+void MgServerGwsFeatureReader::ResponseEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.ResponseEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerGwsFeatureReader::BodyStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.BodyStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerGwsFeatureReader::BodyEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.BodyEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerGwsFeatureReader::HeaderToStringUtf8(string& str)
+{
+    throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.HeaderToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerGwsFeatureReader::CurrentToStringUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerGwsFeatureReader.CurrentToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// Releases all the resources of feature reader.

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.h
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerGwsFeatureReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -393,6 +393,66 @@
     /// </summary>
     void Close();
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// <summary>
     /// Serializes all features into an XML.

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.cpp
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -1352,6 +1352,42 @@
         __LINE__, __WFILE__, NULL, L"", NULL);
 }
 
+void MgServerSqlDataReader::ResponseStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerSqlDataReader.ResponseStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerSqlDataReader::ResponseEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerSqlDataReader.ResponseEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerSqlDataReader::BodyStartUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerSqlDataReader.BodyStartUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerSqlDataReader::BodyEndUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerSqlDataReader.BodyEndUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerSqlDataReader::HeaderToStringUtf8(string& str)
+{
+    throw new MgInvalidOperationException(L"MgServerSqlDataReader.HeaderToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+void MgServerSqlDataReader::CurrentToStringUtf8(string& str)
+{
+	throw new MgInvalidOperationException(L"MgServerSqlDataReader.CurrentToStringUtf8",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
 /// <summary>Gets the raster object of the specified property.
 /// the property must be of Raster type; otherwise, an exception is thrown.
 /// </summary>

Modified: sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.h
===================================================================
--- sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Server/src/Services/Feature/ServerSqlDataReader.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -411,6 +411,66 @@
 
 INTERNAL_API:
 
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void ResponseEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the start of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyStartUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the end of the response body as a UTF-8 string. The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+	///
+	void BodyEndUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the header in this reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void HeaderToStringUtf8(string& str);
+
+	///////////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns the contents of the current record/feature in the reader as a UTF-8 string.  The mime
+    /// type must be a text type, for example text/xml.
+    ///
+    /// \param str
+    /// Destination string.
+    ///
+    void CurrentToStringUtf8(string& str);
+
     //////////////////////////////////////////////////////////////////
     /// <summary>
     /// Gets the string value of the specified property. No conversion is

Modified: sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.cpp
===================================================================
--- sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -97,6 +97,7 @@
             m_r->content_type = apr_pstrdup(m_r->pool, tempHeader);
         }
 
+        Ptr<MgReader> outputDataReader;
         Ptr<MgByteReader> outputReader;
         Ptr<MgDisposable> resultObj = result->GetResultObject();
         MgDisposable* pResultObj = (MgDisposable*)resultObj;
@@ -107,7 +108,7 @@
         }
         else if (NULL != dynamic_cast<MgFeatureReader*>(pResultObj))
         {
-            outputReader = ((MgFeatureReader*)pResultObj)->ToXml();
+            outputDataReader = SAFE_ADDREF((MgFeatureReader*)pResultObj); //Need to AddRef because there's now 2 references on this pointer
         }
         else if (NULL != dynamic_cast<MgStringCollection*>(pResultObj))
         {
@@ -115,11 +116,11 @@
         }
         else if (NULL != dynamic_cast<MgSqlDataReader*>(pResultObj))
         {
-            outputReader = ((MgSqlDataReader*)pResultObj)->ToXml();
+            outputDataReader = SAFE_ADDREF((MgSqlDataReader*)pResultObj); //Need to AddRef because there's now 2 references on this pointer
         }
         else if (NULL != dynamic_cast<MgDataReader*>(pResultObj))
         {
-            outputReader = ((MgDataReader*)pResultObj)->ToXml();
+            outputDataReader = SAFE_ADDREF((MgDataReader*)pResultObj); //Need to AddRef because there's now 2 references on this pointer
         }
         else if (NULL != dynamic_cast<MgSpatialContextReader*>(pResultObj))
         {
@@ -142,8 +143,11 @@
 
             ap_send_http_header(m_r);
             ap_rwrite(utf8.c_str(), (int)utf8.length(), m_r);
-
         }
+        else if (outputDataReader != NULL)
+        {
+            OutputDataReader(outputDataReader);
+        }
         else if (outputReader != NULL)
         {
             INT64 outLen = outputReader->GetLength();
@@ -169,6 +173,51 @@
     MG_CATCH_AND_THROW(L"ApacheResponseHandler.SendResponse");
 }
 
+void ApacheResponseHandler::OutputDataReader(MgReader* reader)
+{
+    MG_TRY()
+
+    m_r->chunked = 1;
+
+    std::string buf;
+    reader->ResponseStartUtf8(buf);
+    reader->HeaderToStringUtf8(buf);
+    reader->BodyStartUtf8(buf);
+
+    WriteChunk(buf.c_str(), buf.length());
+
+    while(reader->ReadNext())
+    {
+        buf.clear();
+        reader->CurrentToStringUtf8(buf);
+        WriteChunk(buf.c_str(), buf.length());
+    }
+
+    buf.clear();
+
+    reader->BodyEndUtf8(buf);
+    reader->ResponseEndUtf8(buf);
+
+    WriteChunk(buf.c_str(), buf.length());
+
+    //Last chunk
+    //ap_rwrite("0\r\n", 3, m_r);
+
+    MG_CATCH_AND_THROW(L"ApacheResponseHandler.OutputDataReader");
+}
+
+void ApacheResponseHandler::WriteChunk(const char* buffer, size_t length)
+{
+    //[chunk size as hex]\r\n
+    //[buffer]\r\n
+    //std::string sizeStr;
+    //MgUtil::Int32ToHexString(length, sizeStr);
+    //sizeStr.append("\r\n");
+    //ap_rwrite(sizeStr.c_str(), sizeStr.length(), m_r);  //[chunk size as hex]\r\n
+    ap_rwrite(buffer, length, m_r);                     //[buffer]
+    //ap_rwrite("\r\n", 2, m_r);                          //\r\n
+}
+
 void ApacheResponseHandler::SendError(MgException *e)
 {
     MG_TRY()

Modified: sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.h
===================================================================
--- sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.h	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Web/src/ApacheAgent/ApacheResponseHandler.h	2012-12-14 14:17:47 UTC (rev 7268)
@@ -36,6 +36,8 @@
     void SendResponse(MgHttpResponse* response);
     void SendError(MgException* e);
     void RequestAuth();
+    void OutputDataReader(MgReader* reader);
+    void WriteChunk(const char* buffer, size_t length);
 
 private:
     request_rec *m_r;

Modified: sandbox/jng/streaming/Web/src/HttpHandler/HttpExecuteSqlQuery.cpp
===================================================================
--- sandbox/jng/streaming/Web/src/HttpHandler/HttpExecuteSqlQuery.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Web/src/HttpHandler/HttpExecuteSqlQuery.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -63,12 +63,8 @@
 
     // call the C++ API
     Ptr<MgSqlDataReader> sqlReader = service->ExecuteSqlQuery(resId, m_sqlStatement);
-    Ptr<MgByteReader> byteReader = sqlReader->ToXml();
+    
+    hResult->SetResultObject(sqlReader, MgMimeType::Xml);
 
-    //Convert to alternate response format, if necessary
-    ProcessFormatConversion(byteReader);
-
-    hResult->SetResultObject(byteReader, byteReader->GetMimeType());
-
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpExecuteSqlQuery.Execute")
 }

Modified: sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeatures.cpp
===================================================================
--- sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeatures.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeatures.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -104,12 +104,7 @@
     }
 
     Ptr<MgFeatureReader> featureReader = service->SelectFeatures(&resId, m_className, qryOptions);
-    Ptr<MgByteReader> byteReader = featureReader->ToXml();
+    hResult->SetResultObject(featureReader, MgMimeType::Xml);
 
-    //Convert to alternate response format, if necessary
-    ProcessFormatConversion(byteReader);
-
-    hResult->SetResultObject(byteReader, byteReader->GetMimeType());
-
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpSelectFeatures.Execute")
 }

Modified: sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeaturesSpatially.cpp
===================================================================
--- sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeaturesSpatially.cpp	2012-12-14 12:42:32 UTC (rev 7267)
+++ sandbox/jng/streaming/Web/src/HttpHandler/HttpSelectFeaturesSpatially.cpp	2012-12-14 14:17:47 UTC (rev 7268)
@@ -114,12 +114,7 @@
     }
 
     Ptr<MgDataReader> dataReader = service->SelectAggregate(&resId, m_className, qryOptions);
-    Ptr<MgByteReader> byteReader = dataReader->ToXml();
+    hResult->SetResultObject(dataReader, MgMimeType::Xml);
 
-    //Convert to alternate response format, if necessary
-    ProcessFormatConversion(byteReader);
-
-    hResult->SetResultObject(byteReader, byteReader->GetMimeType());
-
     MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpSelectFeaturesSpatially.Execute")
 }



More information about the mapguide-commits mailing list