[mapguide-commits] r5389 - in sandbox/rfc90/MgDev/Server: . src/Common/Base src/Common/Cache src/Common/Manager src/Common/Thread src/Core src/Gws/GwsCommon src/Gws/GwsQueryEngine src/Gws/GwsResource src/PostBuild src/Services/Drawing src/Services/Feature src/Services/Kml src/Services/Mapping src/Services/Rendering src/Services/Resource src/Services/ServerAdmin src/Services/Site src/Services/Tile src/UnitTesting src/Wfs src/Wms

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Nov 13 13:07:46 EST 2010


Author: uvlite
Date: 2010-11-13 10:07:46 -0800 (Sat, 13 Nov 2010)
New Revision: 5389

Added:
   sandbox/rfc90/MgDev/Server/src/Wms/1.3.0.xml.awd
Modified:
   sandbox/rfc90/MgDev/Server/
   sandbox/rfc90/MgDev/Server/Server.sln
   sandbox/rfc90/MgDev/Server/src/Common/Base/ClientHandler.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Base/ServerBase.rc
   sandbox/rfc90/MgDev/Server/src/Common/Base/ServiceOperation.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Cache/ServerCache.rc
   sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Common/Manager/PackageLogHandler.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/PermissionInfo.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/SecurityCache.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.rc
   sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.vcproj
   sandbox/rfc90/MgDev/Server/src/Common/Manager/ServiceManager.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/SessionInfo.h
   sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.cpp
   sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.h
   sandbox/rfc90/MgDev/Server/src/Common/Thread/ServerThread.rc
   sandbox/rfc90/MgDev/Server/src/Core/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Core/OperationThread.cpp
   sandbox/rfc90/MgDev/Server/src/Core/Server.cpp
   sandbox/rfc90/MgDev/Server/src/Core/ServerCore.rc
   sandbox/rfc90/MgDev/Server/src/Core/ServerCore.vcproj
   sandbox/rfc90/MgDev/Server/src/Core/main.cpp
   sandbox/rfc90/MgDev/Server/src/Core/serverconfig.ini
   sandbox/rfc90/MgDev/Server/src/Gws/GwsCommon/GwsCommon.rc
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp
   sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryEngine.rc
   sandbox/rfc90/MgDev/Server/src/Gws/GwsResource/GwsResource.rc
   sandbox/rfc90/MgDev/Server/src/PostBuild/PostBuild.mak
   sandbox/rfc90/MgDev/Server/src/Services/Drawing/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureDistribution.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDataReader.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.h
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Kml/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
   sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepository.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/DataBindingInfo.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/DbEnvironment.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationInfo.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationParameter.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/RepositoryManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceContainer.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp
   sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
   sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
   sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
   sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Site/Makefile.am
   sandbox/rfc90/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.vcproj
   sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.h
   sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.rc
   sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.cpp
   sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.h
   sandbox/rfc90/MgDev/Server/src/UnitTesting/Makefile.am
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestKmlService.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMappingService.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMdfModel.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.h
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.h
   sandbox/rfc90/MgDev/Server/src/UnitTesting/TestTileService.cpp
   sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.rc
   sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.vcproj
   sandbox/rfc90/MgDev/Server/src/Wfs/1.0.0.xml.awd
   sandbox/rfc90/MgDev/Server/src/Wfs/1.1.0.xml.awd
   sandbox/rfc90/MgDev/Server/src/Wfs/OgcWfsService.config.awd
   sandbox/rfc90/MgDev/Server/src/Wms/1.1.1.xml.awd
   sandbox/rfc90/MgDev/Server/src/Wms/OgcWmsService.config.awd
Log:
rfc90 merge trunk


Property changes on: sandbox/rfc90/MgDev/Server
___________________________________________________________________
Added: svn:mergeinfo
   + /trunk/MgDev/Server:4724-5096

Modified: sandbox/rfc90/MgDev/Server/Server.sln
===================================================================
--- sandbox/rfc90/MgDev/Server/Server.sln	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/Server.sln	2010-11-13 18:07:46 UTC (rev 5389)
@@ -294,440 +294,246 @@
 		{5287A594-4D4F-43FE-A281-E279AB708CF1} = {5287A594-4D4F-43FE-A281-E279AB708CF1}
 	EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACE", "..\Oem\ACE\ACE_wrappers\ace\ACE_vc9.vcproj", "{BD537C9A-FECA-1BAD-6757-8A6322872A5C}"
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug Static|Win32 = Debug Static|Win32
-		Debug Static|x64 = Debug Static|x64
 		Debug|Win32 = Debug|Win32
 		Debug|x64 = Debug|x64
-		Release Static|Win32 = Release Static|Win32
-		Release Static|x64 = Release Static|x64
 		Release|Win32 = Release|Win32
 		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug Static|x64.ActiveCfg = Debug|x64
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug Static|x64.Build.0 = Debug|x64
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug|Win32.ActiveCfg = Debug|Win32
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug|Win32.Build.0 = Debug|Win32
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug|x64.ActiveCfg = Debug|x64
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Debug|x64.Build.0 = Debug|x64
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release Static|Win32.ActiveCfg = Release|x64
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release Static|x64.ActiveCfg = Release|x64
-		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release Static|x64.Build.0 = Release|x64
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release|Win32.ActiveCfg = Release|Win32
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release|Win32.Build.0 = Release|Win32
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release|x64.ActiveCfg = Release|x64
 		{FDF553DE-0D30-4456-8A84-5009C9EAAED2}.Release|x64.Build.0 = Release|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug Static|x64.ActiveCfg = Debug|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug Static|x64.Build.0 = Debug|x64
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug|Win32.ActiveCfg = Debug|Win32
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug|Win32.Build.0 = Debug|Win32
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug|x64.ActiveCfg = Debug|x64
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Debug|x64.Build.0 = Debug|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release Static|Win32.ActiveCfg = Release|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release Static|x64.ActiveCfg = Release|x64
-		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release Static|x64.Build.0 = Release|x64
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release|Win32.ActiveCfg = Release|Win32
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release|Win32.Build.0 = Release|Win32
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release|x64.ActiveCfg = Release|x64
 		{A82ADC7D-4DA4-42F2-9BF6-DF5DCFB44425}.Release|x64.Build.0 = Release|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug Static|x64.ActiveCfg = Debug|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug Static|x64.Build.0 = Debug|x64
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug|Win32.ActiveCfg = Debug|Win32
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug|Win32.Build.0 = Debug|Win32
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug|x64.ActiveCfg = Debug|x64
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Debug|x64.Build.0 = Debug|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release Static|Win32.ActiveCfg = Release|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release Static|x64.ActiveCfg = Release|x64
-		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release Static|x64.Build.0 = Release|x64
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release|Win32.ActiveCfg = Release|Win32
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release|Win32.Build.0 = Release|Win32
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release|x64.ActiveCfg = Release|x64
 		{D954DAAC-E305-40CE-B3F3-C229A0BEF4F0}.Release|x64.Build.0 = Release|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug Static|x64.ActiveCfg = Debug|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug Static|x64.Build.0 = Debug|x64
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug|Win32.Build.0 = Debug|Win32
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug|x64.ActiveCfg = Debug|x64
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Debug|x64.Build.0 = Debug|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release Static|Win32.ActiveCfg = Release|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release Static|x64.ActiveCfg = Release|x64
-		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release Static|x64.Build.0 = Release|x64
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release|Win32.ActiveCfg = Release|Win32
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release|Win32.Build.0 = Release|Win32
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release|x64.ActiveCfg = Release|x64
 		{5287A594-4D4F-43FE-A281-E279AB708CF1}.Release|x64.Build.0 = Release|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug Static|x64.ActiveCfg = Debug|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug Static|x64.Build.0 = Debug|x64
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug|Win32.ActiveCfg = Debug|Win32
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug|Win32.Build.0 = Debug|Win32
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug|x64.ActiveCfg = Debug|x64
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Debug|x64.Build.0 = Debug|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release Static|Win32.ActiveCfg = Release|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release Static|x64.ActiveCfg = Release|x64
-		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release Static|x64.Build.0 = Release|x64
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release|Win32.ActiveCfg = Release|Win32
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release|Win32.Build.0 = Release|Win32
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release|x64.ActiveCfg = Release|x64
 		{C50254F2-654A-48DE-AF5B-20605AEF8D10}.Release|x64.Build.0 = Release|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug Static|x64.ActiveCfg = Debug|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug Static|x64.Build.0 = Debug|x64
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug|Win32.ActiveCfg = Debug|Win32
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug|Win32.Build.0 = Debug|Win32
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug|x64.ActiveCfg = Debug|x64
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Debug|x64.Build.0 = Debug|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release Static|Win32.ActiveCfg = Release|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release Static|x64.ActiveCfg = Release|x64
-		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release Static|x64.Build.0 = Release|x64
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release|Win32.ActiveCfg = Release|Win32
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release|Win32.Build.0 = Release|Win32
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release|x64.ActiveCfg = Release|x64
 		{85882748-DD71-4D2B-9E5A-03AF8C8D91B7}.Release|x64.Build.0 = Release|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug Static|x64.ActiveCfg = Debug|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug Static|x64.Build.0 = Debug|x64
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug|Win32.Build.0 = Debug|Win32
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug|x64.ActiveCfg = Debug|x64
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Debug|x64.Build.0 = Debug|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release Static|Win32.ActiveCfg = Release|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release Static|x64.ActiveCfg = Release|x64
-		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release Static|x64.Build.0 = Release|x64
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release|Win32.ActiveCfg = Release|Win32
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release|Win32.Build.0 = Release|Win32
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release|x64.ActiveCfg = Release|x64
 		{F7334B1B-0EFA-47E3-8E66-DF158E61B7E4}.Release|x64.Build.0 = Release|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug Static|x64.ActiveCfg = Debug|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug Static|x64.Build.0 = Debug|x64
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug|Win32.ActiveCfg = Debug|Win32
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug|Win32.Build.0 = Debug|Win32
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug|x64.ActiveCfg = Debug|x64
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Debug|x64.Build.0 = Debug|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Release Static|Win32.ActiveCfg = Release|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Release Static|x64.ActiveCfg = Release|x64
-		{38161685-88ED-415E-A545-CCC17BE069AE}.Release Static|x64.Build.0 = Release|x64
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Release|Win32.ActiveCfg = Release|Win32
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Release|Win32.Build.0 = Release|Win32
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Release|x64.ActiveCfg = Release|x64
 		{38161685-88ED-415E-A545-CCC17BE069AE}.Release|x64.Build.0 = Release|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug Static|x64.ActiveCfg = Debug|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug Static|x64.Build.0 = Debug|x64
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug|Win32.ActiveCfg = Debug|Win32
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug|Win32.Build.0 = Debug|Win32
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug|x64.ActiveCfg = Debug|x64
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Debug|x64.Build.0 = Debug|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release Static|Win32.ActiveCfg = Release|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release Static|x64.ActiveCfg = Release|x64
-		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release Static|x64.Build.0 = Release|x64
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release|Win32.ActiveCfg = Release|Win32
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release|Win32.Build.0 = Release|Win32
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release|x64.ActiveCfg = Release|x64
 		{7C1C5695-C51C-4017-ABEF-BC3032CBAF3B}.Release|x64.Build.0 = Release|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug Static|x64.ActiveCfg = Debug|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug Static|x64.Build.0 = Debug|x64
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug|Win32.ActiveCfg = Debug|Win32
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug|Win32.Build.0 = Debug|Win32
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug|x64.ActiveCfg = Debug|x64
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Debug|x64.Build.0 = Debug|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release Static|Win32.ActiveCfg = Release|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release Static|x64.ActiveCfg = Release|x64
-		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release Static|x64.Build.0 = Release|x64
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release|Win32.ActiveCfg = Release|Win32
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release|Win32.Build.0 = Release|Win32
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release|x64.ActiveCfg = Release|x64
 		{341D5463-186E-49BA-B942-3D3BE28D65C0}.Release|x64.Build.0 = Release|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug Static|x64.ActiveCfg = Debug|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug Static|x64.Build.0 = Debug|x64
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug|Win32.ActiveCfg = Debug|Win32
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug|Win32.Build.0 = Debug|Win32
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug|x64.ActiveCfg = Debug|x64
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Debug|x64.Build.0 = Debug|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release Static|Win32.ActiveCfg = Release|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release Static|x64.ActiveCfg = Release|x64
-		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release Static|x64.Build.0 = Release|x64
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release|Win32.ActiveCfg = Release|Win32
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release|Win32.Build.0 = Release|Win32
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release|x64.ActiveCfg = Release|x64
 		{DB2CC2E3-4754-4932-B865-424A44E58FD0}.Release|x64.Build.0 = Release|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug Static|x64.ActiveCfg = Debug|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug Static|x64.Build.0 = Debug|x64
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug|Win32.ActiveCfg = Debug|Win32
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug|Win32.Build.0 = Debug|Win32
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug|x64.ActiveCfg = Debug|x64
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Debug|x64.Build.0 = Debug|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release Static|Win32.ActiveCfg = Release|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release Static|x64.ActiveCfg = Release|x64
-		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release Static|x64.Build.0 = Release|x64
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release|Win32.ActiveCfg = Release|Win32
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release|Win32.Build.0 = Release|Win32
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release|x64.ActiveCfg = Release|x64
 		{E6B0012F-58F6-42F4-8F02-065C35829569}.Release|x64.Build.0 = Release|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug Static|x64.ActiveCfg = Debug|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug Static|x64.Build.0 = Debug|x64
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug|Win32.ActiveCfg = Debug|Win32
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug|Win32.Build.0 = Debug|Win32
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug|x64.ActiveCfg = Debug|x64
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Debug|x64.Build.0 = Debug|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release Static|Win32.ActiveCfg = Release|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release Static|x64.ActiveCfg = Release|x64
-		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release Static|x64.Build.0 = Release|x64
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release|Win32.ActiveCfg = Release|Win32
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release|Win32.Build.0 = Release|Win32
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release|x64.ActiveCfg = Release|x64
 		{8D947123-A12C-45DA-BD00-8B62DD5A0459}.Release|x64.Build.0 = Release|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug Static|x64.ActiveCfg = Debug|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug Static|x64.Build.0 = Debug|x64
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug|Win32.ActiveCfg = Debug|Win32
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug|Win32.Build.0 = Debug|Win32
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug|x64.ActiveCfg = Debug|x64
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Debug|x64.Build.0 = Debug|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release Static|Win32.ActiveCfg = Release|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release Static|x64.ActiveCfg = Release|x64
-		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release Static|x64.Build.0 = Release|x64
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release|Win32.ActiveCfg = Release|Win32
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release|Win32.Build.0 = Release|Win32
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release|x64.ActiveCfg = Release|x64
 		{8F654896-85DC-4F32-99B2-670D66B0FBF1}.Release|x64.Build.0 = Release|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|x64.ActiveCfg = Debug|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|x64.Build.0 = Debug|x64
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|Win32.ActiveCfg = Debug|Win32
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|Win32.Build.0 = Debug|Win32
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|x64.ActiveCfg = Debug|x64
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|x64.Build.0 = Debug|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|Win32.ActiveCfg = Release|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|x64.ActiveCfg = Release|x64
-		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|x64.Build.0 = Release|x64
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release|Win32.ActiveCfg = Release|Win32
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release|Win32.Build.0 = Release|Win32
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release|x64.ActiveCfg = Release|x64
 		{A4F7F6B2-0E74-4DFD-B283-C7E380BD6F58}.Release|x64.Build.0 = Release|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug Static|x64.ActiveCfg = Debug|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug Static|x64.Build.0 = Debug|x64
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug|Win32.ActiveCfg = Debug|Win32
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug|Win32.Build.0 = Debug|Win32
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug|x64.ActiveCfg = Debug|x64
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Debug|x64.Build.0 = Debug|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release Static|Win32.ActiveCfg = Release|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release Static|x64.ActiveCfg = Release|x64
-		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release Static|x64.Build.0 = Release|x64
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release|Win32.ActiveCfg = Release|Win32
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release|Win32.Build.0 = Release|Win32
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release|x64.ActiveCfg = Release|x64
 		{ADBF25E2-C629-4832-B315-F12ABDE05632}.Release|x64.Build.0 = Release|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|x64.ActiveCfg = Debug|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug Static|x64.Build.0 = Debug|x64
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|Win32.Build.0 = Debug|Win32
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|x64.ActiveCfg = Debug|x64
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Debug|x64.Build.0 = Debug|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|Win32.ActiveCfg = Release|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|x64.ActiveCfg = Release|x64
-		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release Static|x64.Build.0 = Release|x64
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release|Win32.ActiveCfg = Release|Win32
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release|Win32.Build.0 = Release|Win32
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release|x64.ActiveCfg = Release|x64
 		{B50806B2-0E74-4DFD-B283-C7E380BD6F58}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C22}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1D}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1E}.Release|x64.Build.0 = Release|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug Static|x64.ActiveCfg = Debug|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug Static|x64.Build.0 = Debug|x64
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug|Win32.Build.0 = Debug|Win32
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug|x64.ActiveCfg = Debug|x64
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Debug|x64.Build.0 = Debug|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release Static|Win32.ActiveCfg = Release|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release Static|x64.ActiveCfg = Release|x64
-		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release Static|x64.Build.0 = Release|x64
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release|Win32.ActiveCfg = Release|Win32
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release|Win32.Build.0 = Release|Win32
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release|x64.ActiveCfg = Release|x64
 		{FBC27460-155E-4C13-AFDF-BA8B7BE28F7F}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C1F}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C20}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C21}.Release|x64.Build.0 = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug Static|x64.ActiveCfg = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug Static|x64.Build.0 = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug|Win32.ActiveCfg = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug|Win32.Build.0 = Debug|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug|x64.ActiveCfg = Debug|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Debug|x64.Build.0 = Debug|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release Static|Win32.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release Static|x64.ActiveCfg = Release|x64
-		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release Static|x64.Build.0 = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release|Win32.ActiveCfg = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release|Win32.Build.0 = Release|Win32
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release|x64.ActiveCfg = Release|x64
 		{561F38EE-E22F-481A-8EFB-DC0AA25B4C23}.Release|x64.Build.0 = Release|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug Static|x64.ActiveCfg = Debug|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug Static|x64.Build.0 = Debug|x64
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug|Win32.ActiveCfg = Debug|Win32
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug|Win32.Build.0 = Debug|Win32
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug|x64.ActiveCfg = Debug|x64
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Debug|x64.Build.0 = Debug|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release Static|Win32.ActiveCfg = Release|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release Static|x64.ActiveCfg = Release|x64
-		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release Static|x64.Build.0 = Release|x64
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release|Win32.ActiveCfg = Release|Win32
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release|Win32.Build.0 = Release|Win32
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release|x64.ActiveCfg = Release|x64
 		{42491401-B624-440D-91D7-1F2633EFB4E3}.Release|x64.Build.0 = Release|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug Static|x64.ActiveCfg = Debug|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug Static|x64.Build.0 = Debug|x64
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug|Win32.ActiveCfg = Debug|Win32
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug|Win32.Build.0 = Debug|Win32
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug|x64.ActiveCfg = Debug|x64
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Debug|x64.Build.0 = Debug|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release Static|Win32.ActiveCfg = Release|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release Static|x64.ActiveCfg = Release|x64
-		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release Static|x64.Build.0 = Release|x64
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release|Win32.ActiveCfg = Release|Win32
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release|Win32.Build.0 = Release|Win32
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release|x64.ActiveCfg = Release|x64
 		{DD0284A0-1ECE-4387-AED3-E9BF5EE74FF8}.Release|x64.Build.0 = Release|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug Static|x64.ActiveCfg = Debug|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug Static|x64.Build.0 = Debug|x64
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug|Win32.Build.0 = Debug|Win32
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug|x64.ActiveCfg = Debug|x64
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Debug|x64.Build.0 = Debug|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Release Static|Win32.ActiveCfg = Release|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Release Static|x64.ActiveCfg = Release|x64
-		{F486B768-640A-445D-8C09-437C896EFFAD}.Release Static|x64.Build.0 = Release|x64
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Release|Win32.ActiveCfg = Release|Win32
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Release|Win32.Build.0 = Release|Win32
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Release|x64.ActiveCfg = Release|x64
 		{F486B768-640A-445D-8C09-437C896EFFAD}.Release|x64.Build.0 = Release|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug Static|x64.ActiveCfg = Debug|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug Static|x64.Build.0 = Debug|x64
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug|Win32.ActiveCfg = Debug|Win32
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug|Win32.Build.0 = Debug|Win32
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug|x64.ActiveCfg = Debug|x64
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Debug|x64.Build.0 = Debug|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release Static|Win32.ActiveCfg = Release|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release Static|x64.ActiveCfg = Release|x64
-		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release Static|x64.Build.0 = Release|x64
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release|Win32.ActiveCfg = Release|Win32
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release|Win32.Build.0 = Release|Win32
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release|x64.ActiveCfg = Release|x64
 		{531778C6-C340-40F2-B403-9B58B8121AAB}.Release|x64.Build.0 = Release|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug Static|Win32.ActiveCfg = Debug|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug Static|x64.ActiveCfg = Debug|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug Static|x64.Build.0 = Debug|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug|Win32.Build.0 = Debug|Win32
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug|x64.ActiveCfg = Debug|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Debug|x64.Build.0 = Debug|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release Static|Win32.ActiveCfg = Release|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release Static|x64.ActiveCfg = Release|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release Static|x64.Build.0 = Release|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release|Win32.ActiveCfg = Release|Win32
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release|Win32.Build.0 = Release|Win32
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release|x64.ActiveCfg = Release|x64
-		{BD537C9A-FECA-1BAD-6757-8A6322872A5C}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: sandbox/rfc90/MgDev/Server/src/Common/Base/ClientHandler.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Base/ClientHandler.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Base/ClientHandler.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -213,8 +213,13 @@
 
     //  create a MgStreamData Object for our message queue
     MgStreamData* pData = NULL;
-    ACE_NEW_RETURN( pData, MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
+    ACE_Allocator* allocator = ACE_Allocator::instance();
+    ACE_NEW_MALLOC_RETURN( pData,
+        static_cast<MgServerStreamData*>(allocator->malloc(sizeof(MgServerStreamData))),
+        MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
 
+    //ACE_NEW_RETURN( pData, MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
+
     //  create the message block
     ACE_Message_Block* mb = NULL;
     ACE_NEW_RETURN( mb, ACE_Message_Block( pData ), -1 );
@@ -282,6 +287,7 @@
 /// </summary>
 void MgClientHandler::SetStatus( MgClientHandler::HandlerStatus status )
 {
+    ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
     m_Status = status;
 };
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Base/ServerBase.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Base/ServerBase.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Base/ServerBase.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Base/ServiceOperation.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -178,7 +178,7 @@
     // Update the API version
     currUserInfo->SetApiVersion(m_packet.m_OperationVersion);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     MgUserInformation::SetCurrentUserInfo(currUserInfo);
     m_packet.m_UserInfo = NULL;
 
@@ -219,7 +219,7 @@
     {
         // Log the exception using Server locale or User locale if it exists
         STRING locale = MgResources::DefaultMessageLocale;
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         if (NULL != currUserInfo)
         {
             locale = currUserInfo->GetLocale();
@@ -644,7 +644,7 @@
 
     if (serverManager->IsSiteServer())
     {
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         assert(NULL != currUserInfo);
         Ptr<MgStringCollection> requiredRoles = GetRoles();
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Cache/ServerCache.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Cache/ServerCache.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Cache/ServerCache.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -313,3 +313,48 @@
 
     return cacheItem.Detach();
 }
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Determine if a cache notification is needed for the specified resource
+/// if it has been changed.
+///
+bool MgCacheManager::IsResourceChangeNotificationNeeded(MgResourceIdentifier* resource)
+{
+    bool notificationNeeded = false;
+
+    // Note that the filter below may be changed in the future or whenever
+    // a new resource type is supported.
+    // Currently, the cache manager only needs to know if the following types
+    // of resources have been changed:
+    //
+    // Feature Service cache:
+    //      MgResourceType::FeatureSource
+    // Tile cache:
+    //      MgResourceType::MapDefinition
+    //      MgResourceType::LayerDefinition
+    //      MgResourceType::DrawingSource
+    //      MgResourceType::FeatureSource
+    //      MgResourceType::SymbolDefinition
+    //      MgResourceType::SymbolLibrary
+
+    if (NULL != resource)
+    {
+        STRING resourceType = resource->GetResourceType();
+
+        if (MgResourceType::Map                          != resourceType
+         && MgResourceType::Folder                       != resourceType
+         && MgResourceType::LoadProcedure                != resourceType
+         && MgResourceType::PrintLayout                  != resourceType
+         && MgResourceType::Selection                    != resourceType
+         && MgResourceType::WebLayout                    != resourceType
+         && MgResourceType::ApplicationDefinition        != resourceType
+         && MgResourceType::PrintLayoutDefinition        != resourceType
+         && MgResourceType::PrintLayoutElementDefinition != resourceType)
+        {
+            notificationNeeded = true;
+        }
+    }
+
+    return notificationNeeded;
+}

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/CacheManager.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -62,6 +62,8 @@
     MgFeatureSourceCacheItem* GetFeatureSourceCacheItem(MgResourceIdentifier* resource);
     MgSpatialContextCacheItem* GetSpatialContextCacheItem(MgResourceIdentifier* resource);
 
+    bool IsResourceChangeNotificationNeeded(MgResourceIdentifier* resource);
+
 /// Data Members
 
 private:

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -97,30 +97,12 @@
             {
                 g_threadLocalConnection = 0;
             }
-            else
-            {
-                ACE_OS::thr_setspecific(g_threadLocalConnection, NULL);
-            }
         }
     }
 
     if (0 != g_threadLocalConnection)
     {
-        MgConnection* oldInfo = NULL;
-        ACE_OS::thr_getspecific(g_threadLocalConnection, (void**) &oldInfo);
-
-        MgConnection* tempConnection = NULL;
-        if(connection != NULL)
-        {
-            tempConnection = new MgConnection(*connection);
-        }
-
-        ACE_OS::thr_setspecific(g_threadLocalConnection, tempConnection);
-
-        if (NULL != oldInfo)
-        {
-            delete oldInfo;
-        }
+        ACE_OS::thr_setspecific(g_threadLocalConnection, connection);
     }
 }
 
@@ -200,7 +182,7 @@
     {
         ACE_Time_Value now = ACE_High_Res_Timer::gettimeofday();
         ACE_Time_Value diffTime = now - m_lastUsageTime;
-        double diff =(double) diffTime.sec();
+        double diff = diffTime.sec();
         if (  diff  > nIdleTimeout )
         {
             bExpired = true;

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/Connection.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -85,10 +85,10 @@
     void SetCurrentOperationStatus(OperationStatus opStatus);
     void SetCurrentOperationTime(INT32 opTime);
 
-    CREFSTRING GetClientAgent() const;
-    CREFSTRING GetClientIp() const;
-    CREFSTRING GetUserName() const;
-    CREFSTRING GetSessionId() const;
+    STRING GetClientAgent() const;
+    STRING GetClientIp() const;
+    STRING GetUserName() const;
+    STRING GetSessionId() const;
     const ACE_Time_Value& GetLastUsageTime() const;
     const ACE_Time_Value& GetStartTime() const;
     INT32 GetProcessedOperations() const;
@@ -127,22 +127,22 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgConnection::GetClientAgent() const
+inline STRING MgConnection::GetClientAgent() const
 {
     return m_clientAgent;
 }
 
-inline CREFSTRING MgConnection::GetClientIp() const
+inline STRING MgConnection::GetClientIp() const
 {
     return m_clientIp;
 }
 
-inline CREFSTRING MgConnection::GetUserName() const
+inline STRING MgConnection::GetUserName() const
 {
     return m_userName;
 }
 
-inline CREFSTRING MgConnection::GetSessionId() const
+inline STRING MgConnection::GetSessionId() const
 {
     return m_sessionId;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -477,7 +477,7 @@
                     FdoConnectionCacheEntry* pFdoConnectionCacheEntry = iter->second;
                     if(pFdoConnectionCacheEntry)
                     {
-                        INT32 time = (INT32) (now.sec() - pFdoConnectionCacheEntry->lastUsed.sec());
+                        INT32 time = now.sec() - pFdoConnectionCacheEntry->lastUsed.sec();
                         INT32 useLimit = providerInfo->GetUseLimit();
                         if((time > m_nFdoConnectionTimeout) || (!pFdoConnectionCacheEntry->bValid) || (useLimit != -1 && pFdoConnectionCacheEntry->nUseTotal >= useLimit))
                         {
@@ -2006,7 +2006,7 @@
 ///
 void MgFdoConnectionManager::SubstituteConnectionTags(REFSTRING connectionStr)
 {
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
 
     if (NULL != userInfo)
     {

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -319,7 +319,7 @@
     MG_LOGMANAGER_CATCH_AND_THROW(L"MgLogManager.LoadConfigurationProperties")
 }
 
-CREFSTRING MgLogManager::GetLogsPath()
+STRING MgLogManager::GetLogsPath()
 {
     return m_path;
 }
@@ -2381,9 +2381,14 @@
     MG_LOGMANAGER_TRY()
 
     // We want the log thread to handle the log entry for us
-    MgLogEntryData* led;
-    ACE_NEW_NORETURN( led, MgLogEntryData(logType, message, logPriority) );
+    MgLogEntryData* led = NULL;
+    ACE_Allocator* allocator = ACE_Allocator::instance();
+    ACE_NEW_MALLOC_NORETURN (led,
+        static_cast<MgLogEntryData*> (allocator->malloc(sizeof(MgLogEntryData))),
+        MgLogEntryData(logType, message, logPriority) );
 
+    //ACE_NEW_NORETURN( led, MgLogEntryData(logType, message, logPriority) );
+
     ACE_Message_Block* mb;
     ACE_NEW_NORETURN( mb, ACE_Message_Block( led ) );
     if(mb)
@@ -2442,11 +2447,14 @@
 
         MG_LOGMANAGER_TRY()
 
-        LogToSysLog(pAce, (char *)(MgUtil::WideCharToMultiByte(m_applicationName)).c_str());
+        string appName = MgUtil::WideCharToMultiByte(m_applicationName);
+        wchar_t* messageStr = (wchar_t*) message.c_str();
+
+        LogToSysLog(pAce, (char *)appName.c_str());
 #ifdef _WIN32
         pAce->log(logPriority, ACE_TEXT("%Z\r\n"), message.c_str()); // WAS %W
 #else
-        pAce->log(logPriority, ACE_TEXT("%Z\n"), message.c_str()); // WAS %W
+        pAce->log(logPriority, ACE_TEXT("%Z\n"), messageStr); // WAS %W
 #endif
         LogToStderr(pAce);
 
@@ -2735,23 +2743,11 @@
     if (pReadFile != NULL)
     {
         const int size = 2048;
-        char* buffer = new char[size];
-        if (buffer == NULL)
-        {
-            ACE_OS::fclose(pReadFile);
-            throw new MgOutOfMemoryException(L"MgLogManager.GetLogHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-        }
+        char buffer[2048] = {0};
 
-        // Clear buffer
-        memset(buffer, 0, (size)*sizeof(char));
-
-        ACE_OS::fread(buffer, sizeof(char), size*sizeof(char), pReadFile);
+        ACE_OS::fread(buffer, sizeof(char), size-1, pReadFile);
         contents = buffer;
 
-        // Clean up buffer
-        delete [] buffer;
-        buffer = NULL;
-
         ACE_OS::fclose(pReadFile);
     }
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/LogManager.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -200,19 +200,32 @@
         operationMessage += L"false"; \
     }
 
+#ifdef _DEBUG
 #define MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY() \
+    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) %W\n"), operationMessage.c_str())); \
     MG_LOG_ACCESS_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#else
+#define MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY() \
+    MG_LOG_ACCESS_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#endif
 
+#ifdef _DEBUG
 #define MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY() \
+    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) %W\n"), operationMessage.c_str())); \
     MG_LOG_ADMIN_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#else
+#define MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY() \
+    MG_LOG_ADMIN_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#endif
 
+
 #define MG_CONNECTION_INFO \
     STRING connInfoClient = L""; \
     STRING connInfoClientIp = L""; \
     STRING connInfoUserName = L""; \
     try \
     { \
-        MgUserInformation* pUserInfo = MgUserInformation::GetCurrentUserInfo(); \
+        Ptr<MgUserInformation> pUserInfo = MgUserInformation::GetCurrentUserInfo(); \
         MgConnection* pConnection = MgConnection::GetCurrentConnection(); \
         /* Get client version. This needs to come from the web tier. */ \
         /* For logs involving operations, this will be stored in MgUserInformation. */ \
@@ -288,7 +301,7 @@
     static MgLogManager* GetInstance();
     void Initialize();
     void LoadConfigurationProperties();
-    CREFSTRING GetLogsPath();
+    STRING GetLogsPath();
     void SetMaximumLogSize(INT32 size);
     void SetLogDelimiter(CREFSTRING delimiter);
     STRING GetLogDelimiter();

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -76,7 +76,7 @@
     ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, sm_mutex, false));
 
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -7,7 +7,7 @@
 INCLUDES = \
   -I../../../../Oem/ACE/ACE_wrappers \
   -I$(map_fdo_include) \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../../../Common \
   -I../../../../Common/Security \
   -I../../../../Common/Foundation \

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/PackageLogHandler.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/PackageLogHandler.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/PackageLogHandler.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -70,8 +70,8 @@
 
     virtual void Dispose();
 
-    CREFSTRING GetPackagePathname() const;
-    CREFSTRING GetLogPathname() const;
+    STRING GetPackagePathname() const;
+    STRING GetLogPathname() const;
     MgPackageStatusInformation& GetStatusInfo();
 
     void End();
@@ -96,12 +96,12 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgPackageLogHandler::GetPackagePathname() const
+inline STRING MgPackageLogHandler::GetPackagePathname() const
 {
     return m_packagePathname;
 }
 
-inline CREFSTRING MgPackageLogHandler::GetLogPathname() const
+inline STRING MgPackageLogHandler::GetLogPathname() const
 {
     return m_logPathname;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/PermissionInfo.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/PermissionInfo.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/PermissionInfo.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -61,7 +61,7 @@
 public:
 
     time_t GetAccessedTime() const;
-    CREFSTRING GetOwner() const;
+    STRING GetOwner() const;
     bool IsInherited() const;
     const MgUserPermissionMap& GetUserPermissionMap() const;
     const MgGroupPermissionMap& GetGroupPermissionMap() const;
@@ -96,7 +96,7 @@
     return m_accessedTime;
 }
 
-inline CREFSTRING MgPermissionInfo::GetOwner() const
+inline STRING MgPermissionInfo::GetOwner() const
 {
     return m_owner;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/SecurityCache.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/SecurityCache.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/SecurityCache.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -142,11 +142,8 @@
     }
     else if (strict)
     {
-        MgStringCollection arguments;
-        arguments.Add(user);
-
-        throw new MgUserNotFoundException(L"MgSecurityCache.GetUserInfo",
-            __LINE__, __WFILE__, &arguments, L"", NULL);
+        throw new MgAuthenticationFailedException(L"MgSecurityCache.GetUserInfo",
+            __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
     return userInfo;

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -262,7 +262,7 @@
     MG_CATCH_AND_THROW(L"MgServerManager.LoadConfigurationProperties")
 }
 
-CREFSTRING MgServerManager::GetDefaultMessageLocale()
+STRING MgServerManager::GetDefaultMessageLocale()
 {
     return m_defaultMessageLocale;
 }
@@ -410,6 +410,8 @@
 /// </summary>
 MgPropertyCollection* MgServerManager::GetInformationProperties()
 {
+    ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), NULL));
+
     Ptr<MgPropertyCollection> pProperties;
     pProperties = NULL;
 
@@ -452,7 +454,7 @@
     pProperties->Add(pProperty);
 
     // Add the Uptime
-    time_t nUptime = GetUptime();
+    INT64 nUptime = GetUptime();
     pProperty = new MgInt64Property(MgServerInformationProperties::Uptime, nUptime);
     pProperties->Add(pProperty);
 
@@ -477,12 +479,13 @@
     pProperties->Add(pProperty);
 
     // Add the TotalOperationTime
-    time_t nTotalOperationTime = GetTotalOperationTime();
+    // This value needs to be returned in seconds according to the schema
+    INT64 nTotalOperationTime = GetTotalOperationTime() / 1000;
     pProperty = new MgInt64Property(MgServerInformationProperties::TotalOperationTime, nTotalOperationTime);
     pProperties->Add(pProperty);
 
     // Add the AverageOperationTime
-    time_t nAverageOperationTime = GetAverageOperationTime();
+    INT64 nAverageOperationTime = GetAverageOperationTime();
     pProperty = new MgInt64Property(MgServerInformationProperties::AverageOperationTime, nAverageOperationTime);
     pProperties->Add(pProperty);
 
@@ -796,7 +799,7 @@
     return m_nAdminThreads;
 }
 
-CREFSTRING MgServerManager::GetAdminEmail()
+STRING MgServerManager::GetAdminEmail()
 {
     return m_adminEmail;
 }
@@ -869,12 +872,12 @@
     return m_totalProcessedOperations.value();
 }
 
-time_t MgServerManager::GetTotalOperationTime()
+INT64 MgServerManager::GetTotalOperationTime()
 {
     return m_totalOperationTime.value();
 }
 
-void MgServerManager::IncrementOperationTime(time_t operationTime)
+void MgServerManager::IncrementOperationTime(INT64 operationTime)
 {
     m_totalOperationTime += operationTime;
 }
@@ -976,7 +979,7 @@
     // The ACE SELECT reactor does not have the same handle limit as the ACE WFMO reactor.
     // The code below is left as is, but commented out in case the ACE WFMO reactor is ever used in the future.
 
-    // The limit for the default Windows ACE WFMO reactor is 62 handles this is due to the 64 handle limit of 
+    // The limit for the default Windows ACE WFMO reactor is 62 handles this is due to the 64 handle limit of
     // the Windows WaitForMultipleObjects() API, but ACE uses 2 handles internally leaving only 62 handles for the application.
     // The only reason the value 55 is chosen is because it is slightly under this value and
     // so we can log an error as the # of active connections approaches the current ACE reactor limit.
@@ -1185,7 +1188,7 @@
 ///
 /// EXCEPTIONS:
 /// MgConnectionNotOpenException
-time_t MgServerManager::GetUptime()
+INT64 MgServerManager::GetUptime()
 {
     ACE_Time_Value upTime(0);
 
@@ -1195,7 +1198,7 @@
 
     MG_CATCH_AND_THROW(L"MgServerManager.GetUptime");
 
-    return upTime.sec();
+    return (INT64)upTime.sec();
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -1208,7 +1211,7 @@
 ///
 /// EXCEPTIONS:
 /// MgConnectionNotOpenException
-time_t MgServerManager::GetAverageOperationTime()
+INT64 MgServerManager::GetAverageOperationTime()
 {
     double avgTime = 0.0;
 
@@ -1216,13 +1219,13 @@
 
     if (GetTotalProcessedOperations() > 0)
     {
-        avgTime = ((double)(GetTotalOperationTime()) * 1000.0) / (double)(GetTotalProcessedOperations());
+        avgTime = ((double)(GetTotalOperationTime())) / (double)(GetTotalProcessedOperations());
     }
 
 
     MG_CATCH_AND_THROW(L"MgServerManager.GetAverageOperationTime")
 
-    return time_t(avgTime);
+    return (INT64)avgTime;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -36,7 +36,7 @@
 class MgWorkerThread;
 
 typedef ACE_Atomic_Op<ACE_Thread_Mutex, INT32>  SAFE_INT32;
-typedef ACE_Atomic_Op<ACE_Thread_Mutex, time_t>  SAFE_TIME_T;
+typedef ACE_Atomic_Op<ACE_Thread_Mutex, INT64>  SAFE_INT64;
 
 class MG_SERVER_MANAGER_API MgServerManager : public MgGuardDisposable
 {
@@ -54,7 +54,7 @@
     void Initialize(CREFSTRING locale);
     void LoadConfigurationProperties();
 
-    CREFSTRING GetDefaultMessageLocale();
+    STRING GetDefaultMessageLocale();
 
     MgPropertyCollection* GetConfigurationProperties(CREFSTRING propertySection);
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
@@ -68,20 +68,20 @@
     void SetDocument(CREFSTRING identifier, MgByteReader* data);
 
     bool IsSiteServer() const;
-    CREFSTRING GetServerName() const;
-    CREFSTRING GetLocalServerAddress() const;
+    STRING GetServerName() const;
+    STRING GetLocalServerAddress() const;
 
     // Admin Properties
     INT32 GetAdminPort();
     INT32 GetAdminThreads();
-    CREFSTRING GetAdminEmail();
+    STRING GetAdminEmail();
 
     // Client Properties
     INT32 GetClientPort();
     INT32 GetClientThreads();
 
     // Site Properties
-    CREFSTRING GetSiteServerAddress() const;
+    STRING GetSiteServerAddress() const;
     INT32 GetSitePort();
     INT32 GetSiteThreads();
 
@@ -100,9 +100,9 @@
     ACE_Time_Value GetStartTime();
     INT32 GetTotalReceivedOperations();
     INT32 GetTotalProcessedOperations();
-    time_t GetTotalOperationTime();
+    INT64 GetTotalOperationTime();
 
-    void IncrementOperationTime(time_t operationTime);
+    void IncrementOperationTime(INT64 operationTime);
     void IncrementReceivedOperations();
     void IncrementProcessedOperations();
 
@@ -117,8 +117,8 @@
     INT32 GetClientOperationsQueueCount();
     INT32 GetSiteOperationsQueueCount();
 
-    time_t GetUptime();
-    time_t GetAverageOperationTime();
+    INT64 GetUptime();
+    INT64 GetAverageOperationTime();
 
     INT64 GetTotalPhysicalMemory();
     INT64 GetAvailablePhysicalMemory();
@@ -176,7 +176,7 @@
     INT32 m_nSiteThreads;
 
     ACE_Time_Value m_startTime;
-    SAFE_TIME_T m_totalOperationTime;        // This value is tracked in seconds
+    SAFE_INT64 m_totalOperationTime;        // This value is tracked in milliseconds
     SAFE_INT32 m_totalReceivedOperations;
     SAFE_INT32 m_totalProcessedOperations;
 
@@ -201,17 +201,17 @@
     return m_isSiteServer;
 }
 
-inline CREFSTRING MgServerManager::GetServerName() const
+inline STRING MgServerManager::GetServerName() const
 {
     return m_displayName;
 }
 
-inline CREFSTRING MgServerManager::GetLocalServerAddress() const
+inline STRING MgServerManager::GetLocalServerAddress() const
 {
     return m_localServerAddress;
 }
 
-inline CREFSTRING MgServerManager::GetSiteServerAddress() const
+inline STRING MgServerManager::GetSiteServerAddress() const
 {
     return m_siteServerAddress;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/ServerManager.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -125,7 +125,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -206,7 +206,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -286,7 +286,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/ServiceManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -165,7 +165,7 @@
 ///
 MgService* MgServiceManager::RequestLocalService(INT32 serviceType)
 {
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     Ptr<MgConnectionProperties> connProp = new MgConnectionProperties(
         currUserInfo, L"", 0);
 
@@ -186,7 +186,7 @@
     serverAddress = m_loadBalanceManager->RequestServer(serviceType);
 
     // Use the site port for Site/Support Server communications.
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     Ptr<MgConnectionProperties> connProp = new MgConnectionProperties(
         currUserInfo, serverAddress, m_serverManager->GetSitePort());
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/SessionInfo.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/SessionInfo.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/SessionInfo.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,9 +44,9 @@
 
 public:
 
-    CREFSTRING GetUser() const;
-    CREFSTRING GetClient() const;
-    CREFSTRING GetClientIp() const;
+    STRING GetUser() const;
+    STRING GetClient() const;
+    STRING GetClientIp() const;
     const MgDateTime& GetStartTime() const;
     MgDateTime GetEndTime() const;
     const ACE_Time_Value& GetAccessedTime() const;
@@ -75,17 +75,17 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgSessionInfo::GetUser() const
+inline STRING MgSessionInfo::GetUser() const
 {
     return m_user;
 }
 
-inline CREFSTRING MgSessionInfo::GetClient() const
+inline STRING MgSessionInfo::GetClient() const
 {
     return m_client;
 }
 
-inline CREFSTRING MgSessionInfo::GetClientIp() const
+inline STRING MgSessionInfo::GetClientIp() const
 {
     return m_clientIp;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -88,7 +88,7 @@
 /// </summary>
 ///----------------------------------------------------------------------------
 
-CREFSTRING MgUserInfo::GetPassword() const
+STRING MgUserInfo::GetPassword() const
 {
     if (m_passwordEncrypted)
     {

Modified: sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Manager/UserInfo.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -39,7 +39,7 @@
 public:
 
     void SetPassword(CREFSTRING password, bool passwordEncrypted = false);
-    CREFSTRING GetPassword() const;
+    STRING GetPassword() const;
 
 /// Data Members
 

Modified: sandbox/rfc90/MgDev/Server/src/Common/Thread/ServerThread.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Common/Thread/ServerThread.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Common/Thread/ServerThread.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Core/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -9,7 +9,7 @@
 
 INCLUDES = \
   -I../../../Oem/ACE/ACE_wrappers \
-  -I../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../Oem/dbxml/xerces-c-src/src \
   -I $(map_fdo_include) \
   -I $(map_fdo_include)/ExpressionEngine \
   -I../Common \
@@ -96,7 +96,7 @@
   -ldwftk \
   -ldwfemap \
   -lexpat \
-  -lFDO-3.5.0 \
+  -lFDO-3.6.0 \
   -lExpressionEngine \
   -lxalanMsg \
   -lxalan-c \
@@ -131,7 +131,7 @@
   -R$(map_srcdir)/Oem/DWFTK7.1/develop/global/src/dwfcore \
   -R$(map_srcdir)/Oem/DWFTK7.1/develop/global/src/dwf \
   -R$(map_srcdir)/Oem/DWFTK7.1/develop/global/src/dwfemap \
-  -R$(map_srcdir)/Oem/dbxml-2.3.10/install/lib \
+  -R$(map_srcdir)/Oem/dbxml/install/lib \
   -R$(map_srcdir)/Common/CoordinateSystem/.libs \
   -R$(map_srcdir)/Common/MdfModel/.libs \
   -R$(map_srcdir)/Common/MdfParser/.libs \
@@ -160,7 +160,7 @@
   -L../../../Oem/DWFTK7.1/develop/global/src/dwfcore \
   -L../../../Oem/DWFTK7.1/develop/global/src/dwf \
   -L../../../Oem/DWFTK7.1/develop/global/src/dwfemap \
-  -L../../../Oem/dbxml-2.3.10/install/lib \
+  -L../../../Oem/dbxml/install/lib \
   -L$(top_builddir)/Common/CoordinateSystem \
   -L../../../Common/MdfModel \
   -L../../../Common/MdfParser \
@@ -367,17 +367,17 @@
 				cp -f -r $(mentor_dict_source_dir)/* $(mentor_dict_install_dir);)
 	@cp -fp ../../../Common/Schema/*.xsd $(schemadir)
 	@cp -fp ../../../Oem/DWFTK7.1/develop/global/fonts/* ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_archive ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_checkpoint ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_dump ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_hotbackup ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_load ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_recover ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_upgrade ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/db_verify ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/dbxml ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/dbxml_dump ${prefix}/bin/
-	@cp -fp ../../../Oem/dbxml-2.3.10/install/bin/dbxml_load ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_archive ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_checkpoint ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_dump ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_hotbackup ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_load ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_recover ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_upgrade ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/db_verify ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/dbxml ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/dbxml_dump ${prefix}/bin/
+	@cp -fp ../../../Oem/dbxml/install/bin/dbxml_load ${prefix}/bin/
 	@cp -fp ../../RepositoryAdmin/*.sh $(repositoryadmindir)
 	@cp -fp ../../RepositoryAdmin/*.php $(repositoryadmindir)
 	@cp -fp ../../RepositoryAdmin/*.inc $(repositoryadmindir)
@@ -404,7 +404,7 @@
              -e 's#^ResourceSchemaFilePath.*=.*#ResourceSchemaFilePath             = ${prefix}/Schema/#' \
              -e 's#^ResourceDataFileTrashFolderName.*=.*#ResourceDataFileTrashFolderName    = Trash#' \
            serverconfig.ini > ${prefix}/bin/serverconfig.ini
-	@echo '#!/bin/sh' > ${prefix}/bin/mgserver.sh
+	@echo '#!/bin/bash' > ${prefix}/bin/mgserver.sh
 	@echo '' >> ${prefix}/bin/mgserver.sh
 	@echo 'export MENTOR_DICTIONARY_PATH=$(mentor_dict_install_dir)' >> ${prefix}/bin/mgserver.sh
 	@echo 'export LD_LIBRARY_PATH=$(fdodir):"$$LD_LIBRARY_PATH"' >> ${prefix}/bin/mgserver.sh

Modified: sandbox/rfc90/MgDev/Server/src/Core/OperationThread.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/OperationThread.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/OperationThread.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -309,7 +309,8 @@
     MG_TRY()
 
     {
-        ACE_Time_Value operationTime(0);
+        ACE_Time_Value operationStartTime(0);
+        operationStartTime = ACE_OS::gettimeofday();
         ACE_ASSERT( pData );
         if ( pData )
         {
@@ -396,6 +397,8 @@
                     stat = pServiceHandler->ProcessOperation();
 
                     m_timer.stop();
+                    ACE_Time_Value operationTime(0);
+                    operationTime = ACE_OS::gettimeofday() - operationStartTime;
                     m_timer.elapsed_time(operationTime);
 
                     delete pServiceHandler;
@@ -408,10 +411,13 @@
             // We increment operations processed for successful operations only.
             if (IMgServiceHandler::mpsDone == stat)
             {
-                time_t opTime = operationTime.sec();
+                ACE_Time_Value operationTime(0);
+                operationTime = ACE_OS::gettimeofday() - operationStartTime;
 
+                unsigned long opTime = operationTime.msec();
+
                 pConnection->IncrementProcessedOperations();
-                pConnection->SetCurrentOperationTime((INT32)opTime);
+                pConnection->SetCurrentOperationTime(opTime);
 
                 serverManager->IncrementProcessedOperations();
                 serverManager->IncrementOperationTime(opTime);

Modified: sandbox/rfc90/MgDev/Server/src/Core/Server.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/Server.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/Server.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -727,9 +727,9 @@
         {
             report_status(SERVICE_RUNNING);
 
-            // By default the executeable is the thread owner, but when this is being run as a 
+            // By default the executeable is the thread owner, but when this is being run as a
             // service the Windows Service Control Manager becomes the default thread owner.
-            // We need to make this thread the owner of the ACE reactor because this is a 
+            // We need to make this thread the owner of the ACE reactor because this is a
             // requirement of the ACE SELECT reactor.
             ACE_Reactor::instance()->owner(ACE_Thread::self());
         }
@@ -1196,7 +1196,7 @@
 
     MG_TRY()
 
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
 
     if (NULL != currUserInfo)
     {

Modified: sandbox/rfc90/MgDev/Server/src/Core/ServerCore.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/ServerCore.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/ServerCore.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Core/ServerCore.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/ServerCore.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/ServerCore.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -43,7 +43,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ACE_HAS_SVC_DLL=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDOCommon.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\mgserver.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\Oem\dbxml\lib;..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\mgserver.pdb"
@@ -124,7 +124,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ACE_HAS_SVC_DLL=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -145,10 +145,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDOCommon.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\mgserver.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\Oem\dbxml\lib64;..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\mgserver.pdb"
@@ -206,7 +206,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ACE_HAS_SVC_DLL=1"
 				StringPooling="true"
 				ExceptionHandling="2"
@@ -227,10 +227,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDOCommon.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\mgserver.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\Oem\dbxml\lib;..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\mgserver.pdb"
@@ -289,7 +289,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\Common;..\Common\Base;..\Common\Cache;..\Common\Manager;..\Common\Thread;..\Services\Drawing;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Renderers;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\gd\freetype\include;..\..\..\Oem\FDO\inc;..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ACE_HAS_SVC_DLL=1"
 				StringPooling="true"
 				ExceptionHandling="2"
@@ -310,10 +310,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDOCommon.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\mgserver.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\Oem\dbxml\lib64;..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\mgserver.pdb"
@@ -1031,10 +1031,6 @@
 			>
 		</File>
 		<File
-			RelativePath=".\serverconfig.ini"
-			>
-		</File>
-		<File
 			RelativePath=".\ServerCore.rc"
 			>
 		</File>

Modified: sandbox/rfc90/MgDev/Server/src/Core/main.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/main.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/main.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -71,6 +71,23 @@
     // we need initialize Xerces before BDB
     XMLPlatformUtils::Initialize();
 
+#ifndef _WIN32
+    MgConfiguration* pConfiguration = MgConfiguration::GetInstance();
+    pConfiguration->LoadConfiguration(MgConfigProperties::ServerConfigurationFilename);
+    bool bDebugMem = false;
+    pConfiguration->GetBoolValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyLinuxMemDebug, bDebugMem, MgConfigProperties::DefaultGeneralPropertyLinuxMemDebug);
+    if (!bDebugMem)
+    {
+        // Set memory checking to report only and not abort
+        mallopt(M_CHECK_ACTION, 1);
+    }
+    else
+    {
+        // Set memory checking to report and abort
+        mallopt(M_CHECK_ACTION, 3);
+    }
+#endif
+
     MG_TRY()
 
     {

Modified: sandbox/rfc90/MgDev/Server/src/Core/serverconfig.ini
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Core/serverconfig.ini	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Core/serverconfig.ini	2010-11-13 18:07:46 UTC (rev 5389)
@@ -1,4 +1,4 @@
-# *****************************************************************************
+# *****************************************************************************
 # MapGuide Server Configuration File
 #
 # The following configuration is based on a single CPU with a single core.
@@ -63,7 +63,7 @@
 #                                           RenderingService, TileService, KmlService, ServerAdminService, SiteService
 #                                       Example: MappingService:3,FeatureService:1
 # LogsPath                         Path where log files are stored
-# MachineIp                        IP address of the server
+# MachineIp                        IP address of this server
 #                                       0 < Length <= 255
 # MaxLogFileSize                   Max size allowed for the log files in
 #                                  kilobytes (KB)
@@ -161,7 +161,9 @@
 #
 # Property Name                    Description
 # -----------------------------------------------------------------------------
-# IpAddress                        IP address of the site server
+# IpAddress                        IP address of the site server. This is typically 
+#                                  the address of this server and matches the 
+#                                  MachineIp given above.
 #                                       0 < Length <= 255
 # MaxConnections                   Max # of open site connections
 #                                       0 < Value <= 1024
@@ -325,6 +327,10 @@
 # GeneralizeData                   Specifies whether feature geometry is generalized
 #                                  before being rendered (experimental)
 #                                       0 = false and 1 = true
+# MaxRasterImageWidth              The max width of raster image in pixels 
+#                                       0 < Value <= 2147483647
+# MaxRasterImageHeight             The max height of raster image in pixels 
+#                                       0 < Value <= 2147483647
 # *****************************************************************************
 TileExtentOffset                   = 0.35
 RasterGridSize                     = 100
@@ -336,6 +342,8 @@
 RenderSelectionBatchSize           = 50000
 ClampPoints                        = 0
 GeneralizeData                     = 0
+MaxRasterImageWidth                = 2048
+MaxRasterImageHeight               = 2048
 
 [ResourceServiceProperties]
 # *****************************************************************************
@@ -365,10 +373,8 @@
 #                                  are stored
 # SiteRepositoryPath               Path where the Site repository is stored
 # *****************************************************************************
-#LibraryRepositoryPath              = Repositories/Library/
-#LibraryResourceDataFilePath        = Repositories/Library/DataFiles/
-LibraryRepositoryPath              =C:\Program Files\OSGeo\MapGuide\Server\Repositories\BigLibrary\
-LibraryResourceDataFilePath        =C:\Program Files\OSGeo\MapGuide\Server\Repositories\BigLibrary\DataFiles\
+LibraryRepositoryPath              = Repositories/Library/
+LibraryResourceDataFilePath        = Repositories/Library/DataFiles/
 PackagesPath                       = Packages/
 RepositoryCheckpointsTimerInterval = 600
 ResourceChangeTimerInterval        = 5
@@ -414,18 +420,8 @@
 #                                       50 < value <= 10000
 # ImageFormat                      Image format for generated tiles
 #                                       PNG, PNG8, GIF or JPG
-# PollingInterval                  sleep in milliseconds before rechecking the lockfile
-# CreationCutoffTime               seconds after which abort the lockfile test
-# UseMetaTiles										 the dimension of the metatile 
-#                                  (2 = 4 subtiles, 3 = 9 subtiles, 4 = 16 subtiles, etc)
-# LockMethod                       0/1=use lockfile/tile 2=lockfile/metatile 
-#                                  3=ace_condition/metatile
 # *****************************************************************************
 RenderOnly                         = 0
-PollingInterval                    = 500
-CreationCutoffTime                 = 120
-UseMetaTiles                       = 4
-LockMethod                         = 3
 TileCachePath                      = Repositories/TileCache/
 TileColumnsPerFolder               = 30
 TileRowsPerFolder                  = 30

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsCommon/GwsCommon.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsCommon/GwsCommon.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsCommon/GwsCommon.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBatchSortedBlockJoinQueryResults.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -63,6 +63,12 @@
 
     m_propertyDescriptionCollection.clear();
 
+    if (m_right != NULL)
+    {
+        m_right->Release();
+        m_right = NULL;
+    }
+
     if (m_primaryFeatureIterator != NULL)
     {
         m_primaryFeatureIterator->Release ();

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryFeature.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -42,8 +42,7 @@
 
 CGwsBinaryFeature::~CGwsBinaryFeature () throw()
 {
-    if(m_pBinaryReader)
-        delete m_pBinaryReader;
+    delete m_pBinaryReader;
 }
 
 

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryReader.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -54,8 +54,7 @@
             delete [] (*iter);
     }
 
-    if (m_wcsCache)
-        delete [] m_wcsCache;
+    delete [] m_wcsCache;
 }
 
 

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsBinaryWriter.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -37,9 +37,7 @@
 BinaryWriter::~BinaryWriter()
 {
     delete [] m_data;
-
-    if (m_strCache)
-        delete [] m_strCache;
+    delete [] m_strCache;
 }
 
 
@@ -161,9 +159,7 @@
 
     if (m_strCacheLen < maxmbslen)
     {
-        if (m_strCache)
-            delete [] m_strCache;
-
+        delete [] m_strCache;
         m_strCacheLen = maxmbslen;
         m_strCache = new char[maxmbslen];
     }
@@ -207,9 +203,7 @@
 
     if (m_strCacheLen < maxmbslen)
     {
-        if (m_strCache)
-            delete [] m_strCache;
-
+        delete [] m_strCache;
         m_strCacheLen = maxmbslen;
         m_strCache = new char[maxmbslen];
     }

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsFeatureQueryResults.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -57,8 +57,7 @@
         printf ("\n%ld points converted\n", nPoints);
     }
 #endif
-    if(m_pBinaryWriter)
-        delete m_pBinaryWriter;
+    delete m_pBinaryWriter;
 }
 
 
@@ -691,9 +690,7 @@
 
 unsigned char* CGwsFeatureIterator::ToBuffer(int& bufLen)
 {
-    if(m_pBinaryWriter != NULL)
-        delete m_pBinaryWriter;
-
+    delete m_pBinaryWriter;
     m_pBinaryWriter = new GwsBinaryFeatureWriter();
 
     FdoPtr<IGWSExtendedFeatureDescription> ifdesc;

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsNestedLoopSortedBlockJoinQueryResults.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -62,7 +62,6 @@
         return stat;
     }
     m_prepquery = prepquery;
-
     CGwsRightJoinQueryResults * results =
             (CGwsRightJoinQueryResults *) rightquery->CreateFeatureIterator (eGwsRightNestedLoopSortedBlockIterator);
     stat = results->InitializeReader (query, rightquery, rightcols, bScrollable);
@@ -73,5 +72,6 @@
         m_right = results;
         m_right->AddRef ();
     }
+
     return stat;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryEngine.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryEngine.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsQueryEngine/GwsQueryEngine.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Gws/GwsResource/GwsResource.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Gws/GwsResource/GwsResource.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Gws/GwsResource/GwsResource.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -7,7 +7,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -34,7 +34,7 @@
 
 2 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 
@@ -456,7 +456,7 @@
 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
 LANGUAGE 9, 1
 #pragma code_page(1252)
-#include "afxres.rc"     // Standard components
+#include "winresrc.h"     // Standard components
 #endif
 
 /////////////////////////////////////////////////////////////////////////////

Modified: sandbox/rfc90/MgDev/Server/src/PostBuild/PostBuild.mak
===================================================================
--- sandbox/rfc90/MgDev/Server/src/PostBuild/PostBuild.mak	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/PostBuild/PostBuild.mak	2010-11-13 18:07:46 UTC (rev 5389)
@@ -64,36 +64,37 @@
 ..\..\bin\debug\GEOSd.pdb : ..\..\..\Oem\geos-2.2.0\VisualStudio\Debug\GEOSd.pdb
     xcopy /r /d /y ..\..\..\Oem\geos-2.2.0\VisualStudio\Debug\GEOSd.pdb ..\..\bin\debug\
 
-..\..\bin\debug\libdb45d.dll : ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdb45d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdb45d.dll ..\..\bin\debug\
+..\..\bin\debug\libdb48d.dll : ..\..\..\Oem\dbxml\bin\debug\libdb48d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\libdb48d.dll ..\..\bin\debug\
 
-..\..\bin\debug\libdb45d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdb45d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdb45d.pdb ..\..\bin\debug\
+..\..\bin\debug\libdb48d.pdb : ..\..\..\Oem\dbxml\bin\debug\libdb48d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\libdb48d.pdb ..\..\bin\debug\
 
-..\..\bin\debug\libdbxml23d.dll : ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdbxml23d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdbxml23d.dll ..\..\bin\debug\
+..\..\bin\debug\libdbxml25d.dll : ..\..\..\Oem\dbxml\bin\debug\libdbxml25d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\libdbxml25d.dll ..\..\bin\debug\
 
-..\..\bin\debug\libdbxml23d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdbxml23d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\libdbxml23d.pdb ..\..\bin\debug\
+..\..\bin\debug\libdbxml25d.pdb : ..\..\..\Oem\dbxml\bin\debug\libdbxml25d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\libdbxml25d.pdb ..\..\bin\debug\
 
-..\..\bin\debug\xqilla10d.dll : ..\..\..\Oem\dbxml-2.3.10\bin\debug\xqilla10d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\xqilla10d.dll ..\..\bin\debug\
+..\..\bin\debug\xqilla24d.dll : ..\..\..\Oem\dbxml\bin\debug\xqilla24d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\xqilla24d.dll ..\..\bin\debug\
 
-..\..\bin\debug\xqilla10d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\debug\xqilla10d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\xqilla10d.pdb ..\..\bin\debug\
+..\..\bin\debug\xqilla24d.pdb : ..\..\..\Oem\dbxml\bin\debug\xqilla24d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\xqilla24d.pdb ..\..\bin\debug\
 
-..\..\bin\debug\xerces-c_2_7D.dll : ..\..\..\Oem\dbxml-2.3.10\bin\debug\xerces-c_2_7D.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\xerces-c_2_7D.dll ..\..\bin\debug\
+..\..\bin\debug\xerces-c_3_1mgD.dll : ..\..\..\Oem\dbxml\bin\debug\xerces-c_3_1mgD.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\xerces-c_3_1mgD.dll ..\..\bin\debug\
 
-..\..\bin\debug\xerces-c_2_7D.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\debug\xerces-c_2_7D.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\debug\xerces-c_2_7D.pdb ..\..\bin\debug\
+..\..\bin\debug\xerces-c_3_1mgD.pdb : ..\..\..\Oem\dbxml\bin\debug\xerces-c_3_1mgD.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\debug\xerces-c_3_1mgD.pdb ..\..\bin\debug\
 
 ..\..\bin\debug\serverconfig.ini : ..\..\src\Core\serverconfig.ini
     xcopy /r /d /y ..\..\src\Core\serverconfig.ini ..\..\bin\debug\
 
 CopyFdoComponentsDebug : ..\..\..\Oem\FDO\*.*
     if NOT EXIST ..\..\bin\debug\FDO\nul mkdir ..\..\bin\debug\FDO
-    xcopy /r /d /y /s ..\..\..\Oem\FDO\bin ..\..\bin\debug\FDO\
+    if EXIST ..\..\..\Oem\FDO\bin\Release\nul xcopy /r /d /y /s ..\..\..\Oem\FDO\bin\Release ..\..\bin\debug\FDO\
+    if NOT EXIST ..\..\..\Oem\FDO\bin\Release\nul xcopy /r /d /y /s ..\..\..\Oem\FDO\bin ..\..\bin\debug\FDO\
 
 CopyFdoProvidersDebug : ..\..\..\Oem\FDO\ProviderList\ServerCommunity\providers.xml
     xcopy /r /d /y "..\..\..\Oem\FDO\ProviderList\ServerCommunity\providers.xml" ..\..\bin\debug\FDO\
@@ -148,14 +149,14 @@
         ..\..\bin\debug\gd.pdb \
         ..\..\bin\debug\GEOSd.dll \
         ..\..\bin\debug\GEOSd.pdb \
-        ..\..\bin\debug\libdb45d.dll \
-        ..\..\bin\debug\libdb45d.pdb \
-        ..\..\bin\debug\libdbxml23d.dll \
-        ..\..\bin\debug\libdbxml23d.pdb \
-        ..\..\bin\debug\xqilla10d.dll \
-        ..\..\bin\debug\xqilla10d.pdb \
-        ..\..\bin\debug\xerces-c_2_7D.dll \
-        ..\..\bin\debug\xerces-c_2_7D.pdb \
+        ..\..\bin\debug\libdb48d.dll \
+        ..\..\bin\debug\libdb48d.pdb \
+        ..\..\bin\debug\libdbxml25d.dll \
+        ..\..\bin\debug\libdbxml25d.pdb \
+        ..\..\bin\debug\xqilla24d.dll \
+        ..\..\bin\debug\xqilla24d.pdb \
+        ..\..\bin\debug\xerces-c_3_1mgD.dll \
+        ..\..\bin\debug\xerces-c_3_1mgD.pdb \
         ..\..\bin\debug\serverconfig.ini \
         ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml \
         ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \
@@ -177,6 +178,8 @@
         ..\..\bin\UnitTestFiles\UT_NoLegend.pl \
         ..\..\bin\UnitTestFiles\UT_SymbolMart.sl \
         ..\..\bin\UnitTestFiles\UT_Symbols.dwf \
+        ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf \
+        ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf \
         ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf \
         ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf \
         ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs \
@@ -206,6 +209,7 @@
         ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt \
         ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt \
         ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
+        ..\..\bin\UnitTestFiles\MdfTestMap.mdf \
         ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
         ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
         ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
@@ -312,29 +316,29 @@
 ..\..\bin\debug64\GEOSd.pdb : ..\..\..\Oem\geos-2.2.0\VisualStudio\Debug64\GEOSd.pdb
     xcopy /r /d /y ..\..\..\Oem\geos-2.2.0\VisualStudio\Debug64\GEOSd.pdb ..\..\bin\debug64\
 
-..\..\bin\debug64\libdb45d.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdb45d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdb45d.dll ..\..\bin\debug64\
+..\..\bin\debug64\libdb48d.dll : ..\..\..\Oem\dbxml\bin64\debug\libdb48d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\libdb48d.dll ..\..\bin\debug64\
 
-..\..\bin\debug64\libdb45d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdb45d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdb45d.pdb ..\..\bin\debug64\
+..\..\bin\debug64\libdb48d.pdb : ..\..\..\Oem\dbxml\bin64\debug\libdb48d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\libdb48d.pdb ..\..\bin\debug64\
 
-..\..\bin\debug64\libdbxml23d.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdbxml23d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdbxml23d.dll ..\..\bin\debug64\
+..\..\bin\debug64\libdbxml25d.dll : ..\..\..\Oem\dbxml\bin64\debug\libdbxml25d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\libdbxml25d.dll ..\..\bin\debug64\
 
-..\..\bin\debug64\libdbxml23d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdbxml23d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\libdbxml23d.pdb ..\..\bin\debug64\
+..\..\bin\debug64\libdbxml25d.pdb : ..\..\..\Oem\dbxml\bin64\debug\libdbxml25d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\libdbxml25d.pdb ..\..\bin\debug64\
 
-..\..\bin\debug64\xqilla10d.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xqilla10d.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xqilla10d.dll ..\..\bin\debug64\
+..\..\bin\debug64\xqilla24d.dll : ..\..\..\Oem\dbxml\bin64\debug\xqilla24d.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\xqilla24d.dll ..\..\bin\debug64\
 
-..\..\bin\debug64\xqilla10d.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xqilla10d.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xqilla10d.pdb ..\..\bin\debug64\
+..\..\bin\debug64\xqilla24d.pdb : ..\..\..\Oem\dbxml\bin64\debug\xqilla24d.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\xqilla24d.pdb ..\..\bin\debug64\
 
-..\..\bin\debug64\xerces-c_2_7D.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xerces-c_2_7D.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xerces-c_2_7D.dll ..\..\bin\debug64\
+..\..\bin\debug64\xerces-c_3_1mgD.dll : ..\..\..\Oem\dbxml\bin64\debug\xerces-c_3_1mgD.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\xerces-c_3_1mgD.dll ..\..\bin\debug64\
 
-..\..\bin\debug64\xerces-c_2_7D.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xerces-c_2_7D.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\debug\xerces-c_2_7D.pdb ..\..\bin\debug64\
+..\..\bin\debug64\xerces-c_3_1mgD.pdb : ..\..\..\Oem\dbxml\bin64\debug\xerces-c_3_1mgD.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\debug\xerces-c_3_1mgD.pdb ..\..\bin\debug64\
 
 ..\..\bin\debug64\serverconfig.ini : ..\..\src\Core\serverconfig.ini
     xcopy /r /d /y ..\..\src\Core\serverconfig.ini ..\..\bin\debug64\
@@ -396,14 +400,14 @@
         ..\..\bin\debug64\gd.pdb \
         ..\..\bin\debug64\GEOSd.dll \
         ..\..\bin\debug64\GEOSd.pdb \
-        ..\..\bin\debug64\libdb45d.dll \
-        ..\..\bin\debug64\libdb45d.pdb \
-        ..\..\bin\debug64\libdbxml23d.dll \
-        ..\..\bin\debug64\libdbxml23d.pdb \
-        ..\..\bin\debug64\xqilla10d.dll \
-        ..\..\bin\debug64\xqilla10d.pdb \
-        ..\..\bin\debug64\xerces-c_2_7D.dll \
-        ..\..\bin\debug64\xerces-c_2_7D.pdb \
+        ..\..\bin\debug64\libdb48d.dll \
+        ..\..\bin\debug64\libdb48d.pdb \
+        ..\..\bin\debug64\libdbxml25d.dll \
+        ..\..\bin\debug64\libdbxml25d.pdb \
+        ..\..\bin\debug64\xqilla24d.dll \
+        ..\..\bin\debug64\xqilla24d.pdb \
+        ..\..\bin\debug64\xerces-c_3_1mgD.dll \
+        ..\..\bin\debug64\xerces-c_3_1mgD.pdb \
         ..\..\bin\debug64\serverconfig.ini \
         ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml \
         ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \
@@ -425,6 +429,8 @@
         ..\..\bin\UnitTestFiles\UT_NoLegend.pl \
         ..\..\bin\UnitTestFiles\UT_SymbolMart.sl \
         ..\..\bin\UnitTestFiles\UT_Symbols.dwf \
+        ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf \
+        ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf \
         ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf \
         ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf \
         ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs \
@@ -454,6 +460,7 @@
         ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt \
         ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt \
         ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
+        ..\..\bin\UnitTestFiles\MdfTestMap.mdf \
         ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
         ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
         ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
@@ -560,29 +567,29 @@
 ..\..\bin\release\GEOS.pdb : ..\..\..\Oem\geos-2.2.0\VisualStudio\Release\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos-2.2.0\VisualStudio\Release\GEOS.pdb ..\..\bin\release\
 
-..\..\bin\release\libdb45.dll : ..\..\..\Oem\dbxml-2.3.10\bin\libdb45.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\libdb45.dll ..\..\bin\release\
+..\..\bin\release\libdb48.dll : ..\..\..\Oem\dbxml\bin\libdb48.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\libdb48.dll ..\..\bin\release\
 
-..\..\bin\release\libdb45.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\libdb45.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\libdb45.pdb ..\..\bin\release\
+..\..\bin\release\libdb48.pdb : ..\..\..\Oem\dbxml\bin\libdb48.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\libdb48.pdb ..\..\bin\release\
 
-..\..\bin\release\libdbxml23.dll : ..\..\..\Oem\dbxml-2.3.10\bin\libdbxml23.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\libdbxml23.dll ..\..\bin\release\
+..\..\bin\release\libdbxml25.dll : ..\..\..\Oem\dbxml\bin\libdbxml25.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\libdbxml25.dll ..\..\bin\release\
 
-..\..\bin\release\libdbxml23.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\libdbxml23.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\libdbxml23.pdb ..\..\bin\release\
+..\..\bin\release\libdbxml25.pdb : ..\..\..\Oem\dbxml\bin\libdbxml25.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\libdbxml25.pdb ..\..\bin\release\
 
-..\..\bin\release\xqilla10.dll : ..\..\..\Oem\dbxml-2.3.10\bin\xqilla10.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\xqilla10.dll ..\..\bin\release\
+..\..\bin\release\xqilla24.dll : ..\..\..\Oem\dbxml\bin\xqilla24.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\xqilla24.dll ..\..\bin\release\
 
-..\..\bin\release\xqilla10.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\xqilla10.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\xqilla10.pdb ..\..\bin\release\
+..\..\bin\release\xqilla24.pdb : ..\..\..\Oem\dbxml\bin\xqilla24.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\xqilla24.pdb ..\..\bin\release\
 
-..\..\bin\release\xerces-c_2_7.dll : ..\..\..\Oem\dbxml-2.3.10\bin\xerces-c_2_7.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\xerces-c_2_7.dll ..\..\bin\release\
+..\..\bin\release\xerces-c_3_1mg.dll : ..\..\..\Oem\dbxml\bin\xerces-c_3_1mg.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\xerces-c_3_1mg.dll ..\..\bin\release\
 
-..\..\bin\release\xerces-c_2_7.pdb : ..\..\..\Oem\dbxml-2.3.10\bin\xerces-c_2_7.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin\xerces-c_2_7.pdb ..\..\bin\release\
+..\..\bin\release\xerces-c_3_1mg.pdb : ..\..\..\Oem\dbxml\bin\xerces-c_3_1mg.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin\xerces-c_3_1mg.pdb ..\..\bin\release\
 
 ..\..\bin\release\serverconfig.ini : ..\..\src\Core\serverconfig.ini
     xcopy /r /d /y ..\..\src\Core\serverconfig.ini ..\..\bin\release\
@@ -644,14 +651,14 @@
           ..\..\bin\release\gd.pdb \
           ..\..\bin\release\GEOS.dll \
           ..\..\bin\release\GEOS.pdb \
-          ..\..\bin\release\libdb45.dll \
-          ..\..\bin\release\libdb45.pdb \
-          ..\..\bin\release\libdbxml23.dll \
-          ..\..\bin\release\libdbxml23.pdb \
-          ..\..\bin\release\xqilla10.dll \
-          ..\..\bin\release\xqilla10.pdb \
-          ..\..\bin\release\xerces-c_2_7.dll \
-          ..\..\bin\release\xerces-c_2_7.pdb \
+          ..\..\bin\release\libdb48.dll \
+          ..\..\bin\release\libdb48.pdb \
+          ..\..\bin\release\libdbxml25.dll \
+          ..\..\bin\release\libdbxml25.pdb \
+          ..\..\bin\release\xqilla24.dll \
+          ..\..\bin\release\xqilla24.pdb \
+          ..\..\bin\release\xerces-c_3_1mg.dll \
+          ..\..\bin\release\xerces-c_3_1mg.pdb \
           ..\..\bin\release\serverconfig.ini \
           ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml \
           ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \
@@ -673,6 +680,8 @@
           ..\..\bin\UnitTestFiles\UT_NoLegend.pl \
           ..\..\bin\UnitTestFiles\UT_SymbolMart.sl \
           ..\..\bin\UnitTestFiles\UT_Symbols.dwf \
+          ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf \
+          ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf \
           ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf \
           ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf \
           ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs \
@@ -702,6 +711,7 @@
           ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt \
           ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt \
           ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
+          ..\..\bin\UnitTestFiles\MdfTestMap.mdf \
           ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
           ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
           ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
@@ -808,29 +818,29 @@
 ..\..\bin\release64\GEOS.pdb : ..\..\..\Oem\geos-2.2.0\VisualStudio\Release64\GEOS.pdb
     xcopy /r /d /y ..\..\..\Oem\geos-2.2.0\VisualStudio\Release64\GEOS.pdb ..\..\bin\release64\
 
-..\..\bin\release64\libdb45.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\libdb45.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\libdb45.dll ..\..\bin\release64\
+..\..\bin\release64\libdb48.dll : ..\..\..\Oem\dbxml\bin64\libdb48.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\libdb48.dll ..\..\bin\release64\
 
-..\..\bin\release64\libdb45.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\libdb45.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\libdb45.pdb ..\..\bin\release64\
+..\..\bin\release64\libdb48.pdb : ..\..\..\Oem\dbxml\bin64\libdb48.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\libdb48.pdb ..\..\bin\release64\
 
-..\..\bin\release64\libdbxml23.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\libdbxml23.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\libdbxml23.dll ..\..\bin\release64\
+..\..\bin\release64\libdbxml25.dll : ..\..\..\Oem\dbxml\bin64\libdbxml25.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\libdbxml25.dll ..\..\bin\release64\
 
-..\..\bin\release64\libdbxml23.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\libdbxml23.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\libdbxml23.pdb ..\..\bin\release64\
+..\..\bin\release64\libdbxml25.pdb : ..\..\..\Oem\dbxml\bin64\libdbxml25.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\libdbxml25.pdb ..\..\bin\release64\
 
-..\..\bin\release64\xqilla10.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\xqilla10.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\xqilla10.dll ..\..\bin\release64\
+..\..\bin\release64\xqilla24.dll : ..\..\..\Oem\dbxml\bin64\xqilla24.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\xqilla24.dll ..\..\bin\release64\
 
-..\..\bin\release64\xqilla10.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\xqilla10.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\xqilla10.pdb ..\..\bin\release64\
+..\..\bin\release64\xqilla24.pdb : ..\..\..\Oem\dbxml\bin64\xqilla24.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\xqilla24.pdb ..\..\bin\release64\
 
-..\..\bin\release64\xerces-c_2_7.dll : ..\..\..\Oem\dbxml-2.3.10\bin64\xerces-c_2_7.dll
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\xerces-c_2_7.dll ..\..\bin\release64\
+..\..\bin\release64\xerces-c_3_1mg.dll : ..\..\..\Oem\dbxml\bin64\xerces-c_3_1mg.dll
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\xerces-c_3_1mg.dll ..\..\bin\release64\
 
-..\..\bin\release64\xerces-c_2_7.pdb : ..\..\..\Oem\dbxml-2.3.10\bin64\xerces-c_2_7.pdb
-    xcopy /r /d /y ..\..\..\Oem\dbxml-2.3.10\bin64\xerces-c_2_7.pdb ..\..\bin\release64\
+..\..\bin\release64\xerces-c_3_1mg.pdb : ..\..\..\Oem\dbxml\bin64\xerces-c_3_1mg.pdb
+    xcopy /r /d /y ..\..\..\Oem\dbxml\bin64\xerces-c_3_1mg.pdb ..\..\bin\release64\
 
 ..\..\bin\release64\serverconfig.ini : ..\..\src\Core\serverconfig.ini
     xcopy /r /d /y ..\..\src\Core\serverconfig.ini ..\..\bin\release64\
@@ -892,14 +902,14 @@
           ..\..\bin\release64\gd.pdb \
           ..\..\bin\release64\GEOS.dll \
           ..\..\bin\release64\GEOS.pdb \
-          ..\..\bin\release64\libdb45.dll \
-          ..\..\bin\release64\libdb45.pdb \
-          ..\..\bin\release64\libdbxml23.dll \
-          ..\..\bin\release64\libdbxml23.pdb \
-          ..\..\bin\release64\xqilla10.dll \
-          ..\..\bin\release64\xqilla10.pdb \
-          ..\..\bin\release64\xerces-c_2_7.dll \
-          ..\..\bin\release64\xerces-c_2_7.pdb \
+          ..\..\bin\release64\libdb48.dll \
+          ..\..\bin\release64\libdb48.pdb \
+          ..\..\bin\release64\libdbxml25.dll \
+          ..\..\bin\release64\libdbxml25.pdb \
+          ..\..\bin\release64\xqilla24.dll \
+          ..\..\bin\release64\xqilla24.pdb \
+          ..\..\bin\release64\xerces-c_3_1mg.dll \
+          ..\..\bin\release64\xerces-c_3_1mg.pdb \
           ..\..\bin\release64\serverconfig.ini \
           ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml \
           ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml \
@@ -921,6 +931,8 @@
           ..\..\bin\UnitTestFiles\UT_NoLegend.pl \
           ..\..\bin\UnitTestFiles\UT_SymbolMart.sl \
           ..\..\bin\UnitTestFiles\UT_Symbols.dwf \
+          ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf \
+          ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf \
           ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf \
           ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf \
           ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs \
@@ -950,6 +962,7 @@
           ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt \
           ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt \
           ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource \
+          ..\..\bin\UnitTestFiles\MdfTestMap.mdf \
           ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf \
           ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd \
           ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd \
@@ -1013,14 +1026,14 @@
     if EXIST ..\..\bin\debug\gd.pdb                          del /F ..\..\bin\debug\gd.pdb
     if EXIST ..\..\bin\debug\GEOSd.dll                       del /F ..\..\bin\debug\GEOSd.dll
     if EXIST ..\..\bin\debug\GEOSd.pdb                       del /F ..\..\bin\debug\GEOSd.pdb
-    if EXIST ..\..\bin\debug\libdb45d.dll                    del /F ..\..\bin\debug\libdb45d.dll
-    if EXIST ..\..\bin\debug\libdb45d.pdb                    del /F ..\..\bin\debug\libdb45d.pdb
-    if EXIST ..\..\bin\debug\libdbxml23d.dll                 del /F ..\..\bin\debug\libdbxml23d.dll
-    if EXIST ..\..\bin\debug\libdbxml23d.pdb                 del /F ..\..\bin\debug\libdbxml23d.pdb
-    if EXIST ..\..\bin\debug\xqilla10d.dll                   del /F ..\..\bin\debug\xqilla10d.dll
-    if EXIST ..\..\bin\debug\xqilla10d.pdb                   del /F ..\..\bin\debug\xqilla10d.pdb
-    if EXIST ..\..\bin\debug\xerces-c_2_7D.dll               del /F ..\..\bin\debug\xerces-c_2_7D.dll
-    if EXIST ..\..\bin\debug\xerces-c_2_7D.pdb               del /F ..\..\bin\debug\xerces-c_2_7D.pdb
+    if EXIST ..\..\bin\debug\libdb48d.dll                    del /F ..\..\bin\debug\libdb48d.dll
+    if EXIST ..\..\bin\debug\libdb48d.pdb                    del /F ..\..\bin\debug\libdb48d.pdb
+    if EXIST ..\..\bin\debug\libdbxml25d.dll                 del /F ..\..\bin\debug\libdbxml25d.dll
+    if EXIST ..\..\bin\debug\libdbxml25d.pdb                 del /F ..\..\bin\debug\libdbxml25d.pdb
+    if EXIST ..\..\bin\debug\xqilla24d.dll                   del /F ..\..\bin\debug\xqilla24d.dll
+    if EXIST ..\..\bin\debug\xqilla24d.pdb                   del /F ..\..\bin\debug\xqilla24d.pdb
+    if EXIST ..\..\bin\debug\xerces-c_3_1mgD.dll             del /F ..\..\bin\debug\xerces-c_3_1mgD.dll
+    if EXIST ..\..\bin\debug\xerces-c_3_1mgD.pdb             del /F ..\..\bin\debug\xerces-c_3_1mgD.pdb
     if EXIST ..\..\bin\debug\serverconfig.ini                del /F ..\..\bin\debug\serverconfig.ini
     if EXIST ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml   del /F ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml
     if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml     del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml
@@ -1042,6 +1055,8 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_NoLegend.pl                 del /F ..\..\bin\UnitTestFiles\UT_NoLegend.pl
     if EXIST ..\..\bin\UnitTestFiles\UT_SymbolMart.sl               del /F ..\..\bin\UnitTestFiles\UT_SymbolMart.sl
     if EXIST ..\..\bin\UnitTestFiles\UT_Symbols.dwf                 del /F ..\..\bin\UnitTestFiles\UT_Symbols.dwf
+    if EXIST ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf  del /F ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf
+    if EXIST ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf       del /F ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf
     if EXIST ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf               del /F ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf    del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs     del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs
@@ -1071,6 +1086,7 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt       del /F ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt    del /F ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
+    if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf                 del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf          del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd       del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
     if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd         del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
@@ -1129,14 +1145,14 @@
     if EXIST ..\..\bin\debug64\gd.pdb                          del /F ..\..\bin\debug64\gd.pdb
     if EXIST ..\..\bin\debug64\GEOSd.dll                       del /F ..\..\bin\debug64\GEOSd.dll
     if EXIST ..\..\bin\debug64\GEOSd.pdb                       del /F ..\..\bin\debug64\GEOSd.pdb
-    if EXIST ..\..\bin\debug64\libdb45d.dll                    del /F ..\..\bin\debug64\libdb45d.dll
-    if EXIST ..\..\bin\debug64\libdb45d.pdb                    del /F ..\..\bin\debug64\libdb45d.pdb
-    if EXIST ..\..\bin\debug64\libdbxml23d.dll                 del /F ..\..\bin\debug64\libdbxml23d.dll
-    if EXIST ..\..\bin\debug64\libdbxml23d.pdb                 del /F ..\..\bin\debug64\libdbxml23d.pdb
-    if EXIST ..\..\bin\debug64\xqilla10d.dll                   del /F ..\..\bin\debug64\xqilla10d.dll
-    if EXIST ..\..\bin\debug64\xqilla10d.pdb                   del /F ..\..\bin\debug64\xqilla10d.pdb
-    if EXIST ..\..\bin\debug64\xerces-c_2_7D.dll               del /F ..\..\bin\debug64\xerces-c_2_7D.dll
-    if EXIST ..\..\bin\debug64\xerces-c_2_7D.pdb               del /F ..\..\bin\debug64\xerces-c_2_7D.pdb
+    if EXIST ..\..\bin\debug64\libdb48d.dll                    del /F ..\..\bin\debug64\libdb48d.dll
+    if EXIST ..\..\bin\debug64\libdb48d.pdb                    del /F ..\..\bin\debug64\libdb48d.pdb
+    if EXIST ..\..\bin\debug64\libdbxml25d.dll                 del /F ..\..\bin\debug64\libdbxml25d.dll
+    if EXIST ..\..\bin\debug64\libdbxml25d.pdb                 del /F ..\..\bin\debug64\libdbxml25d.pdb
+    if EXIST ..\..\bin\debug64\xqilla24d.dll                   del /F ..\..\bin\debug64\xqilla24d.dll
+    if EXIST ..\..\bin\debug64\xqilla24d.pdb                   del /F ..\..\bin\debug64\xqilla24d.pdb
+    if EXIST ..\..\bin\debug64\xerces-c_3_1mgD.dll             del /F ..\..\bin\debug64\xerces-c_3_1mgD.dll
+    if EXIST ..\..\bin\debug64\xerces-c_3_1mgD.pdb             del /F ..\..\bin\debug64\xerces-c_3_1mgD.pdb
     if EXIST ..\..\bin\debug64\serverconfig.ini                del /F ..\..\bin\debug64\serverconfig.ini
     if EXIST ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml   del /F ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml
     if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml     del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml
@@ -1158,6 +1174,8 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_NoLegend.pl                 del /F ..\..\bin\UnitTestFiles\UT_NoLegend.pl
     if EXIST ..\..\bin\UnitTestFiles\UT_SymbolMart.sl               del /F ..\..\bin\UnitTestFiles\UT_SymbolMart.sl
     if EXIST ..\..\bin\UnitTestFiles\UT_Symbols.dwf                 del /F ..\..\bin\UnitTestFiles\UT_Symbols.dwf
+    if EXIST ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf  del /F ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf
+    if EXIST ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf       del /F ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf
     if EXIST ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf               del /F ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf    del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs     del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs
@@ -1187,6 +1205,7 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt       del /F ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt    del /F ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
+    if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf                 del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf          del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd       del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
     if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd         del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
@@ -1245,14 +1264,14 @@
     if EXIST ..\..\bin\release\gd.pdb                        del /F ..\..\bin\release\gd.pdb
     if EXIST ..\..\bin\release\GEOS.dll                      del /F ..\..\bin\release\GEOS.dll
     if EXIST ..\..\bin\release\GEOS.pdb                      del /F ..\..\bin\release\GEOS.pdb
-    if EXIST ..\..\bin\release\libdb45.dll                   del /F ..\..\bin\release\libdb45.dll
-    if EXIST ..\..\bin\release\libdb45.pdb                   del /F ..\..\bin\release\libdb45.pdb
-    if EXIST ..\..\bin\release\libdbxml23.dll                del /F ..\..\bin\release\libdbxml23.dll
-    if EXIST ..\..\bin\release\libdbxml23.pdb                del /F ..\..\bin\release\libdbxml23.pdb
-    if EXIST ..\..\bin\release\xqilla10.dll                  del /F ..\..\bin\release\xqilla10.dll
-    if EXIST ..\..\bin\release\xqilla10.pdb                  del /F ..\..\bin\release\xqilla10.pdb
-    if EXIST ..\..\bin\release\xerces-c_2_7.dll              del /F ..\..\bin\release\xerces-c_2_7.dll
-    if EXIST ..\..\bin\release\xerces-c_2_7.pdb              del /F ..\..\bin\release\xerces-c_2_7.pdb
+    if EXIST ..\..\bin\release\libdb48.dll                   del /F ..\..\bin\release\libdb48.dll
+    if EXIST ..\..\bin\release\libdb48.pdb                   del /F ..\..\bin\release\libdb48.pdb
+    if EXIST ..\..\bin\release\libdbxml25.dll                del /F ..\..\bin\release\libdbxml25.dll
+    if EXIST ..\..\bin\release\libdbxml25.pdb                del /F ..\..\bin\release\libdbxml25.pdb
+    if EXIST ..\..\bin\release\xqilla24.dll                  del /F ..\..\bin\release\xqilla24.dll
+    if EXIST ..\..\bin\release\xqilla24.pdb                  del /F ..\..\bin\release\xqilla24.pdb
+    if EXIST ..\..\bin\release\xerces-c_3_1mg.dll            del /F ..\..\bin\release\xerces-c_3_1mg.dll
+    if EXIST ..\..\bin\release\xerces-c_3_1mg.pdb            del /F ..\..\bin\release\xerces-c_3_1mg.pdb
     if EXIST ..\..\bin\release\serverconfig.ini              del /F ..\..\bin\release\serverconfig.ini
     if EXIST ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml   del /F ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml
     if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml     del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml
@@ -1274,6 +1293,8 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_NoLegend.pl                 del /F ..\..\bin\UnitTestFiles\UT_NoLegend.pl
     if EXIST ..\..\bin\UnitTestFiles\UT_SymbolMart.sl               del /F ..\..\bin\UnitTestFiles\UT_SymbolMart.sl
     if EXIST ..\..\bin\UnitTestFiles\UT_Symbols.dwf                 del /F ..\..\bin\UnitTestFiles\UT_Symbols.dwf
+    if EXIST ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf  del /F ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf
+    if EXIST ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf       del /F ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf
     if EXIST ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf               del /F ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf    del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs     del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs
@@ -1303,6 +1324,7 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt       del /F ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt    del /F ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
+    if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf                 del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf          del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd       del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
     if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd         del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
@@ -1360,14 +1382,14 @@
     if EXIST ..\..\bin\release64\gd.pdb                        del /F ..\..\bin\release64\gd.pdb
     if EXIST ..\..\bin\release64\GEOS.dll                      del /F ..\..\bin\release64\GEOS.dll
     if EXIST ..\..\bin\release64\GEOS.pdb                      del /F ..\..\bin\release64\GEOS.pdb
-    if EXIST ..\..\bin\release64\libdb45.dll                   del /F ..\..\bin\release64\libdb45.dll
-    if EXIST ..\..\bin\release64\libdb45.pdb                   del /F ..\..\bin\release64\libdb45.pdb
-    if EXIST ..\..\bin\release64\libdbxml23.dll                del /F ..\..\bin\release64\libdbxml23.dll
-    if EXIST ..\..\bin\release64\libdbxml23.pdb                del /F ..\..\bin\release64\libdbxml23.pdb
-    if EXIST ..\..\bin\release64\xqilla10.dll                  del /F ..\..\bin\release64\xqilla10.dll
-    if EXIST ..\..\bin\release64\xqilla10.pdb                  del /F ..\..\bin\release64\xqilla10.pdb
-    if EXIST ..\..\bin\release64\xerces-c_2_7.dll              del /F ..\..\bin\release64\xerces-c_2_7.dll
-    if EXIST ..\..\bin\release64\xerces-c_2_7.pdb              del /F ..\..\bin\release64\xerces-c_2_7.pdb
+    if EXIST ..\..\bin\release64\libdb48.dll                   del /F ..\..\bin\release64\libdb48.dll
+    if EXIST ..\..\bin\release64\libdb48.pdb                   del /F ..\..\bin\release64\libdb48.pdb
+    if EXIST ..\..\bin\release64\libdbxml25.dll                del /F ..\..\bin\release64\libdbxml25.dll
+    if EXIST ..\..\bin\release64\libdbxml25.pdb                del /F ..\..\bin\release64\libdbxml25.pdb
+    if EXIST ..\..\bin\release64\xqilla24.dll                  del /F ..\..\bin\release64\xqilla24.dll
+    if EXIST ..\..\bin\release64\xqilla24.pdb                  del /F ..\..\bin\release64\xqilla24.pdb
+    if EXIST ..\..\bin\release64\xerces-c_3_1mg.dll            del /F ..\..\bin\release64\xerces-c_3_1mg.dll
+    if EXIST ..\..\bin\release64\xerces-c_3_1mg.pdb            del /F ..\..\bin\release64\xerces-c_3_1mg.pdb
     if EXIST ..\..\bin\release64\serverconfig.ini              del /F ..\..\bin\release64\serverconfig.ini
     if EXIST ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml   del /F ..\..\bin\UnitTestFiles\LibraryRepositoryContent.xml
     if EXIST ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml     del /F ..\..\bin\UnitTestFiles\SampleRepositoryHeader.xml
@@ -1389,6 +1411,8 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_NoLegend.pl                 del /F ..\..\bin\UnitTestFiles\UT_NoLegend.pl
     if EXIST ..\..\bin\UnitTestFiles\UT_SymbolMart.sl               del /F ..\..\bin\UnitTestFiles\UT_SymbolMart.sl
     if EXIST ..\..\bin\UnitTestFiles\UT_Symbols.dwf                 del /F ..\..\bin\UnitTestFiles\UT_Symbols.dwf
+    if EXIST ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf  del /F ..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf
+    if EXIST ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf       del /F ..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf
     if EXIST ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf               del /F ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf    del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.sdf
     if EXIST ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs     del /F ..\..\bin\UnitTestFiles\UT_HydrographicPolygons.fs
@@ -1418,6 +1442,7 @@
     if EXIST ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt       del /F ..\..\bin\UnitTestFiles\UT_GetLayerKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt    del /F ..\..\bin\UnitTestFiles\UT_GetFeaturesKmlResult.txt
     if EXIST ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource del /F ..\..\bin\UnitTestFiles\TESTChainedInner1ToManyJoin.FeatureSource
+    if EXIST ..\..\bin\UnitTestFiles\MdfTestMap.mdf                 del /F ..\..\bin\UnitTestFiles\MdfTestMap.mdf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf          del /F ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf
     if EXIST ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd       del /F ..\..\bin\UnitTestFiles\MdfTestCompoundSymbol.sd
     if EXIST ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd         del /F ..\..\bin\UnitTestFiles\MdfTestSimpleSymbol.sd
@@ -1477,6 +1502,8 @@
 "..\..\..\UnitTest\TestData\MappingService\UT_NoLegend.pl" :
 "..\..\..\UnitTest\TestData\MappingService\UT_SymbolMart.sl" :
 "..\..\..\UnitTest\TestData\MappingService\UT_Symbols.dwf" :
+"..\..\..\UnitTest\TestData\MappingService\UT_SheboyganWithWatermark.mdf" :
+"..\..\..\UnitTest\TestData\MappingService\UT_PoweredByMapGuide.wdf" :
 "..\..\..\UnitTest\TestData\MappingService\UT_Sheboygan.mdf" :
 "..\..\..\UnitTest\TestData\MappingService\UT_HydrographicPolygons.sdf" :
 "..\..\..\UnitTest\TestData\MappingService\UT_HydrographicPolygons.fs" :
@@ -1500,6 +1527,7 @@
 "..\..\..\UnitTest\TestData\KmlService\UT_GetMapKmlResult.txt" :
 "..\..\..\UnitTest\TestData\KmlService\UT_GetLayerKmlResult.txt" :
 "..\..\..\UnitTest\TestData\KmlService\UT_GetFeaturesKmlResult.txt" :
+"..\..\..\UnitTest\TestData\MdfModel\MdfTestMap.mdf" :
 "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" :
 "..\..\..\UnitTest\TestData\MdfModel\MdfTestCompoundSymbol.sd" :
 "..\..\..\UnitTest\TestData\MdfModel\MdfTestSimpleSymbol.sd" :
@@ -1637,6 +1665,14 @@
     if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
     if EXIST "..\..\..\UnitTest\TestData\MappingService\UT_Symbols.dwf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MappingService\UT_Symbols.dwf" ..\..\bin\UnitTestFiles\
 
+..\..\bin\UnitTestFiles\UT_SheboyganWithWatermark.mdf : "..\..\..\UnitTest\TestData\MappingService\UT_SheboyganWithWatermark.mdf"
+    if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
+    if EXIST "..\..\..\UnitTest\TestData\MappingService\UT_SheboyganWithWatermark.mdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MappingService\UT_SheboyganWithWatermark.mdf" ..\..\bin\UnitTestFiles\
+
+..\..\bin\UnitTestFiles\UT_PoweredByMapGuide.wdf : "..\..\..\UnitTest\TestData\MappingService\UT_PoweredByMapGuide.wdf"
+    if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
+    if EXIST "..\..\..\UnitTest\TestData\MappingService\UT_PoweredByMapGuide.wdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MappingService\UT_PoweredByMapGuide.wdf" ..\..\bin\UnitTestFiles\
+
 ..\..\bin\UnitTestFiles\UT_Sheboygan.mdf : "..\..\..\UnitTest\TestData\MappingService\UT_Sheboygan.mdf"
     if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
     if EXIST "..\..\..\UnitTest\TestData\MappingService\UT_Sheboygan.mdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MappingService\UT_Sheboygan.mdf" ..\..\bin\UnitTestFiles\
@@ -1729,6 +1765,10 @@
     if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
     if EXIST "..\..\..\UnitTest\TestData\KmlService\UT_GetFeaturesKmlResult.txt" xcopy /r /d /y "..\..\..\UnitTest\TestData\KmlService\UT_GetFeaturesKmlResult.txt" ..\..\bin\UnitTestFiles\
 
+..\..\bin\UnitTestFiles\MdfTestMap.mdf : "..\..\..\UnitTest\TestData\MdfModel\MdfTestMap.mdf"
+    if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
+    if EXIST "..\..\..\UnitTest\TestData\MdfModel\MdfTestMap.mdf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MdfModel\MdfTestMap.mdf" ..\..\bin\UnitTestFiles\
+
 ..\..\bin\UnitTestFiles\MdfTestTypeStyles.ldf : "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf"
     if NOT EXIST ..\..\bin\UnitTestFiles\nul mkdir ..\..\bin\UnitTestFiles
     if EXIST "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" xcopy /r /d /y "..\..\..\UnitTest\TestData\MdfModel\MdfTestTypeStyles.ldf" ..\..\bin\UnitTestFiles\

Modified: sandbox/rfc90/MgDev/Server/src/Services/Drawing/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Drawing/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Drawing/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -13,7 +13,7 @@
   -I../../../../Common/MapGuideCommon \
   -I../../../../Oem/DWFTK7.1/develop/global/src \
   -I../../../../Oem/DWFTK7.1/develop/global/src/dwf \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../Common \
   -I../../Common/Base \
   -I../../Common/Manager \
@@ -67,7 +67,7 @@
 libMgServerDrawingService_la_LIBADD = -lMgFoundation -lMgGeometry -lMgPlatformBase -lMgMapGuideCommon -lxerces-c
 
 libMgServerDrawingService_la_LDFLAGS = -release $(PACKAGE_VERSION) \
-  -L../../../../Oem/dbxml-2.3.10/install/lib \
+  -L../../../../Oem/dbxml/install/lib \
   -L../../../../Common/Foundation \
   -L../../../../Common/Geometry \
   -L../../../../Common/PlatformBase \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Drawing/ServerDrawingService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_DRAWING_EXPORTS;DWFCORE_STATIC;DWFTK_STATIC;DWFTK_USE_DWFCORE_ZLIB;DWFTK_BUILD_EXPAT;WHIP_STATIC_LIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
 				OutputFile="$(OutDir)\MgServerDrawingServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerDrawingServiced.pdb"
 				SubSystem="2"
@@ -123,7 +123,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_DRAWING_EXPORTS;DWFCORE_STATIC;DWFTK_STATIC;DWFTK_USE_DWFCORE_ZLIB;DWFTK_BUILD_EXPAT;WHIP_STATIC_LIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -143,10 +143,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
 				OutputFile="$(OutDir)\MgServerDrawingServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug64\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug64\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerDrawingServiced.pdb"
 				SubSystem="2"
@@ -202,7 +202,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_DRAWING_EXPORTS;DWFCORE_STATIC;DWFTK_STATIC;DWFTK_USE_DWFCORE_ZLIB;DWFTK_BUILD_EXPAT;WHIP_STATIC_LIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -220,10 +220,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
 				OutputFile="$(OutDir)\MgServerDrawingService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerDrawingService.pdb"
 				SubSystem="2"
@@ -281,7 +281,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src\dwf"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_DRAWING_EXPORTS;DWFCORE_STATIC;DWFTK_STATIC;DWFTK_USE_DWFCORE_ZLIB;DWFTK_BUILD_EXPAT;WHIP_STATIC_LIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -299,10 +299,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib dwfcore_wt.1.1.1.lib dwftk_wt.7.1.1.lib whiptk_wt.7.7.601.lib"
 				OutputFile="$(OutDir)\MgServerDrawingService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release64\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release64\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerDrawingService.pdb"
 				SubSystem="2"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -28,11 +28,13 @@
 // Class MgFdoFeatureReader
 MgFdoFeatureReader::MgFdoFeatureReader() : m_currentReaderId(-1)
 {
+    m_readerDepleted = false;
     m_readerCollection = MgFdoReaderCollection::Create();
 }
 
 MgFdoFeatureReader::MgFdoFeatureReader(MgFdoReaderCollection *readerCollection) : m_currentReaderId(-1)
 {
+    m_readerDepleted = false;
     m_readerCollection = FDO_SAFE_ADDREF(readerCollection);
 }
 
@@ -421,35 +423,25 @@
 
 bool MgFdoFeatureReader::ReadNext( )
 {
-   bool retVal = false;
+    if (m_readerDepleted)
+        return false;
+
    if (m_currentReader == NULL)
-   {
        Initialize();
-   }
 
    if (m_currentReader->ReadNext())
-   {
-        retVal = true;
-   }
-   else
-   {
-       m_currentReaderId++;
-       if (m_readerCollection->GetCount() > m_currentReaderId)
-       {
-           m_currentReader = (FdoIFeatureReader*)m_readerCollection->GetItem(m_currentReaderId);
-           if (m_currentReader == NULL)
-           {
-               retVal = false;
-           }
-           else
-           {
-                retVal = m_currentReader->ReadNext();
-           }
-       }
-   }
+       return true;
 
-   return retVal;
+   m_currentReader = NULL;
+   m_currentReaderId++;
+   if ((m_readerCollection->GetCount() > m_currentReaderId))
+       m_currentReader = static_cast<FdoIFeatureReader*>(m_readerCollection->GetItem(m_currentReaderId));
 
+   if (m_currentReader != NULL)
+       return this->ReadNext();
+
+   m_readerDepleted = true;
+   return false;
 }
 
 void MgFdoFeatureReader::Close( )

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FdoFeatureReader.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -92,6 +92,7 @@
     FdoPtr<MgFdoReaderCollection> m_readerCollection;
     FdoPtr<FdoIFeatureReader> m_currentReader;
     FdoInt32 m_currentReaderId;
+    FdoBoolean m_readerDepleted;
     void Initialize();
 
 };

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureDistribution.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureDistribution.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureDistribution.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -33,7 +33,10 @@
 
     MgFeatureDistribution();
     virtual ~MgFeatureDistribution();
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 };
 
 #endif

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureGeometricFunctions.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -38,7 +38,10 @@
 
     MgFeatureGeometricFunctions();
     virtual ~MgFeatureGeometricFunctions();
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 
 private:
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureManipulationCommand.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -26,7 +26,10 @@
     static MgFeatureManipulationCommand* CreateCommand(MgFeatureCommand* command, MgServerFeatureConnection* connection, INT32 cmdId);
     virtual MgProperty* Execute() = 0;
 protected:
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 };
 
 #endif

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureNumericFunctions.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -32,7 +32,10 @@
     MgFeatureNumericFunctions(MgReader* reader, FdoFunction* customFunction, CREFSTRING propertyAlias);
     virtual ~MgFeatureNumericFunctions();
     virtual MgReader* Execute();
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 
 protected:
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -489,6 +489,7 @@
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
+        case VERSION_SUPPORTED(2,3):
             handler.reset(new MgOpDescribeWfsFeatureType());
             break;
         default:
@@ -501,6 +502,7 @@
         switch (VERSION_NO_PHASE(operationVersion))
         {
         case VERSION_SUPPORTED(1,0):
+        case VERSION_SUPPORTED(2,3):
             handler.reset(new MgOpGetWfsFeature());
             break;
         default:

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FeatureStringFunctions.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -36,7 +36,10 @@
 
     MgFeatureStringFunctions();
     virtual ~MgFeatureStringFunctions();
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 
 private:
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -153,6 +153,15 @@
     else if (xmlcmp(wnm, L"PropertyName") == 0)
     {
         m_propName = process_identifier(root);
+
+        // This is a workaround for GML3. For Name and Description properties, there will be a "gml:" prefix
+        // Remove the prefix to make sure Name and Description properties can be found by FDO API.
+        size_t pos = m_propName.find_first_of(L":");
+        if(pos != STRING::npos)
+        {
+            m_propName = m_propName.substr(pos+1);
+        }
+
         return m_propName;
     }
     else if (xmlcmp(wnm, L"Literal") == 0)

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/FilterUtil.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -21,11 +21,11 @@
 #include "ServerFeatureDllExport.h"
 
 //fwd declare
-namespace xercesc_2_7
+namespace XERCES_CPP_NAMESPACE
 {
     class DOMElement;
 }
-using namespace xercesc_2_7;
+using namespace XERCES_CPP_NAMESPACE;
 
 class MgCoordinateSystemTransform;
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -8,7 +8,7 @@
   -I$(map_fdo_include) \
   -I$(map_fdo_include)/ExpressionEngine \
   -I../../../../Oem/ACE/ACE_wrappers \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../Gws/Include \
   -I../../Gws/GwsCommon/inc \
   -I../../Gws/GwsQueryEngine/inc \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -86,6 +86,36 @@
         // Write the response
         EndExecution(byteReader);
     }
+    else if (3 == m_packet.m_NumArguments)
+    {
+        // Get the feature source
+        Ptr<MgResourceIdentifier> featureSourceId = (MgResourceIdentifier*)m_stream->GetObject();
+
+        // Get the feature class collection
+        Ptr<MgStringCollection> featureClasses = (MgStringCollection*)m_stream->GetObject();
+
+        // Get the output format
+        STRING outputFormat;
+        m_stream->GetString(outputFormat);
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureSourceId->ToString().c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(outputFormat.c_str());
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        Validate();
+
+        // Execute the operation
+        Ptr<MgByteReader> byteReader = m_service->DescribeWfsFeatureType(featureSourceId, featureClasses,outputFormat);
+
+        // Write the response
+        EndExecution(byteReader);
+    }
     else
     {
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetCapabilities.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -82,6 +82,30 @@
         // Write the response
         EndExecution(byteReader);
     }
+    else if (2 == m_packet.m_NumArguments)
+    {
+        // Get property name
+        STRING providerName;
+        m_stream->GetString(providerName);
+        STRING connectionString;
+        m_stream->GetString(connectionString);
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(providerName.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(connectionString.c_str());
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        Validate();
+
+        // Execute the operation
+        Ptr<MgByteReader> byteReader = m_service->GetCapabilities(providerName, connectionString);
+
+        // Write the response
+        EndExecution(byteReader);
+    }
     else
     {
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -111,6 +111,85 @@
         // Write the response
         EndExecution(byteReader);
     }
+    else if (11 == m_packet.m_NumArguments)
+    {
+        // Get the feature source
+        Ptr<MgResourceIdentifier> featureSourceId = (MgResourceIdentifier*)m_stream->GetObject();
+
+        // Get the schema name
+        STRING featureClass;
+        m_stream->GetString(featureClass);
+
+        // Get the required properties
+        Ptr<MgStringCollection> requiredProperties = (MgStringCollection*)m_stream->GetObject();
+
+        // Get the srs
+        STRING srs;
+        m_stream->GetString(srs);
+
+        // Get the filter
+        STRING filter;
+        m_stream->GetString(filter);
+
+        // Get the max features to return
+        INT32 maxFeatures;
+        m_stream->GetInt32(maxFeatures);
+
+        // Get the wfs version
+        STRING wfsVersion;
+        m_stream->GetString(wfsVersion);
+
+        // Get the output format
+        STRING outputFormat;
+        m_stream->GetString(outputFormat);
+
+        // Get the sort criteria
+        STRING sortCriteria;
+        m_stream->GetString(sortCriteria);
+
+        // Get the namespace prefix
+        STRING namespacePrefix;
+        m_stream->GetString(namespacePrefix);
+
+        // Get the namespace url
+        STRING namespaceUrl;
+        m_stream->GetString(namespaceUrl);
+
+        BeginExecution();
+
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureSourceId->ToString().c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureClass.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(srs.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(filter.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(wfsVersion.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(outputFormat.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(sortCriteria.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(namespacePrefix.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(namespaceUrl.c_str());
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+        Validate();
+
+        // Execute the operation
+        Ptr<MgByteReader> byteReader = m_service->GetWfsFeature(featureSourceId, featureClass,
+            requiredProperties, srs, filter, maxFeatures, wfsVersion, outputFormat, sortCriteria, namespacePrefix, namespaceUrl);
+
+        // Write the response
+        EndExecution(byteReader);
+    }
     else
     {
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectAggregateCommand.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -54,7 +54,11 @@
     virtual bool SupportsSelectOrdering();
     virtual bool SupportsSelectDistinct();
 
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
+
 private:
     Ptr<MgServerFeatureConnection> m_connection;
     STRING m_providerName;

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -254,7 +254,10 @@
         bool IsFragmented() { return m_isFragmented; }
         FdoFilter* GetNewFilter() { return m_newFilter ? FDO_SAFE_ADDREF(m_newFilter.p) : NULL; }
 
-        virtual void Dispose() { delete this; }
+        virtual void Dispose()
+        {
+            delete this;
+        }
 
         virtual void ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter)
         {
@@ -324,7 +327,7 @@
         }
     }
 
-#ifdef _MAPDEBUG
+#ifdef _DEBUG
     int nCount = fragmenter.GetOrCount();
     if ( nCount > 0)
     {

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/SelectCommand.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -60,7 +60,10 @@
     virtual bool SupportsSelectOrdering();
     virtual bool SupportsSelectDistinct();
 
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 
 private:
     Ptr<MgServerFeatureConnection> m_connection;

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDataReader.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDataReader.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDataReader.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -429,7 +429,6 @@
     MgByteReader* ToXml();
 
 protected:
-
     virtual void Dispose()
     {
         delete this;

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerDescribeSchema.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -41,7 +41,7 @@
     CREFSTRING schemaName, MgStringCollection* classNames, bool& classNameHintUsed)
 {
     // IMPORTANT INFORMATION
-    // FDO objects cannot be cached as they are not thread safe. 
+    // FDO objects cannot be cached as they are not thread safe.
     // This is not an issue because we create a MapGuide wrapper of this information that is thread safe.
     FdoPtr<FdoFeatureSchemaCollection> ffsc;
     ffsc = NULL;
@@ -60,7 +60,7 @@
 
         classNameHintUsed = IsClassNameHintUsed(fdoCommand);
 
-        if (!schemaName.empty())
+ /*       if (!schemaName.empty())
         {
             fdoCommand->SetSchemaName(schemaName.c_str());
         }
@@ -70,7 +70,7 @@
         if (NULL != fdoClassNames.p && fdoClassNames->GetCount() > 0)
         {
             fdoCommand->SetClassNames(fdoClassNames.p);
-        }
+        }*/
 
         // Execute the command
         ffsc = fdoCommand->Execute();
@@ -136,23 +136,36 @@
                         FdoPtr<FdoIDescribeSchema> fdoCommand2 = (FdoIDescribeSchema*)fdoConn2->CreateCommand(FdoCommandType_DescribeSchema);
                         CHECKNULL((FdoIDescribeSchema*)fdoCommand2, L"MgDescribeSchema.DescribeFdoSchema");
 
-                        if (!secSchemaName.empty())
-                        {
-                            fdoCommand2->SetSchemaName(secSchemaName.c_str());
-                        }
+                        //if (!secSchemaName.empty())
+                        //{
+                        //    fdoCommand2->SetSchemaName(secSchemaName.c_str());
+                        //}
 
-                        if (!secClassName.empty())
-                        {
-                            FdoPtr<FdoStringCollection> fdoClassNames2 = FdoStringCollection::Create();
+                        //if (!secClassName.empty())
+                        //{
+                        //    FdoPtr<FdoStringCollection> fdoClassNames2 = FdoStringCollection::Create();
 
-                            fdoClassNames2->Add(secClassName.c_str());
-                            fdoCommand2->SetClassNames(fdoClassNames2.p);
-                        }
+                        //    fdoClassNames2->Add(secClassName.c_str());
+                        //    fdoCommand2->SetClassNames(fdoClassNames2.p);
+                        //}
 
                         // Execute the command
                         ffsc2 = fdoCommand2->Execute();
                         CHECKNULL((FdoFeatureSchemaCollection*)ffsc2, L"MgServerDescribeSchema.DescribeFdoSchema");
 
+                        //if (!secSchemaName.empty())
+                        //{
+                        //    fdoCommand2->SetSchemaName(secSchemaName.c_str());
+                        //}
+
+                        //if (!secClassName.empty())
+                        //{
+                        //    FdoPtr<FdoStringCollection> fdoClassNames2 = FdoStringCollection::Create();
+
+                        //    fdoClassNames2->Add(secClassName.c_str());
+                        //    fdoCommand2->SetClassNames(fdoClassNames2.p);
+                        //}
+
                         // Extract the schemas from the secondary collection and add them to the main collection
                         // Get schema count
                         FdoInt32 cnt = ffsc2->GetCount();
@@ -438,18 +451,18 @@
                             FdoPtr<FdoIDescribeSchema> fdoCommand2  = (FdoIDescribeSchema*)fdoConn2->CreateCommand(FdoCommandType_DescribeSchema);
                             CHECKNULL((FdoIDescribeSchema*)fdoCommand2, L"MgDescribeSchema.DescribeSchema");
 
-                            if (!secSchemaName.empty())
-                            {
-                                fdoCommand2->SetSchemaName(secSchemaName.c_str());
-                            }
+                            //if (!secSchemaName.empty())
+                            //{
+                            //    fdoCommand2->SetSchemaName(secSchemaName.c_str());
+                            //}
 
-                            if (!secClassName.empty())
-                            {
-                                FdoPtr<FdoStringCollection> fdoClassNames2 = FdoStringCollection::Create();
+                            //if (!secClassName.empty())
+                            //{
+                            //    FdoPtr<FdoStringCollection> fdoClassNames2 = FdoStringCollection::Create();
 
-                                fdoClassNames2->Add(secClassName.c_str());
-                                fdoCommand2->SetClassNames(fdoClassNames2.p);
-                            }
+                            //    fdoClassNames2->Add(secClassName.c_str());
+                            //    fdoCommand2->SetClassNames(fdoClassNames2.p);
+                            //}
 
                             // Execute the command
                             ffsc2 = fdoCommand2->Execute();
@@ -1049,7 +1062,7 @@
         }
 
         // IMPORTANT INFORMATION
-        // FDO objects cannot be cached as they are not thread safe. 
+        // FDO objects cannot be cached as they are not thread safe.
         // This is not an issue because we create a MapGuide wrapper of this information that is thread safe.
         FdoPtr<FdoFeatureSchemaCollection> fdoSchemas;
         fdoSchemas = NULL;

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -64,6 +64,7 @@
 {
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// Destructor
@@ -171,9 +172,9 @@
 /// <returns>
 /// String Collection or NULL if nothing is found
 /// </returns>
-MgStringCollection* MgServerFeatureService::GetConnectionPropertyValues( CREFSTRING providerName,
-                                                                         CREFSTRING propertyName,
-                                                                         CREFSTRING partialConnString )
+MgStringCollection* MgServerFeatureService::GetConnectionPropertyValues(CREFSTRING providerName,
+                                                                        CREFSTRING propertyName,
+                                                                        CREFSTRING partialConnString)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetConnectionPropertyValues()");
 
@@ -219,7 +220,7 @@
 /// <returns>
 /// True if connection was successful
 /// </returns>
-bool MgServerFeatureService::TestConnection( MgResourceIdentifier* resource )
+bool MgServerFeatureService::TestConnection(MgResourceIdentifier* resource)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::TestConnection()");
 
@@ -261,22 +262,34 @@
 /// MgInvalidResourceIdentifer
 /// NOTE:
 /// Subject to change with FDO R2
-MgByteReader* MgServerFeatureService::GetCapabilities( CREFSTRING providerName )
+MgByteReader* MgServerFeatureService::GetCapabilities(CREFSTRING providerName)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetCapabilities()");
 
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
     if (userInfo->GetApiVersion() != MG_API_VERSION(1,0,0) && userInfo->GetApiVersion() != MG_API_VERSION(2,0,0))
     {
         throw new MgInvalidOperationVersionException(
             L"MgServerFeatureService.GetCapabilities", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
-    MgServerGetProviderCapabilities msgpc(providerName);
+    STRING connectionString = L"";
+    MgServerGetProviderCapabilities msgpc(providerName, connectionString);
     return msgpc.GetProviderCapabilities();
 }
 
-/////////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////
+MgByteReader* MgServerFeatureService::GetCapabilities(CREFSTRING providerName, CREFSTRING connectionString)
+{
+    MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetCapabilities()");
+
+    MgServerGetProviderCapabilities msgpc(providerName, connectionString);
+    return msgpc.GetProviderCapabilities();
+}
+
+
+///////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Creates or updates a feature schema within the specified feature source.
 ///
@@ -288,6 +301,7 @@
     msas.ApplySchema(resource, schema);
 }
 
+
 ///////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Gets the definitions of one or more schemas contained in the
@@ -295,7 +309,8 @@
 /// a class name does not exist, this method will throw an exception.
 ///
 MgFeatureSchemaCollection* MgServerFeatureService::DescribeSchema(MgResourceIdentifier* resource,
-    CREFSTRING schemaName, MgStringCollection* classNames)
+                                                                  CREFSTRING schemaName,
+                                                                  MgStringCollection* classNames)
 {
     Ptr<MgFeatureSchemaCollection> schemas;
 
@@ -321,15 +336,17 @@
     return schemas.Detach();
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 /// This method has been deprecated. Use the above method.
 ///
 MgFeatureSchemaCollection* MgServerFeatureService::DescribeSchema(MgResourceIdentifier* resource,
-    CREFSTRING schemaName)
+                                                                  CREFSTRING schemaName)
 {
     return DescribeSchema(resource, schemaName, NULL);
 }
 
+
 ///////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Gets the definitions in XML format of one or more schemas contained in the
@@ -337,7 +354,8 @@
 /// a class name does not exist, this method will throw an exception.
 ///
 STRING MgServerFeatureService::DescribeSchemaAsXml(MgResourceIdentifier* resource,
-    CREFSTRING schemaName, MgStringCollection* classNames)
+                                                   CREFSTRING schemaName,
+                                                   MgStringCollection* classNames)
 {
     STRING schemaXml;
 
@@ -363,15 +381,17 @@
     return schemaXml;
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 /// This method has been deprecated. Use the above method.
 ///
 STRING MgServerFeatureService::DescribeSchemaAsXml(MgResourceIdentifier* resource,
-    CREFSTRING schemaName)
+                                                   CREFSTRING schemaName)
 {
     return DescribeSchemaAsXml(resource, schemaName, NULL);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// Select features returns feature information from an Fdo Provider.  An MgFeatureReader
@@ -405,9 +425,9 @@
 ///    filter text.
 /// 2. Interrogation of class definition would allow to determine properties of classes
 ///    which can be used for filter text.
-MgFeatureReader* MgServerFeatureService::SelectFeatures( MgResourceIdentifier* resource,
-                                                         CREFSTRING className,
-                                                         MgFeatureQueryOptions* options )
+MgFeatureReader* MgServerFeatureService::SelectFeatures(MgResourceIdentifier* resource,
+                                                        CREFSTRING className,
+                                                        MgFeatureQueryOptions* options)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::SelectFeatures()");
 
@@ -473,10 +493,10 @@
 ///    filter text.
 /// 2. Interrogation of class definition would allow to determine properties of classes
 ///    which can be used for filter text.
-MgFeatureReader*  MgServerFeatureService::SelectFeatures( MgResourceIdentifier* resource,
-                                  CREFSTRING className,
-                                  MgFeatureQueryOptions* options,
-                                  CREFSTRING coordinateSystem )
+MgFeatureReader* MgServerFeatureService::SelectFeatures(MgResourceIdentifier* resource,
+                                                        CREFSTRING className,
+                                                        MgFeatureQueryOptions* options,
+                                                        CREFSTRING coordinateSystem)
 {
     throw new MgNotImplementedException(
         L"MgServerFeatureService::SelectFeatures",
@@ -525,9 +545,9 @@
 /// 3. Interrogation of provider capabilities will inform list of operations supported
 /// 4. Interrogation of class definition would allow to determine properties of classes
 ///    which can be used for filter text.
-MgDataReader* MgServerFeatureService::SelectAggregate( MgResourceIdentifier* resource,
-                                                       CREFSTRING className,
-                                                       MgFeatureAggregateOptions* options )
+MgDataReader* MgServerFeatureService::SelectAggregate(MgResourceIdentifier* resource,
+                                                      CREFSTRING className,
+                                                      MgFeatureAggregateOptions* options)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::SelectAggregate()");
 
@@ -565,9 +585,9 @@
 ///
 /// EXCEPTIONS:
 /// MgInvalidResourceIdentifer
-MgPropertyCollection* MgServerFeatureService::UpdateFeatures( MgResourceIdentifier* resource,
-                                                              MgFeatureCommandCollection* commands,
-                                                              bool useTransaction )
+MgPropertyCollection* MgServerFeatureService::UpdateFeatures(MgResourceIdentifier* resource,
+                                                             MgFeatureCommandCollection* commands,
+                                                             bool useTransaction)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::UpdateFeatures()");
 
@@ -575,6 +595,7 @@
     return asuf.Execute(resource, commands, useTransaction);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// It executes all the commands specified in command collection
@@ -597,9 +618,9 @@
 ///
 /// EXCEPTIONS:
 /// MgInvalidResourceIdentifer
-MgPropertyCollection* MgServerFeatureService::UpdateFeatures( MgResourceIdentifier* resource,
-                                                              MgFeatureCommandCollection* commands,
-                                                              MgTransaction* transaction )
+MgPropertyCollection* MgServerFeatureService::UpdateFeatures(MgResourceIdentifier* resource,
+                                                             MgFeatureCommandCollection* commands,
+                                                             MgTransaction* transaction)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::UpdateFeatures()");
 
@@ -607,6 +628,7 @@
     return asuf.Execute(resource, commands, transaction);
 }
 
+
 ////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Gets the locked features
@@ -631,9 +653,9 @@
 /// EXCEPTIONS:
 /// MgFeatureServiceException
 /// MgInvalidArgumentException
-MgFeatureReader* MgServerFeatureService::GetLockedFeatures( MgResourceIdentifier* resource,
-                                                CREFSTRING className,
-                                                MgFeatureQueryOptions* options )
+MgFeatureReader* MgServerFeatureService::GetLockedFeatures(MgResourceIdentifier* resource,
+                                                           CREFSTRING className,
+                                                           MgFeatureQueryOptions* options)
 {
     throw new MgNotImplementedException(
         L"MgServerFeatureService::GetLockedFeatures",
@@ -642,6 +664,7 @@
     return NULL; // to make some compiler happy
 }
 
+
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Starts a transaction on the specified feature source
@@ -662,7 +685,7 @@
 /// MgInvalidArgumentException
 /// MgInvalidOperationException
 /// MgFdoException
-MgTransaction* MgServerFeatureService::BeginTransaction( MgResourceIdentifier* resource )
+MgTransaction* MgServerFeatureService::BeginTransaction(MgResourceIdentifier* resource)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::BeginTransaction()");
 
@@ -680,6 +703,7 @@
     return transaction.Detach();
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes the SELECT SQL statement specified and returns a pointer to
@@ -709,8 +733,8 @@
 /// MgInvalidResourceIdentifer
 /// MgInvalidSqlStatement
 /// MgSqlNotSupported
-MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                                          CREFSTRING sqlStatement )
+MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                                         CREFSTRING sqlStatement)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlQuery()");
 
@@ -718,6 +742,7 @@
     return sqlCommand.ExecuteQuery(resource, sqlStatement, NULL, NULL);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes the SELECT SQL statement specified within a given transaction
@@ -753,10 +778,10 @@
 /// MgInvalidResourceIdentifer
 /// MgInvalidSqlStatement
 /// MgSqlNotSupported
-MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                                          CREFSTRING sqlStatement,
-                                                          MgParameterCollection* params,
-                                                          MgTransaction* transaction )
+MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                                         CREFSTRING sqlStatement,
+                                                         MgParameterCollection* params,
+                                                         MgTransaction* transaction)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlQuery()");
 
@@ -764,6 +789,7 @@
     return sqlCommand.ExecuteQuery(resource, sqlStatement, params, transaction);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes the SELECT SQL statement specified within a given transaction
@@ -803,18 +829,19 @@
 /// MgInvalidResourceIdentifer
 /// MgInvalidSqlStatement
 /// MgSqlNotSupported
-MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                                          CREFSTRING sqlStatement,
-                                                          MgParameterCollection* params,
-                                                          MgTransaction* transaction,
-                                                          INT32 fetchSize )
+MgSqlDataReader* MgServerFeatureService::ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                                         CREFSTRING sqlStatement,
+                                                         MgParameterCollection* params,
+                                                         MgTransaction* transaction,
+                                                         INT32 fetchSize)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlQuery()");
 
     MgServerSqlCommand sqlCommand;
-    return sqlCommand.ExecuteQuery(resource, sqlStatement, params, transaction, fetchSize );
+    return sqlCommand.ExecuteQuery(resource, sqlStatement, params, transaction, fetchSize);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes all SQL statements supported by providers except SELECT.
@@ -834,8 +861,8 @@
 ///
 /// EXCEPTIONS:
 /// MgInvalidResourceIdentifer
-INT32 MgServerFeatureService::ExecuteSqlNonQuery( MgResourceIdentifier* resource,
-                                                  CREFSTRING sqlNonSelectStatement )
+INT32 MgServerFeatureService::ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+                                                 CREFSTRING sqlNonSelectStatement)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlNonQuery()");
 
@@ -843,6 +870,7 @@
     return sqlCommand.ExecuteNonQuery(resource, sqlNonSelectStatement, NULL, NULL);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes all SQL statements supported by providers except SELECT
@@ -870,10 +898,10 @@
 ///
 /// EXCEPTIONS:
 /// MgInvalidResourceIdentifer
-INT32 MgServerFeatureService::ExecuteSqlNonQuery( MgResourceIdentifier* resource,
-                                                  CREFSTRING sqlNonSelectStatement,
-                                                  MgParameterCollection* params,
-                                                  MgTransaction* transaction )
+INT32 MgServerFeatureService::ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+                                                 CREFSTRING sqlNonSelectStatement,
+                                                 MgParameterCollection* params,
+                                                 MgTransaction* transaction)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::ExecuteSqlNonQuery()");
 
@@ -881,6 +909,7 @@
     return sqlCommand.ExecuteNonQuery(resource, sqlNonSelectStatement, params, transaction);
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// This method executes the SELECT statement to return all available spatial context
@@ -916,7 +945,7 @@
 /// MgInvalidResourceIdentifer
 /// NOTE:
 /// Subject to change in FDO R2
-MgSpatialContextReader* MgServerFeatureService::GetSpatialContexts( MgResourceIdentifier* resource,
+MgSpatialContextReader* MgServerFeatureService::GetSpatialContexts(MgResourceIdentifier* resource,
                                                                    bool bActiveOnly)
 {
     Ptr<MgSpatialContextReader> reader;
@@ -976,7 +1005,8 @@
 /// MgInvalidResourceIdentifer
 /// NOTE:
 /// Subject to change in FDO R2
-MgLongTransactionReader* MgServerFeatureService::GetLongTransactions(MgResourceIdentifier* resource, bool bActiveOnly)
+MgLongTransactionReader* MgServerFeatureService::GetLongTransactions(MgResourceIdentifier* resource,
+                                                                     bool bActiveOnly)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetLongTransactions()");
 
@@ -1006,8 +1036,8 @@
 /// MgNullArgumentException
 /// MgInvalidResourceTypeException
 /// MgSessionNotFoundException
-bool MgServerFeatureService::SetLongTransaction( MgResourceIdentifier* featureSourceId,
-                                                 CREFSTRING longTransactionName)
+bool MgServerFeatureService::SetLongTransaction(MgResourceIdentifier* featureSourceId,
+                                                CREFSTRING longTransactionName)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::SetLongTransaction()");
 
@@ -1020,7 +1050,7 @@
 
     // we require a session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
@@ -1036,6 +1066,7 @@
 }
 
 
+///////////////////////////////////////////////////////////////////////////
 // Just a simple hashing algorithm
 unsigned MgServerFeatureService::StringHasher(FdoString* pszString)
 {
@@ -1054,6 +1085,7 @@
   return uRet;
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Find a class definition from the specified schemas.
@@ -1121,6 +1153,7 @@
     }
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// \brief
 /// Retrieves schema information about a set of feature classes for a given feature source.
@@ -1148,7 +1181,8 @@
 /// \return
 /// Returns an MgByteReader containing the XML schema.
 ///
-MgByteReader* MgServerFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses)
+MgByteReader* MgServerFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+                                                             MgStringCollection* featureClasses)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::DescribeWfsFeatureType()");
 
@@ -1252,6 +1286,51 @@
 }
 
 
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Retrieves schema informationabout a set of feature classes for a given feature source  with specified format.
+///
+///
+/// <!-- Syntax in .Net, Java, and PHP -->
+/// \htmlinclude DotNetSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+/// \htmlinclude SyntaxBottom.html
+/// \htmlinclude JavaSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+/// \htmlinclude SyntaxBottom.html
+/// \htmlinclude PHPSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+/// \htmlinclude SyntaxBottom.html
+///
+/// \param featureSourceId (MgResourceIdentifier)
+/// The resource identifier defining the
+/// location of the feature source in
+/// the repository.
+/// \param featureClasses (MgStringCollection)
+/// A collection of strings identifying the feature classes for which to
+/// retrieve schema information. If this collection is null or empty, information
+/// is returned for all feature classes.
+/// \param outputFormat (String/string)
+/// A string identifying the output format of
+/// the retrieved schema information.
+/// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
+/// http://portal.opengeospatial.org/files/?artifact_id=8339
+///
+/// \return
+/// Returns an MgByteReader containing the XML schema.
+///
+MgByteReader* MgServerFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+                                                             MgStringCollection* featureClasses,
+                                                             CREFSTRING outputFormat)
+{
+    throw new MgNotImplementedException(
+    L"MgServerFeatureService::DescribeWfsFeatureType",
+    __LINE__, __WFILE__, NULL, L"", NULL);
+
+    return NULL; // to make some compiler happy
+}
+
+
 //////////////////////////////////////////////////////////////////
 // Helper private method
 void MgServerFeatureService::FeatureSourceToString(MgResourceIdentifier* resource, string& resourceContent)
@@ -1378,9 +1457,9 @@
 
 
 //////////////////////////////////////////////////////////////////
-MgClassDefinition* MgServerFeatureService::GetClassDefinition(  MgResourceIdentifier* resource,
-                                                                CREFSTRING schemaName,
-                                                                CREFSTRING className)
+MgClassDefinition* MgServerFeatureService::GetClassDefinition(MgResourceIdentifier* resource,
+                                                              CREFSTRING schemaName,
+                                                              CREFSTRING className)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetClassDefinition()");
 
@@ -1388,11 +1467,12 @@
     return msds.GetClassDefinition(resource, schemaName, className, true);
 }
 
+
 //////////////////////////////////////////////////////////////////
-MgClassDefinition* MgServerFeatureService::GetClassDefinition(  MgResourceIdentifier* resource,
-                                                                CREFSTRING schemaName,
-                                                                CREFSTRING className,
-                                                                bool serialize)
+MgClassDefinition* MgServerFeatureService::GetClassDefinition(MgResourceIdentifier* resource,
+                                                              CREFSTRING schemaName,
+                                                              CREFSTRING className,
+                                                              bool serialize)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetClassDefinition()");
 
@@ -1632,8 +1712,8 @@
 // Returns the collection of identity properties for the specified class.
 // If schemaName is empty, then className needs to be fully qualified.
 MgClassDefinitionCollection* MgServerFeatureService::GetIdentityProperties(MgResourceIdentifier* resource,
-                                                                              CREFSTRING schemaName,
-                                                                              MgStringCollection* classNames)
+                                                                           CREFSTRING schemaName,
+                                                                           MgStringCollection* classNames)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetIdentityProperties()");
 
@@ -1642,19 +1722,20 @@
 }
 
 
-//////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Retrieves feature information based on the supplied criteria.
+/// Retrieves feature information based on the supplied criteria with specified format.
 ///
+///
 /// <!-- Syntax in .Net, Java, and PHP -->
 /// \htmlinclude DotNetSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
 /// \htmlinclude SyntaxBottom.html
 /// \htmlinclude JavaSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
 /// \htmlinclude SyntaxBottom.html
 /// \htmlinclude PHPSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
 /// \htmlinclude SyntaxBottom.html
 ///
 /// \param featureSourceId (MgResourceIdentifier)
@@ -1670,19 +1751,39 @@
 /// The spatial reference system in which to return feature geometries
 /// \param filter (String/string)
 /// An XML string containing the definition for an OGC filter
-/// \param filter (int)
+/// \param maxFeatures (int)
 /// The maximum number of features to retrieve. If the value is less
 /// than or equal to zero, all features will be retrieved.
+/// \param wfsVersion (String/string)
+/// A string identifying the wfs version
+/// \param outputFormat (String/string)
+/// A string identifying the output format of
+/// the retrieved feature information.
+/// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
+/// http://portal.opengeospatial.org/files/?artifact_id=8339
+/// \param sortCriteria (String/string)
+/// A string identifying the sort criteria
+/// \param namespacePrefix (String/string)
+/// A string identifying the namespace prefix in the output xml
+/// \param namespaceUrl (String/string)
+/// A string idenyifying the namespace url in the output xml
 ///
 /// \return
 /// Returns an MgByteReader containing the requested feature information.
 ///
+/// EXCEPTIONS:
+/// MgInvalidArgumentException
 MgByteReader* MgServerFeatureService::GetWfsFeature(MgResourceIdentifier* fs,
-                                                     CREFSTRING featureClass,
-                                                     MgStringCollection* propNames,
-                                                     CREFSTRING srs,
-                                                     CREFSTRING wfsFilter,
-                                                     INT32 maxFeatures)
+                                                    CREFSTRING featureClass,
+                                                    MgStringCollection* propNames,
+                                                    CREFSTRING srs,
+                                                    CREFSTRING wfsFilter,
+                                                    INT32 maxFeatures,
+                                                    CREFSTRING wfsVersion,
+                                                    CREFSTRING outputFormat,
+                                                    CREFSTRING sortCriteria,
+                                                    CREFSTRING namespacePrefix,
+                                                    CREFSTRING namespaceUrl)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetWfsFeature()");
 
@@ -1729,8 +1830,6 @@
     if (fc == NULL)
         return NULL;
 
-    STRING geomPropName = fc->GetDefaultGeometryPropertyName();
-
     //execute the spatial query
     Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
 
@@ -1745,20 +1844,57 @@
     //and set it to the FDO feature query
     if (!wfsFilter.empty())
     {
-        //create a modifiable copy of the filter
-        STRING ogcFilter = wfsFilter;
         STRING GEOM_PROP_TAG = L"%MG_GEOM_PROP%"; //NOXLATE
-        size_t geomPropPos = 0;
-        while((geomPropPos = ogcFilter.find(GEOM_PROP_TAG, geomPropPos)) != STRING::npos)
+        STRING fdoFilterString = L""; //NOXLATE
+
+        Ptr<MgPropertyDefinitionCollection> properties = fc->GetProperties();
+        MgOgcFilterUtil u;
+        if(wfsFilter.find(GEOM_PROP_TAG, 0) != STRING::npos)
         {
-            ogcFilter = ogcFilter.replace(geomPropPos, GEOM_PROP_TAG.length(), fc->GetDefaultGeometryPropertyName());
+            for(int i = 0; i<properties->GetCount(); i++)
+            {
+                Ptr<MgPropertyDefinition> prop = properties->GetItem(i);
+                if(prop->GetPropertyType() == MgFeaturePropertyType::GeometricProperty)
+                {
+                    STRING ogcFilter = MgUtil::ReplaceString(wfsFilter,GEOM_PROP_TAG.c_str(),prop->GetName().c_str());
+
+                    if(!fdoFilterString.empty())
+                    {
+                        fdoFilterString += L" OR ";
+                    }
+                    fdoFilterString += u.Ogc2FdoFilter(ogcFilter, trans, prop->GetName(), properties);
+                }
+            }
         }
-        Ptr<MgPropertyDefinitionCollection> properties = fc->GetProperties();
-        MgOgcFilterUtil u;
-        STRING fdoFilterString = u.Ogc2FdoFilter(ogcFilter, trans, geomPropName, properties);
+
         options->SetFilter(fdoFilterString);
     }
 
+    if(!sortCriteria.empty())
+    {
+        Ptr<MgStringCollection> orderByProperties = new MgStringCollection();
+        int orderOption = MgOrderingOption::Ascending;
+
+        STRING sSortCriteria = sortCriteria;
+        STRING::size_type pos = sSortCriteria.find_last_of(L" ");
+        if(pos != STRING::npos)
+        {
+            STRING sSortByProperty = sSortCriteria.substr(0, pos);
+            orderByProperties->Add(sSortByProperty);
+
+            STRING sSortOption  = MgUtil::ToUpper(sSortCriteria.substr(pos+1));
+            if(sSortOption == L"D")
+            {
+                orderOption = MgOrderingOption::Descending;
+            }
+        }
+        else
+        {
+            orderByProperties->Add(sortCriteria);
+        }
+
+        options->SetOrderingFilter(orderByProperties,orderOption);
+    }
     // TODO: can FeatureName be an extension name rather than a FeatureClass?
     Ptr<MgFeatureReader> mgfReader = SelectFeatures(fs, lfeatureName, options);
 
@@ -1769,6 +1905,7 @@
     MgServerFdoFeatureReader maxFeatureReader(fdoReader);
     maxFeatureReader.SetMaxFeatures(maxFeatures);
 
+
     //generate a file name to serialize wfs data
     STRING fileName = MgFileUtil::GenerateTempFileName(false, L"wfs", L"xml");
 
@@ -1780,19 +1917,83 @@
     flags->SetMemberName(L"featureMember");
     flags->SetMemberUri(L"http://www.opengis.net/gml");
 
-    // set schemaLocations
-    // gml schema location
-    flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/2.1.2/feature.xsd");
+    // gml schema location and version
+    if(L"text/xml; subtype=gml/2.1.2" == outputFormat)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/2.1.2/feature.xsd");
+        flags->SetGmlVersion(FdoGmlVersion_212);
+    }
+    else if(L"text/xml; subtype=gml/3.1.1" == outputFormat)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/3.1.1/feature.xsd");
+        flags->SetGmlVersion(FdoGmlVersion_311);
+    }
+    else
+    {
+        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    // For WFS CITE certification
+    // gml_id, gml_name and gml_description properties must be serialized with gml namespace.
+    Ptr<MgPropertyDefinitionCollection> properties = fc->GetProperties();
+    for(int i = 0; i<properties->GetCount(); i++)
+    {
+        Ptr<MgPropertyDefinition> prop = properties->GetItem(i);
+        STRING propName = prop->GetName();
+        
+        if(L"GML_ID" == MgUtil::ToUpper(propName))
+        {
+             FdoPtr<FdoStringCollection> gmlIDRelatePropertyNames = FdoStringCollection::Create();
+             gmlIDRelatePropertyNames->Add(propName.c_str());
+             flags->SetGmlIDRelatePropertyNames(gmlIDRelatePropertyNames);
+        }
+        else if(L"GML_NAME" == MgUtil::ToUpper(propName))
+        {
+            flags->SetGmlNameRelatePropertyName(propName.c_str()); 
+        }
+        else if(L"GML_DESCRIPTION" == MgUtil::ToUpper(propName))
+        {
+            flags->SetGmlDescriptionRelatePropertyName(propName.c_str()); 
+        }
+    }
+
     // wfs schema location
-    flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd");
-    // default namespace schema location
-    flags->SetSchemaLocation(L"http://www.mynamespace.com/myns", L"http://www.mynamespace.com/myns/myns.xsd");
+    if(L"1.0.0" == wfsVersion)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd");
+    }
+    else if(L"1.1.0" == wfsVersion)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd");
+    }
+    else
+    {
+        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    // set the default namespace prefix
+    if(!namespacePrefix.empty())
+    {
+        flags->SetDefaultNamespacePrefix(namespacePrefix.c_str());
+    }
+
     // set the default namespace
-    flags->SetDefaultNamespace(L"http://www.mynamespace.com/myns");
+    if(!namespaceUrl.empty())
+    {
+        flags->SetDefaultNamespace(namespaceUrl.c_str());
+    }
+    else
+    {
+        STRING defaultNamespace(L"http://fdo.osgeo.org/schemas/feature/");
+        defaultNamespace += namespacePrefix;
+        flags->SetDefaultNamespace(defaultNamespace.c_str());
+    }
 
     //create the FDO xml serializer stack and write out the features
     FdoPtr<FdoXmlWriter> xmlWriter = FdoXmlWriter::Create(fileName.c_str(), false);
-    FdoPtr<FdoXmlFeaturePropertyWriter> propWriter = FdoXmlFeaturePropertyWriter::Create(xmlWriter);
+    FdoPtr<FdoXmlFeaturePropertyWriter> propWriter = FdoXmlFeaturePropertyWriter::Create(xmlWriter,flags);
     FdoPtr<FdoXmlFeatureWriter> featWriter = FdoXmlFeatureWriter::Create(propWriter, flags);
 
     FdoXmlFeatureSerializer::XmlSerialize(&maxFeatureReader, featWriter, flags);
@@ -1816,6 +2017,21 @@
     return byteReader.Detach();
 }
 
+
+///////////////////////////////////////////////////////////////////////////
+/// This method has been deprecated. Use the above method.
+///
+MgByteReader* MgServerFeatureService::GetWfsFeature(MgResourceIdentifier* fs,
+                                                    CREFSTRING featureClass,
+                                                    MgStringCollection* propNames,
+                                                    CREFSTRING srs,
+                                                    CREFSTRING wfsFilter,
+                                                    INT32 maxFeatures)
+{
+    return GetWfsFeature(fs, featureClass, propNames, srs, wfsFilter, maxFeatures, L"1.0.0", L"text/xml; subtype=gml/2.1.2", L"", L"", L"");
+}
+
+
 ////////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// This method enumerates all the providers and if they are FDO enabled for
@@ -1836,6 +2052,7 @@
     return mseds.EnumerateDataStores(providerName, partialConnString);
 }
 
+
 ////////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// This method returns all of the logical to physical schema mappings for
@@ -1856,12 +2073,15 @@
     return msgsm.GetSchemaMapping(providerName, partialConnString);
 }
 
+
 ////////////////////////////////////////////////////////////////////////////////
 void MgServerFeatureService::SetConnectionProperties(MgConnectionProperties*)
 {
     // Do nothing.  No connection properties are required for Server-side service objects.
 }
 
+
+///////////////////////////////////////////////////////////////////////////
 bool MgServerFeatureService::CommitTransaction(CREFSTRING transactionId)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::CommitTransaction()");
@@ -1880,6 +2100,8 @@
     return bResult;
 }
 
+
+///////////////////////////////////////////////////////////////////////////
 bool MgServerFeatureService::RollbackTransaction(CREFSTRING transactionId)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::RollbackTransaction()");
@@ -1898,6 +2120,7 @@
     return bResult;
 }
 
+
 //////////////////////////////////////////////////////////////////
 /// <summary>
 /// Gets the FDO cache information for the server
@@ -1920,6 +2143,7 @@
     return info;
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Handle the Resource Change Notification event.
@@ -1964,6 +2188,7 @@
     return success;
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// Handle the Resource Change Notification event.

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -132,9 +132,9 @@
     /// <returns>
     /// String Collection or NULL if nothing is found
     /// </returns>
-    MgStringCollection* GetConnectionPropertyValues( CREFSTRING providerName,
-                                                     CREFSTRING propertyName,
-                                                     CREFSTRING partialConnString );
+    MgStringCollection* GetConnectionPropertyValues(CREFSTRING providerName,
+                                                    CREFSTRING propertyName,
+                                                    CREFSTRING partialConnString);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -187,6 +187,34 @@
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
+    /// This method returns capabilities of the provider applicable for the
+    /// connection. This would provide details on the following
+    /// capabilities:
+    /// 1. Connection
+    /// 2. Schema
+    /// 3. Command
+    /// 4. Filter
+    /// 5. Expression
+    ///
+    /// Schema Definition: FeatureProviderCapabilities.xsd
+    /// Sample XML:        FeatureProviderCapabilities.xml
+    /// </summary>
+    /// <param name="providerName">Input
+    /// Name of provider for which capabilities are being requested
+    /// </param>
+    /// <returns>
+    /// <param name="connectionString">Input
+    /// The connection string to use
+    /// </param>
+    /// Byte array representing XML (or NULL)
+    /// </returns>
+    ///
+    /// EXCEPTIONS:
+    /// MgInvalidProviderNameException
+    MgByteReader* GetCapabilities(CREFSTRING providerName, CREFSTRING connectionString);
+
+    //////////////////////////////////////////////////////////////////
+    /// <summary>
     /// This method returns list of ALL schemas names available with
     /// with the provider
     /// </summary>
@@ -199,7 +227,7 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgStringCollection* GetSchemas( MgResourceIdentifier* resource );
+    MgStringCollection* GetSchemas(MgResourceIdentifier* resource);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -218,7 +246,7 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgStringCollection* GetClasses( MgResourceIdentifier* resource, CREFSTRING schemaName );
+    MgStringCollection* GetClasses(MgResourceIdentifier* resource, CREFSTRING schemaName);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -239,9 +267,9 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgClassDefinition* GetClassDefinition(  MgResourceIdentifier* resource,
-                                            CREFSTRING schemaName,
-                                            CREFSTRING className);
+    MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+                                          CREFSTRING schemaName,
+                                          CREFSTRING className);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -262,10 +290,10 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgClassDefinition* GetClassDefinition(  MgResourceIdentifier* resource,
-                                            CREFSTRING schemaName,
-                                            CREFSTRING className,
-                                            bool serialize);
+    MgClassDefinition* GetClassDefinition(MgResourceIdentifier* resource,
+                                          CREFSTRING schemaName,
+                                          CREFSTRING className,
+                                          bool serialize);
 
     /////////////////////////////////////////////////////////////////////////////////////////////
     /// \brief
@@ -280,13 +308,14 @@
     /// a class name does not exist, this method will throw an exception.
     ///
     MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
-        CREFSTRING schemaName, MgStringCollection* classNames);
+                                              CREFSTRING schemaName,
+                                              MgStringCollection* classNames);
 
     ///////////////////////////////////////////////////////////////////////////
     /// This method has been deprecated. Use the above method.
     ///
     MgFeatureSchemaCollection* DescribeSchema(MgResourceIdentifier* resource,
-        CREFSTRING schemaName);
+                                              CREFSTRING schemaName);
 
     ///////////////////////////////////////////////////////////////////////////
     /// \brief
@@ -295,13 +324,14 @@
     /// a class name does not exist, this method will throw an exception.
     ///
     STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
-        CREFSTRING schemaName, MgStringCollection* classNames);
+                               CREFSTRING schemaName,
+                               MgStringCollection* classNames);
 
     ///////////////////////////////////////////////////////////////////////////
     /// This method has been deprecated. Use the above method.
     ///
     STRING DescribeSchemaAsXml(MgResourceIdentifier* resource,
-        CREFSTRING schemaName);
+                               CREFSTRING schemaName);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -336,9 +366,9 @@
     ///    filter text.
     /// 2. Interrogation of class definition would allow to determine properties of classes
     ///    which can be used for filter text.
-    MgFeatureReader*  SelectFeatures(   MgResourceIdentifier* resource,
-                                        CREFSTRING className,
-                                        MgFeatureQueryOptions* options );
+    MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+                                    CREFSTRING className,
+                                    MgFeatureQueryOptions* options);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -377,10 +407,10 @@
     ///    filter text.
     /// 2. Interrogation of class definition would allow to determine properties of classes
     ///    which can be used for filter text.
-    MgFeatureReader*  SelectFeatures(   MgResourceIdentifier* resource,
-                                        CREFSTRING className,
-                                        MgFeatureQueryOptions* options,
-                                        CREFSTRING coordinateSystem );
+    MgFeatureReader* SelectFeatures(MgResourceIdentifier* resource,
+                                    CREFSTRING className,
+                                    MgFeatureQueryOptions* options,
+                                    CREFSTRING coordinateSystem);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -406,7 +436,7 @@
     /// </param>
     /// <returns>
     /// MgDataReader pointer which operates on the instance of actual reader returned from the
-    /// FdoProvider ( OR NULL ).
+    /// FdoProvider (OR NULL).
     /// </returns>
     /// EXCEPTIONS:
     /// MgFeatureSourceException
@@ -421,9 +451,9 @@
     /// 3. Interrogation of provider capabilities will inform list of operations supported
     /// 4. Interrogation of class definition would allow to determine properties of classes
     ///    which can be used for filter text.
-    MgDataReader*  SelectAggregate( MgResourceIdentifier* resource,
-                                    CREFSTRING className,
-                                    MgFeatureAggregateOptions* options );
+    MgDataReader* SelectAggregate(MgResourceIdentifier* resource,
+                                  CREFSTRING className,
+                                  MgFeatureAggregateOptions* options);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -446,9 +476,9 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
-                                          MgFeatureCommandCollection* commands,
-                                          bool useTransaction );
+    MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+                                         MgFeatureCommandCollection* commands,
+                                         bool useTransaction);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -472,9 +502,9 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
-                                          MgFeatureCommandCollection* commands,
-                                          MgTransaction* transaction );
+    MgPropertyCollection* UpdateFeatures(MgResourceIdentifier* resource,
+                                         MgFeatureCommandCollection* commands,
+                                         MgTransaction* transaction);
 
     ////////////////////////////////////////////////////////////////////////////////////////
     /// <summary>
@@ -500,9 +530,9 @@
     /// EXCEPTIONS:
     /// MgFeatureServiceException
     /// MgInvalidArgumentException
-    MgFeatureReader* GetLockedFeatures( MgResourceIdentifier* resource,
-                                        CREFSTRING className,
-                                        MgFeatureQueryOptions* options );
+    MgFeatureReader* GetLockedFeatures(MgResourceIdentifier* resource,
+                                       CREFSTRING className,
+                                       MgFeatureQueryOptions* options);
 
     ////////////////////////////////////////////////////////////////////////////////////////////////
     /// <summary>
@@ -524,7 +554,7 @@
     /// MgInvalidArgumentException
     /// MgInvalidOperationException
     /// MgFdoException
-    MgTransaction* BeginTransaction( MgResourceIdentifier* resource );
+    MgTransaction* BeginTransaction(MgResourceIdentifier* resource);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -555,8 +585,8 @@
     /// MgInvalidResourceIdentifer
     /// MgInvalidSqlStatement
     /// MgSqlNotSupported
-    MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                      CREFSTRING sqlStatement );
+    MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                     CREFSTRING sqlStatement);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -596,10 +626,10 @@
     /// MgInvalidResourceIdentifer
     /// MgInvalidSqlStatement
     /// MgSqlNotSupported
-    MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                      CREFSTRING sqlStatement,
-                                      MgParameterCollection* params,
-                                      MgTransaction* transaction );
+    MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                     CREFSTRING sqlStatement,
+                                     MgParameterCollection* params,
+                                     MgTransaction* transaction);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -643,11 +673,11 @@
     /// MgInvalidResourceIdentifer
     /// MgInvalidSqlStatement
     /// MgSqlNotSupported
-    MgSqlDataReader* ExecuteSqlQuery( MgResourceIdentifier* resource,
-                                      CREFSTRING sqlStatement,
-                                      MgParameterCollection* params,
-                                      MgTransaction* transaction,
-                                      INT32 fetchSize );
+    MgSqlDataReader* ExecuteSqlQuery(MgResourceIdentifier* resource,
+                                     CREFSTRING sqlStatement,
+                                     MgParameterCollection* params,
+                                     MgTransaction* transaction,
+                                     INT32 fetchSize);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -668,8 +698,8 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
-                              CREFSTRING sqlNonSelectStatement );
+    INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+                             CREFSTRING sqlNonSelectStatement);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -701,10 +731,10 @@
     ///
     /// EXCEPTIONS:
     /// MgInvalidResourceIdentifer
-    INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
-                              CREFSTRING sqlNonSelectStatement,
-                              MgParameterCollection* params,
-                              MgTransaction* transaction );
+    INT32 ExecuteSqlNonQuery(MgResourceIdentifier* resource,
+                             CREFSTRING sqlNonSelectStatement,
+                             MgParameterCollection* params,
+                             MgTransaction* transaction);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -741,8 +771,8 @@
     /// MgInvalidResourceIdentifer
     /// NOTE:
     /// Subject to change in FDO R2
-    MgSpatialContextReader* GetSpatialContexts( MgResourceIdentifier* resource,
-                                                bool bActiveOnly);
+    MgSpatialContextReader* GetSpatialContexts(MgResourceIdentifier* resource,
+                                               bool bActiveOnly);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -777,8 +807,8 @@
     /// MgInvalidResourceIdentifer
     /// NOTE:
     /// Subject to change in FDO R2
-    MgLongTransactionReader* GetLongTransactions( MgResourceIdentifier* resource,
-                                                  bool bActiveOnly);
+    MgLongTransactionReader* GetLongTransactions(MgResourceIdentifier* resource,
+                                                 bool bActiveOnly);
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     /// <summary>
@@ -802,8 +832,8 @@
     /// MgInvalidResourceTypeException
     /// MgSessionNotFoundException
     ///
-    bool SetLongTransaction( MgResourceIdentifier* featureSourceId,
-                             CREFSTRING longTransactionName);
+    bool SetLongTransaction(MgResourceIdentifier* featureSourceId,
+                            CREFSTRING longTransactionName);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
@@ -823,17 +853,45 @@
     /// Returns an MgByteReader containing the XML schema.
     /// </returns>
     ///
-    MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses);
+    MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+                                         MgStringCollection* featureClasses);
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
-    /// Retrieves feature information based on the supplied criteria.
+    /// Retrieves schema information about a set of feature classes for a given feature source with specified output format.
     /// </summary>
     /// <param name="featureSourceId">Input
     /// The resource identifier defining the
     /// location of the feature source in
     /// the repository.
     /// </param>
+    /// <param name="featureClasses">Input
+    /// A collection of strings identifying the feature classes for which to
+    /// retrieve schema information. If this collection is null or empty, information
+    /// is returned for all feature classes.
+    /// </param>
+    /// <param name="outputFormat">Input
+    /// A string identifying the output format of the retrieved schema information.
+    /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
+    /// http://portal.opengeospatial.org/files/?artifact_id=8339
+    /// </param>
+    /// <returns>
+    /// Returns an MgByteReader containing the XML schema.
+    /// </returns>
+    ///
+    MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+                                         MgStringCollection* featureClasses,
+                                         CREFSTRING outputFormat);
+
+    //////////////////////////////////////////////////////////////////
+    /// <summary>
+    /// Retrieves feature information based on the supplied criteria with specified output format.
+    /// </summary>
+    /// <param name="featureSourceId">Input
+    /// The resource identifier defining the
+    /// location of the feature source in
+    /// the repository.
+    /// </param>
     /// <param name="featureClass">Input
     /// The feature class containing the features to retrieve.
     /// </param>
@@ -851,13 +909,51 @@
     /// The maximum number of features to retrieve. If the value is less
     /// than or equal to zero, all features will be retrieved.
     /// </param>
+    /// <param name="wfsVersion">Input
+    ///  A string identifying the wfs version
+    /// </param>
+    /// <param name="outputFormat">Input
+    /// A string identifying the output format of the retrieved feature information.
+    /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
+    /// http://portal.opengeospatial.org/files/?artifact_id=8339
+    /// </param>
+    /// <param name="sortCriteria">Input
+    /// A string identifying the sort criteria
+    /// </param>
+    /// <param name="namespacePrefix">Input
+    /// A string identifying the namespace prefix in the output xml
+    /// </param>
+    /// <param name="namespaceUrl">Input
+    /// A string identifying the namespace url in the output xml
+    /// </param>
     /// <returns>
     /// Returns an MgByteReader containing the requested feature information.
     /// </returns>
     ///
-    MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
-        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures);
+    /// EXCEPTIONS:
+    /// MgInvalidArgumentException
+    MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+                                CREFSTRING featureClass,
+                                MgStringCollection* requiredProperties,
+                                CREFSTRING srs,
+                                CREFSTRING filter,
+                                INT32 maxFeatures,
+                                CREFSTRING wfsVersion,
+                                CREFSTRING outputFormat,
+                                CREFSTRING sortCriteria,
+                                CREFSTRING namespacePrefix,
+                                CREFSTRING namespaceUrl);
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// This method has been deprecated. Use the above method.
+    ///
+    MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
+                                CREFSTRING featureClass,
+                                MgStringCollection* requiredProperties,
+                                CREFSTRING srs,
+                                CREFSTRING filter,
+                                INT32 maxFeatures);
+
     ////////////////////////////////////////////////////////////////////////////////
     /// <summary>
     /// This method enumerates all the providers and if they are FDO enabled for
@@ -937,10 +1033,8 @@
                                                                CREFSTRING schemaName,
                                                                MgStringCollection* classNames);
 
-    virtual bool NotifyResourcesChanged(const set<STRING>& resources,
-        bool strict = true);
-    virtual bool NotifyResourcesChanged(MgSerializableCollection* resources,
-        bool strict = true);
+    virtual bool NotifyResourcesChanged(const set<STRING>& resources, bool strict = true);
+    virtual bool NotifyResourcesChanged(MgSerializableCollection* resources, bool strict = true);
 
     STRING GetFdoCacheInfo();
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -7,7 +7,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -29,7 +29,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerFeatureService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_FEATURE_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDO.lib FDOCommon.lib FDOGeometry.lib ExpressionEngine.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDO.lib FDOCommon.lib FDOGeometry.lib ExpressionEngine.lib"
 				OutputFile="$(OutDir)\MgServerFeatureServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll;FDOGeometry.dll;ExpressionEngine.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerFeatureServiced.pdb"
@@ -124,7 +124,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_FEATURE_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -144,10 +144,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDO.lib FDOCommon.lib FDOGeometry.lib ExpressionEngine.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDO.lib FDOCommon.lib FDOGeometry.lib ExpressionEngine.lib"
 				OutputFile="$(OutDir)\MgServerFeatureServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll;FDOGeometry.dll;ExpressionEngine.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerFeatureServiced.pdb"
@@ -204,7 +204,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_FEATURE_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -222,10 +222,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDO.lib FDOCommon.lib ExpressionEngine.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDO.lib FDOCommon.lib ExpressionEngine.lib"
 				OutputFile="$(OutDir)\MgServerFeatureService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll;ExpressionEngine.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerFeatureService.pdb"
@@ -285,7 +285,7 @@
 				Name="VCCLCompilerTool"
 				AdditionalOptions="/bigobj"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\..\Gws\Include;..\..\Gws\GwsCommon\inc;..\..\Gws\GwsQueryEngine\inc;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_FEATURE_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -303,10 +303,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDO.lib FDOCommon.lib ExpressionEngine.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDO.lib FDOCommon.lib ExpressionEngine.lib"
 				OutputFile="$(OutDir)\MgServerFeatureService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll;ExpressionEngine.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerFeatureService.pdb"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -38,7 +38,7 @@
 bool MgServerGetProviderCapabilities::m_isInitialized = MgServerGetProviderCapabilities::Initialize();
 
 
-MgServerGetProviderCapabilities::MgServerGetProviderCapabilities(CREFSTRING providerName)
+MgServerGetProviderCapabilities::MgServerGetProviderCapabilities(CREFSTRING providerName, CREFSTRING connectionString)
 {
     if (providerName.empty())
     {
@@ -64,6 +64,16 @@
     // TODO: Should this connection be cached?
     // use a smart pointer until the end in case there's an exception
     FdoPtr<FdoIConnection> fdoConn = connManager->CreateConnection(providerNoVersion.c_str());
+
+    // Note: WFS doesn't return the proper capabilities if a connection is not opened to the actual server using a connection string.
+
+    // Check if a connection string was specified
+    if(!connectionString.empty())
+    {
+        fdoConn->SetConnectionString(connectionString.c_str());
+        fdoConn->Open();
+    }
+
     CHECKNULL(fdoConn, L"MgServerGetProviderCapabilities.MgServerGetProviderCapabilities");
 
     m_xmlUtil = new MgXmlUtil();
@@ -74,19 +84,22 @@
     // no more risk of exceptions, so we can now assign these
     m_fdoConn = fdoConn.Detach();
     m_providerName = providerNoVersion;
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
     m_version = userInfo->GetApiVersion();
 }
 
 MgServerGetProviderCapabilities::~MgServerGetProviderCapabilities()
 {
+    // Check if the connection needs to be closed
+    if(m_fdoConn->GetConnectionState() == FdoConnectionState_Open)
+    {
+        m_fdoConn->Close();
+    }
+
     m_fdoConn = NULL;
 
-    if (NULL != m_xmlUtil)
-        delete m_xmlUtil;
-
-    if (NULL != m_xmlCap)
-        delete m_xmlCap;
+    delete m_xmlUtil;
+    delete m_xmlCap;
 }
 
 
@@ -473,7 +486,7 @@
         if (funcCnt > 0)
         {
             // Add function definition collection element if there are any functions available
-            DOMElement* funcDefColNode = m_xmlCap->AddChildNode(expressionNode, "FunctionDefinitionCollection");
+            DOMElement* funcDefColNode = m_xmlCap->AddChildNode(expressionNode, "FunctionDefinitionList");
             CHECKNULL(funcDefColNode, L"MgServerGetProviderCapabilities::CreateExpressionCapabilities");
 
             for (FdoInt32 i=0; i < funcCnt; i++)
@@ -506,7 +519,7 @@
                     if (argCnt > 0)
                     {
                         // Add ArgumentDefinitionCollection if there are arguments
-                        DOMElement* argDefColNode = m_xmlCap->AddChildNode(funcDefNode, "ArgumentDefinitionCollection");
+                        DOMElement* argDefColNode = m_xmlCap->AddChildNode(funcDefNode, "ArgumentDefinitionList");
                         CHECKNULL(argDefColNode, L"MgServerGetProviderCapabilities::CreateExpressionCapabilities");
 
                         for (FdoInt32 j=0; j < argCnt; j++)

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -26,7 +26,7 @@
 class MgServerGetProviderCapabilities
 {
 public:
-    MgServerGetProviderCapabilities(CREFSTRING providerName);
+    MgServerGetProviderCapabilities(CREFSTRING providerName, CREFSTRING connectionString);
     ~MgServerGetProviderCapabilities();
     MgByteReader* GetProviderCapabilities();
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -114,7 +114,7 @@
 
     if(NULL != filter)
     {
-        #ifdef _MAPDEBUG
+        #ifdef _DEBUG
         STRING filterText = filter->ToString();
         ACE_DEBUG((LM_ERROR, ACE_TEXT("JOIN FILTER:\n%W\n\n"), filterText.c_str()));
         #endif

Modified: sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -392,8 +392,8 @@
     if (!filterText.empty())
     {
         regularFilter = FdoFilter::Parse(filterText.c_str());
-        #ifdef _MAPDEBUG
-        ACE_DEBUG((LM_DEBUG, ACE_TEXT("FILTER(size=%d):\n%W\n\n"), filterText.length(), filterText.c_str()));
+        #ifdef _DEBUG
+        ACE_DEBUG((LM_ERROR, ACE_TEXT("FILTER(size=%d):\n%W\n\n"), filterText.length(), filterText.c_str()));
         #endif
     }
 
@@ -423,14 +423,14 @@
 
         FdoPtr<FdoByteArray> byteArray = FdoByteArray::Create(gisBytes, (FdoInt32)len);
 
-        #ifdef _MAPDEBUG
+        #ifdef _DEBUG
         // Get the spatial filter geometry text
         FdoPtr<FdoFgfGeometryFactory> geometryFactory = FdoFgfGeometryFactory::GetInstance();
         if(geometryFactory)
         {
             FdoPtr<FdoIGeometry> geometry = geometryFactory->CreateGeometryFromFgf(byteArray);
             STRING geomText = geometry->GetText();
-            ACE_DEBUG((LM_DEBUG, ACE_TEXT("SPATIAL FILTER:\n%W\n\n"), geomText.c_str()));
+            ACE_DEBUG((LM_ERROR, ACE_TEXT("SPATIAL FILTER:\n%W\n\n"), geomText.c_str()));
         }
         #endif
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Kml/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Kml/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Kml/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 
 INCLUDES = \
   -I../../../../Oem/ACE/ACE_wrappers \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../../../Oem/DWFTK7.1/develop/global/src \
   -I../../../../Common/Foundation \
   -I../../../../Common/Geometry \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -255,7 +255,8 @@
     {
         // Create a new, empty map
         Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
-        siteConn->Open(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        siteConn->Open(userInfo);
         Ptr<MgMap> map = new MgMap(siteConn);
         map->Create(GOOGLE_EARTH_WKT, extents, L"Google Earth Map");
         map->SetDisplayWidth(width);
@@ -846,7 +847,7 @@
 STRING MgServerKmlService::GetSessionId()
 {
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
     {
         sessionId = userInfo->GetMgSessionId();

Modified: sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Kml/ServerKmlService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_KML_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -123,7 +123,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_KML_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -202,7 +202,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_KML_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -281,7 +281,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
+				AdditionalIncludeDirectories="..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfParser;..\..\..\..\Common\MdfModel;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\Mapping;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_KML_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/LegendPlotUtil.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -182,11 +182,28 @@
 
     // do layer groups
     Ptr<MgLayerGroupCollection> mggroups = map->GetLayerGroups();
+    Ptr<MgLayerCollection> layers = map->GetLayers();
 
     // iterate over groups and draw each group's layers
     for (int k = 0; k < mggroups->GetCount(); k++)
     {
         Ptr<MgLayerGroup> mggroup = mggroups->GetItem(k);
+
+        // Count number of visible layers in this group.
+        bool hasVisibleLayers = false;
+        for (int l = 0; l < layers->GetCount(); l++)
+        {
+            Ptr<MgLayerBase> layer = layers->GetItem(l);
+            Ptr<MgLayerGroup> layerGroup = layer->GetGroup();
+            if ((layer->IsVisible()) && (layerGroup.p == mggroup.p))
+            {
+                hasVisibleLayers = true;
+                break;
+            }
+        }
+        if (!hasVisibleLayers)
+            continue;
+
         if (mggroup == NULL)
         {
             throw new MgNullReferenceException(L"MgLegendPlotUtil.AddLegendElement", __LINE__, __WFILE__, NULL, L"", NULL);
@@ -1469,7 +1486,6 @@
 
         ComputeLegendOffsetAndSize(layout, dMapScale, dr, map, legendOffsetX, legendOffsetY, legendWidth, legendHeight);
 
-        MgDwfVersion dwfVersion;
         float legendMargin = (float)(defaultLegendMargin*convertUnits);
         MgPlotSpecification legendSpec((float)legendWidth, float(legendHeight), pageUnits, legendMargin, legendMargin, legendMargin, legendMargin);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -15,7 +15,7 @@
   -I../../../../Common/MdfParser \
   -I$(map_fdo_include) \
   -I$(map_fdo_include)/ExpressionEngine \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../../../Common/CoordinateSystem \
   -I../../../../Common/Foundation \
   -I../../../../Common/Geometry \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -84,7 +84,7 @@
                                                       MgCoordinateSystem* layerCs,
                                                       TransformCache* cache)
 {
-#ifdef _MAPDEBUG
+#ifdef _DEBUG
     long dwStart = GetTickCount();
 #endif
 
@@ -227,7 +227,7 @@
         }
     }
 
-#ifdef _MAPDEBUG
+#ifdef _DEBUG
     printf("  ExecuteFeatureQuery() total time = %6.4f (s)\n", (GetTickCount()-dwStart)/1000.0);
 #endif
 
@@ -366,9 +366,9 @@
                                   bool selection,
                                   bool extractColors)
 {
-    #ifdef _MAPDEBUG
+    #ifdef _DEBUG
     long dwStart = GetTickCount();
-    printf("\nStylizeLayers() **MAPSTART** Layers:%d  Scale:%f\n", layers->GetCount(), scale);
+    printf("StylizeLayers() **MAPSTART** Layers:%d  Scale:%f\n", layers->GetCount(), scale);
     #endif
 
     // Cache coordinate system transforms for the life of the
@@ -430,8 +430,9 @@
 
         Ptr<MgLayerBase> mapLayer = layers->GetItem(i);
 
-        #ifdef _MAPDEBUG
-        printf("  StylizeLayers() **LAYERSTART** Name:%S  VAS:%S\n", (mapLayer->GetName()).c_str(), mapLayer->IsVisibleAtScale(scale)? L"True" : L"False");
+        #ifdef _DEBUG
+        long dwLayerStart = GetTickCount();
+        printf("  StylizeLayers(%d) **LAYERSTART** Name:%S  VAS:%S\n", i, (mapLayer->GetName()).c_str(), mapLayer->IsVisibleAtScale(scale)? L"True" : L"False");
         #endif
 
         if(mapLayer->GetLayerResourceContent() == L"")
@@ -475,10 +476,6 @@
 
             if (vl) //############################################################################ vector layer
             {
-                #ifdef _MAPDEBUG
-                long dwLayerStart = GetTickCount();
-                #endif
-
                 // Modify the layer scale range to also support infinite
                 // Need to apply default style as one will not be defined
                 if (selection)
@@ -500,8 +497,8 @@
 
                 if (scaleRange)
                 {
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S\n", (mapLayer->GetName()).c_str());
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S\n", i, (mapLayer->GetName()).c_str());
                     #endif
 
                     // get feature source id
@@ -522,8 +519,8 @@
                         extent.maxy += mcsOffset;
                     }
 
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S  Extents:%f,%f to %f,%f Expanded:%d\n", (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy, expandExtents);
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S  Extents:%f,%f to %f,%f Expanded:%d\n", i, (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy, expandExtents);
                     #endif
 
                     //get a transform from layer coord sys to map coord sys
@@ -554,8 +551,8 @@
                     if (overrideFilters)
                         overrideFilter = overrideFilters->GetItem(i);
 
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S  Override Filter(size=%d):\n%S\n", (mapLayer->GetName()).c_str(), overrideFilter.length(), overrideFilter.empty() ? L"(Empty)" : overrideFilter.c_str());
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S  Override Filter(size=%d):\n%S\n", i, (mapLayer->GetName()).c_str(), overrideFilter.length(), overrideFilter.empty() ? L"(Empty)" : overrideFilter.c_str());
                     #endif
 
                     // create the reader we'll use
@@ -563,8 +560,8 @@
                     // create an automatic FdoPtr around the reader
                     FdoPtr<FdoIFeatureReader> fdoReader = (NULL == rsReader) ? NULL : rsReader->GetInternalReader();
 
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S  Query Done.\n", (mapLayer->GetName()).c_str());
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S  Query Done.\n", i, (mapLayer->GetName()).c_str());
                     #endif
 
                     if (NULL != fdoReader.p)
@@ -577,25 +574,25 @@
                         // color extraction for RFC60 only when needed
                         if (extractColors)
                         {
-                            #ifdef _MAPDEBUG
-                            printf("  StylizeLayers() //ExtractColors// -Vector- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
+                            #ifdef _DEBUG
+                            printf("  StylizeLayers(%d) //ExtractColors// -Vector- Name:%S  Time:%6.4f (s)\n", i, (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                             #endif
                             ExtractColors(map, scaleRange, ds);
-                            #ifdef _MAPDEBUG
-                            printf("  StylizeLayers() ##ExtractColors## -Vector- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
+                            #ifdef _DEBUG
+                            printf("  StylizeLayers(%d) ##ExtractColors## -Vector- Name:%S  Time:%6.4f (s)\n", i, (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                             #endif
                         }
                     }
                 }
                 else  // not scaleRange
                 {
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **NOT Stylizing - NO SCALE RANGE** Name:%S\n", (mapLayer->GetName()).c_str());
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **NOT Stylizing - NO SCALE RANGE** Name:%S\n", i, (mapLayer->GetName()).c_str());
                     #endif
                 }
 
-                #ifdef _MAPDEBUG
-                printf("  StylizeLayers() **LAYEREND** -Vector- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
+                #ifdef _DEBUG
+                printf("  StylizeLayers(%d) **LAYEREND** -Vector- Name:%S  Time:%6.4f (s)\n", i, (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             }
             else if (gl) //############################################################################ grid layer
@@ -603,10 +600,6 @@
                 // TODO: FDO RFP - Make FdoPtr's reference counter thread-safe.
                 static ACE_Recursive_Thread_Mutex sg_fdoRfpMutex;
 
-                #ifdef _MAPDEBUG
-                long dwLayerStart = GetTickCount();
-                #endif
-
                 // make sure we have a valid scale range
                 MdfModel::GridScaleRange* scaleRange = Stylizer::FindScaleRange(*gl->GetScaleRanges(), scale);
 
@@ -619,8 +612,8 @@
                     // get the feature extent to use with the query
                     RS_Bounds extent = dr->GetBounds();
 
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S  Extents:%f,%f to %f,%f\n", (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy);
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S  Extents:%f,%f to %f,%f\n", i, (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy);
                     #endif
 
                     //now get the coordinate system of the layer data
@@ -694,8 +687,8 @@
                                 double urx = ur->GetX();
                                 double ury = ur->GetY();
 
-                                #ifdef _MAPDEBUG
-                                printf("  StylizeLayers() **Stylizing** Name:%S  Extents(SpatialContext):%f,%f to %f,%f\n", (mapLayer->GetName()).c_str(), llx, lly, urx, ury);
+                                #ifdef _DEBUG
+                                printf("  StylizeLayers(%d) **Stylizing** Name:%S  Extents(SpatialContext):%f,%f to %f,%f\n", i, (mapLayer->GetName()).c_str(), llx, lly, urx, ury);
                                 #endif
 
                                 if (NULL != xformer)
@@ -715,8 +708,8 @@
 
                     MG_CATCH_AND_RELEASE()
 
-                    #ifdef _MAPDEBUG
-                    printf("  StylizeLayers() **Stylizing** Name:%S  Extents(Using):%f,%f to %f,%f\n", (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy);
+                    #ifdef _DEBUG
+                    printf("  StylizeLayers(%d) **Stylizing** Name:%S  Extents(Using):%f,%f to %f,%f\n", i, (mapLayer->GetName()).c_str(), extent.minx, extent.miny, extent.maxx, extent.maxy);
                     #endif
 
                     double pixelsPerMapUnit = dr->GetMetersPerUnit() / METERS_PER_INCH * dr->GetDpi() / dr->GetMapScale();
@@ -740,16 +733,12 @@
                     }
                 }
 
-                #ifdef _MAPDEBUG
-                printf("  StylizeLayers() **LAYEREND** -Grid- Name:%S  Time:%6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
+                #ifdef _DEBUG
+                printf("  StylizeLayers(%d) **LAYEREND** -Grid- Name:%S  Time:%6.4f (s)\n", i, (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             }
             else if (dl) //############################################################################ drawing layer
             {
-                #ifdef _MAPDEBUG
-                long dwLayerStart = GetTickCount();
-                #endif
-
                 // make sure we have a valid scale range
                 if (scale >= dl->GetMinScale() && scale < dl->GetMaxScale())
                 {
@@ -803,8 +792,8 @@
                     dr->EndLayer();
                 }
 
-                #ifdef _MAPDEBUG
-                printf("  StylizeLayers() **LAYEREND** -Drawing- Name:%S  Time = %6.4f (s)\n\n", (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
+                #ifdef _DEBUG
+                printf("  StylizeLayers(%d) **LAYEREND** -Drawing- Name:%S  Time = %6.4f (s)\n", i, (mapLayer->GetName()).c_str(), (GetTickCount()-dwLayerStart)/1000.0);
                 #endif
             } // end layer switch
 
@@ -834,7 +823,7 @@
             STRING stackTrace = exception->GetStackTrace(locale);
             MG_LOG_EXCEPTION_ENTRY(message.c_str(), stackTrace.c_str());
 
-#if defined(_MAPDEBUG) || defined(_MAPDEBUG_PNG8)
+#if defined(_DEBUG) || defined(_DEBUG_PNG8)
             STRING details = mgException->GetDetails(locale);
 
             wstring err = L"\n %t Error during stylization of layer ";
@@ -843,14 +832,14 @@
             err += L"Details: ";
             err += details;
             err += L"\n";
-            ACE_MAPDEBUG( (LM_MAPDEBUG, err.c_str()) );
+            ACE_DEBUG( (LM_DEBUG, err.c_str()) );
 #endif
             // TODO could throw here depending on a serverconfig setting (RFC64)
 //          throw exception;
         } // if exception
     } // for all layers
 
-    #ifdef _MAPDEBUG
+    #ifdef _DEBUG
     printf("StylizeLayers() **MAPDONE** Layers:%d  Total Time:%6.4f (s)\n\n", layers->GetCount(), (GetTickCount()-dwStart)/1000.0);
     #endif
 
@@ -1376,6 +1365,7 @@
     } // for GetFeatureTypeStyles
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
 // Extract colors from the scalerange, lookup the referenceIds, and store
 // them with the map.

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -468,7 +468,7 @@
 
     // get the session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
@@ -714,8 +714,7 @@
         if (*iter) (*iter)->Release();
 
     //finally clean up if needed
-    if (xformToLL)
-        delete xformToLL;
+    delete xformToLL;
 
     return byteReader.Detach();
 }
@@ -1203,7 +1202,7 @@
 
         // Get the session ID
         STRING sessionId;
-        MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
         if (userInfo != NULL)
             sessionId = userInfo->GetMgSessionId();
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Mapping/ServerMappingService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MAPPING_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDO.lib FDOCommon.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDO.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\MgServerMappingServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerMappingServiced.pdb"
@@ -124,7 +124,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MAPPING_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -144,10 +144,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib FDO.lib FDOCommon.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib FDO.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\MgServerMappingServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerMappingServiced.pdb"
@@ -204,7 +204,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MAPPING_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -222,10 +222,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDO.lib FDOCommon.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDO.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\MgServerMappingService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\FDO\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\FDO\lib"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerMappingService.pdb"
@@ -284,7 +284,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Feature;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Renderers;..\..\..\..\Common\Stylization;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\..\Oem\FDO\inc;..\..\..\..\Oem\FDO\inc\ExpressionEngine;..\..\Gws\Include"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MAPPING_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -302,10 +302,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib FDO.lib FDOCommon.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib FDO.lib FDOCommon.lib"
 				OutputFile="$(OutDir)\MgServerMappingService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\FDO\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\FDO\lib64"
 				DelayLoadDLLs="FDO.dll;FDOCommon.dll"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerMappingService.pdb"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -288,6 +288,15 @@
 }
 
 
+void FeatureInfoRenderer::DrawScreenRaster(unsigned char* data, int length,
+                                           RS_ImageFormat format, int native_width, int native_height,
+                                           double x, double y, double w, double h, double angleDeg,
+                                           double alpha)
+{
+    DrawScreenRaster(data, length, format, native_width, native_height, x, y, w, h, angleDeg);
+}
+
+
 void FeatureInfoRenderer::DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
                                          RS_F_Point* path, int npts, double param_position)
 {

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/FeatureInfoRenderer.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -148,6 +148,10 @@
     virtual void DrawScreenRaster(unsigned char* data, int length,
                                   RS_ImageFormat format, int native_width, int native_height,
                                   double x, double y, double w, double h, double angleDeg);
+    virtual void DrawScreenRaster(unsigned char* data, int length,
+                                  RS_ImageFormat format, int native_width, int native_height,
+                                  double x, double y, double w, double h, double angleDeg,
+                                  double alpha);
     virtual void DrawScreenText(const RS_TextMetrics& tm, RS_TextDef& tdef, double insx, double insy,
                                 RS_F_Point* path, int npts, double param_position);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -8,7 +8,7 @@
   -I$(map_fdo_include) \
   -I$(map_fdo_include)/ExpressionEngine \
   -I../../../../Oem/ACE/ACE_wrappers \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../../../Common/Foundation \
   -I../../../../Common/Geometry \
   -I../../../../Common/PlatformBase \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -102,6 +102,16 @@
                           m_renderSelectionBatchSize,
                           MgConfigProperties::DefaultRenderingServicePropertyRenderSelectionBatchSize);
 
+    pConf->GetIntValue(MgConfigProperties::RenderingServicePropertiesSection,
+                          MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth,
+                          m_maxRasterImageWidth,
+                          MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageWidth);
+
+    pConf->GetIntValue(MgConfigProperties::RenderingServicePropertiesSection,
+                          MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight,
+                          m_maxRasterImageHeight,
+                          MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageHeight);
+
     // there should only be one instance of this class, so it's safe to
     // directly set these static variables
     bool bClampPoints;
@@ -132,32 +142,7 @@
 MgServerRenderingService::~MgServerRenderingService()
 {
 }
-
 ///////////////////////////////////////////////////////////////////////////////
-void MgServerRenderingService::GetTileCoords(MgMap* map, int tileColOffset, int tileColumn, int tileRow,
-    double &tileMinX, double &tileMaxX , double &tileMinY ,double & tileMaxY)
-{
-    Ptr<MgEnvelope> mapExtent = map->GetMapExtent();
-    Ptr<MgCoordinate> pt00 = mapExtent->GetLowerLeftCoordinate();
-    Ptr<MgCoordinate> pt11 = mapExtent->GetUpperRightCoordinate();
-    double mapMinX = rs_min(pt00->GetX(), pt11->GetX());
-    double mapMaxX = rs_max(pt00->GetX(), pt11->GetX());
-    double mapMinY = rs_min(pt00->GetY(), pt11->GetY());
-    double mapMaxY = rs_max(pt00->GetY(), pt11->GetY());
-
-    double scale = map->GetViewScale();
-    double metersPerUnit  = map->GetMetersPerUnit();
-    double metersPerPixel = METERS_PER_INCH / MgTileParameters::tileDPI;
-    double tileWidthMCS   = (double)MgTileParameters::tileWidth  * metersPerPixel * scale / metersPerUnit;
-    double tileHeightMCS  = (double)MgTileParameters::tileHeight * metersPerPixel * scale / metersPerUnit;
-
-    tileMinX = mapMinX + (double)(tileColumn  ) * tileWidthMCS;  // left edge
-    tileMaxX = mapMinX + (double)(tileColumn+ tileColOffset) * tileWidthMCS;  // right edge
-    tileMinY = mapMaxY - (double)(tileRow   + tileColOffset) * tileHeightMCS; // bottom edge
-    tileMaxY = mapMaxY - (double)(tileRow     ) * tileHeightMCS; // top edge
-}
-
-///////////////////////////////////////////////////////////////////////////////
 MgByteReader* MgServerRenderingService::RenderTile(MgMap* map,
                                                    CREFSTRING baseMapLayerGroupName,
                                                    INT32 tileColumn,
@@ -204,9 +189,9 @@
 
     double tileMinX,tileMaxX ,tileMinY ,tileMaxY;
     if (sm_useMetaTiles)
-        GetTileCoords(map, sm_useMetaTiles, tileColumn, tileRow, tileMinX,tileMaxX ,tileMinY ,tileMaxY);
+        map->GetTileCoords(sm_useMetaTiles, tileColumn, tileRow, tileMinX,tileMaxX ,tileMinY ,tileMaxY);
     else
-        GetTileCoords(map, 1, tileColumn, tileRow, tileMinX,tileMaxX ,tileMinY ,tileMaxY); // zero and 1 is the same logically
+        map->GetTileCoords(1, tileColumn, tileRow, tileMinX,tileMaxX ,tileMinY ,tileMaxY); // zero and 1 is the same logically
 
     // METATILING dont forget to increase the bitmap for the larger tile and set the format
     int metaFactor = sm_useMetaTiles?sm_useMetaTiles:1;
@@ -214,7 +199,8 @@
     ret = RenderTile(map, baseGroup, scaleIndex, MgTileParameters::tileWidth * metaFactor, 
                                                  MgTileParameters::tileHeight * metaFactor, 
                                                  scale, tileMinX, tileMaxX, tileMinY, tileMaxY, 
-                                                 sm_useMetaTiles?L"META":MgTileParameters::tileFormat);
+                                                 sm_useMetaTiles?     MgImageFormats::Meta
+                                                                    : MgTileParameters::tileFormat);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderTile")
 
@@ -281,7 +267,7 @@
     baseGroup->SetVisible(true);
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, NULL, roLayers, dr.get(), width, height, format, scale, extent, true, true);
+    ret = RenderMapInternal(map, NULL, roLayers, dr.get(), width, height, width, height, format, scale, extent, true, true, false);
 
     // restore the base group's visibility
     baseGroup->SetVisible(groupVisible);
@@ -297,7 +283,7 @@
 {
     MgByteSource* bs = metaTile->GetByteSource();
     ByteSourceImpl* bsimp = bs->GetSourceImpl();
-    assert (bs->GetMimeType() == L"META");
+    assert (bs->GetMimeType() == MgImageFormats::Meta);
     int size = (int) bsimp->GetLength();
     class MyByteSource {
     public:
@@ -308,8 +294,12 @@
     } *source = (MyByteSource *) bsimp;
 
     // some checking: the complete meta tile should be in the framebuffer handed over
-    int expectedSize = 4 * (sm_useMetaTiles * MgTileParameters::tileWidth) * (sm_useMetaTiles * MgTileParameters::tileHeight);
-    assert(size == expectedSize);
+    int expectedSize = 4 * (sm_useMetaTiles * MgTileParameters::tileWidth) 
+            * (sm_useMetaTiles * MgTileParameters::tileHeight);
+    if (size != expectedSize) {
+        throw new MgInvalidArgumentException(L"MgServerRenderingService.RenderTileFromMetaTile",
+          __LINE__, __WFILE__, NULL, L"MgWrongSizeOfMetaTile", NULL);
+    }
 
     MgByte* byteBuffer = source->Bytes();
     unsigned char* byteBuf = byteBuffer->Bytes();
@@ -434,7 +424,7 @@
     }
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, roLayers, dr.get(), width, height, scale, extent, false, options);
+    ret = RenderMapInternal(map, selection, roLayers, dr.get(), width, height, width, height, scale, extent, false, options, true);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderDynamicOverlay")
 
@@ -603,7 +593,7 @@
     auto_ptr<SE_Renderer> dr(CreateRenderer(drawWidth, drawHeight, bgcolor, false));
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, NULL, dr.get(), width, height, format, scale, b, false, bKeepSelection);
+    ret = RenderMapInternal(map, selection, NULL, dr.get(), drawWidth, drawHeight, width, height, format, scale, b, false, bKeepSelection, true);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderMap")
 
@@ -695,7 +685,7 @@
     auto_ptr<SE_Renderer> dr(CreateRenderer(width, height, bgcolor, bClip));
 
     // call the internal helper API to do all the stylization overhead work
-    ret = RenderMapInternal(map, selection, NULL, dr.get(), width, height, format, scale, b, false, bKeepSelection);
+    ret = RenderMapInternal(map, selection, NULL, dr.get(), width, height, width, height, format, scale, b, false, bKeepSelection, true);
 
     MG_CATCH_AND_THROW(L"MgServerRenderingService.RenderMap")
 
@@ -854,17 +844,20 @@
                                                           MgSelection* selection,
                                                           MgReadOnlyLayerCollection* roLayers,
                                                           SE_Renderer* dr,
+                                                          INT32 drawWidth,
+                                                          INT32 drawHeight,
                                                           INT32 saveWidth,
                                                           INT32 saveHeight,
                                                           CREFSTRING format,
                                                           double scale,
                                                           RS_Bounds& b,
                                                           bool expandExtents,
-                                                          bool bKeepSelection)
+                                                          bool bKeepSelection,
+                                                          bool renderWatermark)
 {
     MgRenderingOptions options(format, MgRenderingOptions::RenderSelection |
         MgRenderingOptions::RenderLayers | (bKeepSelection? MgRenderingOptions::KeepSelection : 0), NULL);
-    return RenderMapInternal(map, selection, roLayers, dr, saveWidth, saveHeight, scale, b, expandExtents, &options);
+    return RenderMapInternal(map, selection, roLayers, dr, drawWidth, drawHeight, saveWidth, saveHeight, scale, b, expandExtents, &options, renderWatermark);
 }
 
 
@@ -880,12 +873,15 @@
                                                           MgSelection* selection,
                                                           MgReadOnlyLayerCollection* roLayers,
                                                           SE_Renderer* dr,
+                                                          INT32 drawWidth,
+                                                          INT32 drawHeight,
                                                           INT32 saveWidth,
                                                           INT32 saveHeight,
                                                           double scale,
                                                           RS_Bounds& b,
                                                           bool expandExtents,
-                                                          MgRenderingOptions* options)
+                                                          MgRenderingOptions* options,
+                                                          bool renderWatermark)
 {
     // set the map scale to the requested scale
     map->SetViewScale(scale);
@@ -911,7 +907,7 @@
 
     // get the session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
@@ -1005,9 +1001,137 @@
 
                 MgMappingUtil::StylizeLayers(m_svcResource, m_svcFeature, m_svcDrawing, m_pCSFactory, map,
                     modLayers, overrideFilters, &ds, dr, dstCs, false, false, scale, (behavior & MgRenderingOptions::KeepSelection) != 0);
+
+                // Set selection mode to false to avoid affecting following code
+                dr->SetRenderSelectionMode(false);
             }
         }
 
+        if (renderWatermark && (behavior & MgRenderingOptions::RenderLayers))
+        {
+            // Rendering watermark only when rendering layers and not set renderWatermark to false
+
+            MgStringCollection watermarkIds;      //ID list to load watermark definition
+            WatermarkInstanceCollection watermarkInstances;   //Watermark list to render
+            WatermarkInstanceCollection tempWatermarkInstances;    //Used to reverse list
+            auto_ptr<WatermarkInstance> tempInstance;
+
+            // Get watermark instance in map
+            Ptr<MgResourceIdentifier> mapId = map->GetMapDefinition();
+            if (mapId.p)
+            {
+                auto_ptr<MapDefinition> mdef(MgMapBase::GetMapDefinition(m_svcResource, mapId));
+                WatermarkInstanceCollection* mapWatermarks = mdef->GetWatermarks();
+                for (int i=mapWatermarks->GetCount()-1; i>=0; i--)
+                    tempWatermarkInstances.Adopt(mapWatermarks->OrphanAt(i));
+                for (int i=tempWatermarkInstances.GetCount()-1; i>=0; i--)
+                {
+                    tempInstance.reset(tempWatermarkInstances.OrphanAt(i));
+                    if (!tempInstance.get())
+                        continue;
+                    if (((map->GetWatermarkUsage() & MgMap::Viewer) != 0
+                        && (tempInstance->GetUsage() & WatermarkInstance::Viewer) == 0)
+                        || ((map->GetWatermarkUsage() & MgMap::WMS) != 0
+                        && (tempInstance->GetUsage() & WatermarkInstance::WMS) == 0))
+                        continue;
+
+                    bool alreadyInList = false;
+                    for (int j=watermarkInstances.GetCount()-1; j >=0; j--)
+                    {
+                        if (tempInstance->Equals(watermarkInstances.GetAt(j)))
+                        {
+                            alreadyInList = true;
+                            break;
+                        }
+                    }
+
+                    if (!alreadyInList)
+                    {
+                        watermarkIds.Add(tempInstance->GetResourceId().c_str());
+                        watermarkInstances.Adopt(tempInstance.release());
+                    }
+                }
+            }
+
+            // Get watermark instance in layer
+            const int layerCount = tempLayers->GetCount();
+            auto_ptr<LayerDefinition> ldf;
+            for (int i=0; i<layerCount; ++i)
+            {
+                Ptr<MgLayerBase> mapLayer(tempLayers->GetItem(i));
+
+                // the layer resource content should be set during stylization
+                if (mapLayer->GetLayerResourceContent() == L"")
+                    continue;
+
+                ldf.reset(MgLayerBase::GetLayerDefinition(mapLayer->GetLayerResourceContent()));
+
+                WatermarkInstanceCollection* layerWatermarks = ldf->GetWatermarks();
+                for (int j=layerWatermarks->GetCount()-1; j>=0; j--)
+                    tempWatermarkInstances.Adopt(layerWatermarks->OrphanAt(j));
+                for (int j=tempWatermarkInstances.GetCount()-1; j>=0; j--)
+                {
+                    tempInstance.reset(tempWatermarkInstances.OrphanAt(j));
+                    if (!tempInstance.get())
+                        continue;
+                    if (((map->GetWatermarkUsage() & MgMap::Viewer) != 0
+                        && (tempInstance->GetUsage() & WatermarkInstance::Viewer) == 0)
+                        || ((map->GetWatermarkUsage() & MgMap::WMS) != 0
+                        && (tempInstance->GetUsage() & WatermarkInstance::WMS) == 0))
+                        continue;
+
+                    bool alreadyInList = false;
+                    for (int k=watermarkInstances.GetCount()-1; k>=0; k--)
+                    {
+                        if (tempInstance->Equals(watermarkInstances.GetAt(k)))
+                        {
+                            alreadyInList = true;
+                            break;
+                        }
+                    }
+
+                    if (!alreadyInList)
+                    {
+                        watermarkIds.Add(tempInstance->GetResourceId().c_str());
+                        watermarkInstances.Adopt(tempInstance.release());
+                    }
+                }
+            }
+            assert(tempWatermarkInstances.GetCount() == 0);
+
+            // load watermark source
+            if (watermarkIds.GetCount() != 0)
+            {
+                Ptr<MgStringCollection> wdefs = m_svcResource->GetResourceContents(&watermarkIds, NULL);
+                for (int i=watermarkIds.GetCount()-1; i>=0; i--)
+                {
+                    for (int j=watermarkInstances.GetCount()-1; j>=0; j--)
+                    {
+                        WatermarkInstance* instance = watermarkInstances.GetAt(j);
+                        if (instance->GetResourceId() == watermarkIds.GetItem(i))
+                        {
+                            instance->AdoptWatermarkDefinition(MgWatermark::GetWatermarkDefinition(wdefs->GetItem(i)));
+                        }
+                    }
+                }
+            }
+
+            for (int i=watermarkInstances.GetCount()-1; i>=0; i--)
+            {
+                WatermarkInstance* instance = watermarkInstances.GetAt(i);
+                WatermarkDefinition* wdef = instance->GetWatermarkDefinition();
+                if (instance->GetPositionOverride())
+                {
+                    wdef->AdoptPosition(instance->OrphanPositionOverride());
+                }
+                if (instance->GetAppearanceOverride())
+                {
+                    wdef->AdoptAppearance(instance->OrphanAppearanceOverride());
+                }
+                ds.StylizeWatermark(dr, wdef, drawWidth, drawHeight, saveWidth, saveHeight);
+            }
+        }
+
     MG_CATCH(L"MgServerRenderingService.RenderMapInternal")
 
     dr->EndMap();
@@ -1054,9 +1178,9 @@
     try
     {
         // call the image renderer to create the image from the bitmap
-        if (m_rendererName == L"AGG") // AGG or GD (obsolete?)
+        if (wcscmp(m_rendererName.c_str(), L"AGG") == 0)
         {
-            if (format == L"META")  // we dont use the colorPalette here for meta tiling
+            if (format == MgImageFormats::Meta)  // we dont use the colorPalette here for meta tiling
             {                       // as this call only returns the framebuffer
                  data.reset(((AGGRenderer*)dr)->Save(format, saveWidth, saveHeight, NULL, NULL));
                  // copy the framebuffer into the reader TODO: find a way to pass the pointer
@@ -1082,7 +1206,7 @@
             }
         }
         else
-            data.reset(((GDRenderer*)dr)->Save(format, saveWidth, saveHeight)); // dont care with metatiling
+            data.reset(((GDRenderer*)dr)->Save(format, saveWidth, saveHeight)); // dont care when metatiling
     }
     catch (exception e)
     {
@@ -1103,8 +1227,8 @@
             bs->SetMimeType(MgMimeType::Png);
         else if (format == MgImageFormats::Tiff)
             bs->SetMimeType(MgMimeType::Tiff);
-        else if (format == L"META")         // add a mimetype for our metatile
-            bs->SetMimeType(format);
+        else if (format == MgImageFormats::Meta)         // add a mimetype for our metatile
+            bs->SetMimeType(MgMimeType::Meta);
 
         ret = bs->GetReader();
     }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -155,9 +155,7 @@
                                         CREFSTRING featureFilter,
                                         INT32 maxFeatures,
                                         INT32 layerAttributeFilter);
-    void GetTileCoords(MgMap* map, int tileColOffset, int tileColumn, int tileRow, 
-        double &tileMinX, double &tileMaxX , double &tileMinY ,double & tileMaxY);
-    
+
 private:
     // used for tile generation
     MgByteReader* RenderTile(MgMap* map,
@@ -184,24 +182,30 @@
                                     MgSelection* selection,
                                     MgReadOnlyLayerCollection* roLayers,
                                     SE_Renderer* dr,
+                                    INT32 drawWidth,
+                                    INT32 drawHeight,
                                     INT32 saveWidth,
                                     INT32 saveHeight,
                                     CREFSTRING format,
                                     double scale,
                                     RS_Bounds& b,
                                     bool expandExtents,
-                                    bool bKeepSelection);
+                                    bool bKeepSelection,
+                                    bool renderWatermark);
 
     MgByteReader* RenderMapInternal(MgMap* map,
                                     MgSelection* selection,
                                     MgReadOnlyLayerCollection* roLayers,
                                     SE_Renderer* dr,
+                                    INT32 drawWidth,
+                                    INT32 drawHeight,
                                     INT32 saveWidth,
                                     INT32 saveHeight,
                                     double scale,
                                     RS_Bounds& b,
                                     bool expandExtents,
-                                    MgRenderingOptions* options);
+                                    MgRenderingOptions* options,
+                                    bool renderWatermark);
 
     void RenderForSelection(MgMap* map,
                          MgStringCollection* layerNames,
@@ -233,7 +237,8 @@
     double m_rasterGridSizeOverrideRatio;
     INT32 m_renderSelectionBatchSize;
     static INT32 sm_useMetaTiles;
-
+    INT32 m_maxRasterImageWidth;
+    INT32 m_maxRasterImageHeight;
 };
 
 #endif

Modified: sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Rendering/ServerRenderingService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepository.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepository.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepository.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -45,7 +45,7 @@
     public:
 
         MgResourceDatabase* GetResourceDataStreamDatabase() const;
-        CREFSTRING GetResourceDataFilePath() const;
+        STRING GetResourceDataFilePath() const;
 
 /// Data Members
 
@@ -57,7 +57,7 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgApplicationRepository::GetResourceDataFilePath() const
+inline STRING MgApplicationRepository::GetResourceDataFilePath() const
 {
     return m_resourceDataFilePath;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -54,7 +54,7 @@
     // up based on the current session ID.
 
     m_currUserInfo = new MgUserInformation;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
     STRING sessionId = currUserInfo->GetMgSessionId();
     STRING userName = currUserInfo->GetUserName();
@@ -152,11 +152,13 @@
 void MgApplicationRepositoryManager::NotifyResourceChanged(
     MgResourceIdentifier& resource)
 {
-    if (!resource.IsFolder())
+    MgCacheManager* cacheManager = MgCacheManager::GetInstance();
+
+    if (cacheManager->IsResourceChangeNotificationNeeded(&resource))
     {
         // Request the cache manager to release the lock on the resource/data
         // file that may be currently opened by the FDO connection manager.
-        MgCacheManager::GetInstance()->NotifyResourceChanged(&resource);
+        cacheManager->NotifyResourceChanged(&resource);
 
         // Insert the specified resource into the changed resource set.
         m_changedResources.insert(resource.ToString());

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/DataBindingInfo.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/DataBindingInfo.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/DataBindingInfo.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -34,10 +34,10 @@
 
         MgDataBindingInfo& operator=(const MgDataBindingInfo& dataBindingInfo);
 
-        CREFSTRING GetPreProcessTags() const;
-        CREFSTRING GetResourceDataFilePath() const;
-        CREFSTRING GetLoginUsername() const;
-        CREFSTRING GetLoginPassword() const;
+        STRING GetPreProcessTags() const;
+        STRING GetResourceDataFilePath() const;
+        STRING GetLoginUsername() const;
+        STRING GetLoginPassword() const;
         bool GetSubstituteUnmanagedDataMappings() const;
 
         void SetPreProcessTags(CREFSTRING preProcessTags);
@@ -59,22 +59,22 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgDataBindingInfo::GetPreProcessTags() const
+inline STRING MgDataBindingInfo::GetPreProcessTags() const
 {
     return m_preProcessTags;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetResourceDataFilePath() const
+inline STRING MgDataBindingInfo::GetResourceDataFilePath() const
 {
     return m_resourceDataFilePath;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetLoginUsername() const
+inline STRING MgDataBindingInfo::GetLoginUsername() const
 {
     return m_loginUsername;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetLoginPassword() const
+inline STRING MgDataBindingInfo::GetLoginPassword() const
 {
     return m_loginPassword;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/DbEnvironment.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/DbEnvironment.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/DbEnvironment.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -47,8 +47,9 @@
     m_dbEnv.set_timeout(MG_DB_ENV_TIMEOUT, DB_SET_LOCK_TIMEOUT);
     m_dbEnv.set_timeout(MG_DB_ENV_TIMEOUT, DB_SET_TXN_TIMEOUT);
     m_dbEnv.set_tx_max(MG_MAX_TRANSACTIONS);
+    m_dbEnv.set_tx_max(40); // Set maximum number of allowed transactions. Default is 20
 
-    u_int32_t containerFlags = DB_CREATE|DB_THREAD;
+    u_int32_t containerFlags = DB_CREATE|DB_THREAD|DBXML_NO_INDEX_NODES;
     u_int32_t environmentFlags = DB_CREATE|DB_THREAD|DB_INIT_MPOOL;
 
     if (m_transacted)
@@ -69,7 +70,7 @@
 
         if (MgRepositoryType::Session == repositoryType)
         {
-            m_dbEnv.set_flags(DB_LOG_INMEMORY, 1);
+            m_dbEnv.log_set_config(DB_LOG_IN_MEMORY, 1);
             environmentFlags |= DB_PRIVATE;
         }
         else
@@ -96,7 +97,7 @@
         pageSize = MG_SESS_DBXML_PAGE_SIZE;
     }
 
-    m_xmlMan = XmlManager(&m_dbEnv, DBXML_ALLOW_EXTERNAL_ACCESS);
+    m_xmlMan = XmlManager(m_dbEnv.get_DB_ENV(), DBXML_ALLOW_EXTERNAL_ACCESS);
     m_xmlMan.setDefaultPageSize(pageSize);
     m_xmlMan.setDefaultContainerType(XmlContainer::WholedocContainer);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/LibraryRepositoryManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -79,11 +79,18 @@
 
 void MgLibraryRepositoryManager::CommitTransaction()
 {
+    MG_RESOURCE_SERVICE_TRY()
+
+    // TODO: Updating the modified dates and doing the actual commit can cause DB_BUSY errors.
+    //       Ensure that only the Library updates the modified dates as the session does not need them. Check that this is true?
+    //       The root issue might be that 2 transactions are done here 1)Modified dates and 2)Repository Changes - can these be combined into a single transaction?
     m_resourceHeaderMan->UpdateResourceModifiedDates(m_dateModifiedResources);
 
     MgApplicationRepositoryManager::CommitTransaction();
 
     m_resourceHeaderMan->UpdatePermissionCache();
+
+    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgLibraryRepositoryManager.CommitTransaction")
 }
 
 ///----------------------------------------------------------------------------

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -7,10 +7,10 @@
 INCLUDES = \
   -I../../../../Oem/ACE/ACE_wrappers \
   -I$(map_fdo_include) \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
-  -I../../../../Oem/dbxml-2.3.10/install/include \
-  -I../../../../Oem/dbxml-2.3.10/dbxml/include \
-  -I../../../../Oem/dbxml-2.3.10/dbxml/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
+  -I../../../../Oem/dbxml/install/include \
+  -I../../../../Oem/dbxml/dbxml/include \
+  -I../../../../Oem/dbxml/dbxml/src \
   -I../../../../Oem/DWFTK7.1/develop/global/src \
   -I../../../../Common/Security \
   -I../../../../Common/Foundation \
@@ -209,4 +209,4 @@
   -L../../Common/Base \
   -L../../Common/Cache \
   -L../../Common/Manager \
-  -L../../../../Oem/dbxml-2.3.10/install/lib
+  -L../../../../Oem/dbxml/install/lib

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationInfo.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationInfo.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationInfo.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -58,10 +58,10 @@
 public:
     MgOperationInfo& operator=(const MgOperationInfo& opInfo);
 
-    CREFSTRING GetName() const;
+    STRING GetName() const;
     void SetName(CREFSTRING name);
 
-    CREFSTRING GetVersion() const;
+    STRING GetVersion() const;
     void SetVersion(CREFSTRING version);
 
     const MgOperationParameter& GetParameter(CREFSTRING name,
@@ -86,13 +86,13 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgOperationInfo::GetName() const
+inline STRING MgOperationInfo::GetName() const
 {
     return m_name;
 }
 
 
-inline CREFSTRING MgOperationInfo::GetVersion() const
+inline STRING MgOperationInfo::GetVersion() const
 {
     return m_version;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationParameter.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationParameter.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/OperationParameter.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -32,10 +32,10 @@
 public:
     MgOperationParameter& operator=(const MgOperationParameter& opParam);
 
-    CREFSTRING GetValue() const;
+    STRING GetValue() const;
     void SetValue(CREFSTRING value);
 
-    CREFSTRING GetContentType() const;
+    STRING GetContentType() const;
     void SetContentType(CREFSTRING contentType);
 
 /// Data Members
@@ -67,13 +67,13 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgOperationParameter::GetValue() const
+inline STRING MgOperationParameter::GetValue() const
 {
     return m_value;
 }
 
 
-inline CREFSTRING MgOperationParameter::GetContentType() const
+inline STRING MgOperationParameter::GetContentType() const
 {
     return m_contentType;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/RepositoryManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/RepositoryManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/RepositoryManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -431,7 +431,7 @@
         assert(NULL != m_dbTxn);
 
         m_xmlTxn.reset(new XmlTransaction(
-            environment->GetXmlManager().createTransaction(m_dbTxn)));
+            environment->GetXmlManager().createTransaction(m_dbTxn->get_DB_TXN())));
         assert(NULL != m_xmlTxn.get());
     }
     else
@@ -468,6 +468,8 @@
 
 void MgRepositoryManager::CommitTransaction()
 {
+    MG_RESOURCE_SERVICE_TRY()
+
     if (NULL != m_dbTxn)
     {
         m_dbTxn->commit(0);
@@ -475,6 +477,8 @@
         m_xmlTxn.reset();
     }
 
+    MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgRepositoryManager.CommitTransaction")
+
     m_transacted = false;
 }
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceContainer.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceContainer.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceContainer.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -43,24 +43,97 @@
 #endif
 
     XmlManager& xmlMan = m_environment.GetXmlManager();
-    assert(XmlContainer::WholedocContainer == xmlMan.getDefaultContainerType());
-    u_int32_t flags = xmlMan.getDefaultContainerFlags();
+    XmlContainer::ContainerType defaultContType = xmlMan.getDefaultContainerType();
+    assert(XmlContainer::WholedocContainer == defaultContType);
 
     if (m_environment.IsTransacted())
     {
-        assert(flags | DBXML_TRANSACTIONAL);
         XmlTransaction xmlTxn = xmlMan.createTransaction();
 
-        m_xmlContainer.reset(new XmlContainer(xmlMan.openContainer(
-            xmlTxn, fileName, flags)));
+        XmlContainerConfig cconfig;
+        cconfig.setAllowCreate(true); // If the container does not exist, create it.
+        cconfig.setTransactional(true); // Enable transactions.
+        cconfig.setThreaded(true);
+        cconfig.setContainerType(defaultContType);
+        cconfig.setAllowValidation(true);
+        cconfig.setIndexNodes(XmlContainerConfig::Off);
+        
+        m_xmlContainer.reset(new XmlContainer(xmlMan.openContainer(xmlTxn, fileName, cconfig)));
         xmlTxn.commit(0);
+
+        XmlContainer::ContainerType contType = m_xmlContainer->getContainerType();
+        assert(XmlContainer::WholedocContainer == contType);
     }
     else
     {
-        m_xmlContainer.reset(new XmlContainer(xmlMan.openContainer(
-            fileName, flags)));
+        XmlContainerConfig cconfig;
+        cconfig.setAllowCreate(true); // If the container does not exist, create it.
+        cconfig.setThreaded(true);
+        cconfig.setContainerType(defaultContType);
+        cconfig.setAllowValidation(true);
+        cconfig.setIndexNodes(XmlContainerConfig::Off);
+
+        m_xmlContainer.reset(new XmlContainer(xmlMan.openContainer(fileName, cconfig)));
+
+        XmlContainer::ContainerType contType = m_xmlContainer->getContainerType();
+        assert(XmlContainer::WholedocContainer == contType);
     }
 
+#ifdef _DEBUG
+    // Dump the flags used to create the container
+    STRING containerFileName = MgUtil::MultiByteToWideChar(fileName);
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("Opened Container        : %s\n"), MG_WCHAR_TO_TCHAR(containerFileName)));
+
+    bool bResult;
+    int nResult;
+    unsigned int unResult;
+    std::string strResult;
+    XmlContainer::ContainerType cResult;
+    XmlContainerConfig::ConfigState sResult;
+
+    XmlContainerConfig cconfig = m_xmlContainer->getFlags();
+    bResult = cconfig.getAllowCreate();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getAllowCreate          : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getAllowValidation();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getAllowValidation      : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getChecksum();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getChecksum             : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    strResult = cconfig.getCompressionName();
+    STRING compressionName = MgUtil::MultiByteToWideChar(strResult);
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getCompressionName      : %s\n"), MG_WCHAR_TO_TCHAR(compressionName)));
+    cResult = cconfig.getContainerType();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getContainerType        : %s\n"), (cResult == XmlContainer::WholedocContainer) ? ACE_TEXT("WholedocContainer") : ACE_TEXT("NodeContainer")));
+    bResult = cconfig.getEncrypted();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getEncrypted            : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getExclusiveCreate();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getExclusiveCreate      : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    sResult = cconfig.getIndexNodes();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getIndexNodes           : %d\n"), sResult));
+    nResult = cconfig.getMode();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getMode                 : %d\n"), nResult));
+    bResult = cconfig.getMultiversion();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getMultiversion         : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getNoMMap();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getNoMMap               : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    unResult = cconfig.getPageSize();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getPageSize             : %d\n"), unResult));
+    bResult = cconfig.getReadOnly();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getReadOnly             : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getReadUncommitted();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getReadUncommitted      : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    unResult = cconfig.getSequenceIncrement();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getSequenceIncrement    : %d\n"), unResult));
+    sResult = cconfig.getStatistics();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getStatistics           : %d\n"), sResult));
+    bResult = cconfig.getThreaded();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getThreaded             : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getTransactional();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getTransactional        : %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    bResult = cconfig.getTransactionNotDurable();
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("getTransactionNotDurable: %s\n"), bResult ? ACE_TEXT("True") : ACE_TEXT("False")));
+    ACE_DEBUG ((LM_INFO, ACE_TEXT("\n")));
+#endif
+
     m_opened = (NULL != m_xmlContainer.get());
     Reset();
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceDefinitionManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -388,33 +388,33 @@
 
     if (!resource.IsRuntimeResource())
     {
-        DOMDocument* domDoc = xmlDoc.getContentAsDOM();
-        assert(NULL != domDoc);
-        MgXmlUtil xmlUtil(domDoc, false);
+        std::string xmlContent;
+        MgXmlUtil xmlUtil(xmlDoc.getContent(xmlContent));
+
         DOMElement* rootNode = xmlUtil.GetRootNode();
-        assert(NULL != rootNode);
+        if(NULL != rootNode)
+        {
+            assert(NULL != rootNode);
 
-        STRING rootName;
-        const XMLCh* tag = rootNode->getTagName();
+            STRING rootName;
+            const XMLCh* tag = rootNode->getTagName();
 
-        if (NULL != tag)
-        {
-            rootName = X2W(tag);
-            assert(!rootName.empty());
-        }
+            if (NULL != tag)
+            {
+                rootName = X2W(tag);
+                assert(!rootName.empty());
+            }
 
-        STRING schemaName;
-        const XMLCh* attr = rootNode->getAttribute(X("xsi:noNamespaceSchemaLocation"));
+            STRING schemaName;
+            const XMLCh* attr = rootNode->getAttribute(X("xsi:noNamespaceSchemaLocation"));
 
-        if (NULL != attr)
-        {
-            schemaName = X2W(attr);
+            if (NULL != attr)
+            {
+                schemaName = X2W(attr);
+            }
+
+            ValidateDocument(resource, rootName, schemaName);
         }
-
-        // Free resources
-        domDoc->release();
-
-        ValidateDocument(resource, rootName, schemaName);
     }
 
     MG_RESOURCE_CONTAINER_CATCH_AND_THROW(L"MgResourceDefinitionManager.ValidateDocument")
@@ -523,7 +523,7 @@
         ValidateDocument(xmlDoc);
 
         // Insert the resource.
-        m_container.putDocument(GetXmlTxn(), xmlDoc, updateContext, 0);
+        m_container.putDocument(GetXmlTxn(), xmlDoc, updateContext);
     }
     catch (XmlException& e)
     {

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceHeaderManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -1475,7 +1475,6 @@
     XmlQueryExpression& selectGroupPermissions)
 {
     XmlManager& xmlMan = m_container.getManager();
-    queryContext.setReturnType(XmlQueryContext::DeadValues);
 
     string xpathInheritedFlags = "/*/Security/Inherited/text()";
     selectInheritedFlags = IsTransacted() ?
@@ -1548,6 +1547,9 @@
 
     MG_RESOURCE_SERVICE_TRY()
 
+    // Setup the working XmlDocument as we don't want to query the source
+    XmlDocument workingDoc = m_container.getDocument(GetXmlTxn(), xmlDoc.getName());
+
     // Read the resource permission information.
 
     permissionInfo.reset(new MgPermissionInfo(m_repositoryMan.m_accessedTime));
@@ -1558,7 +1560,7 @@
 
     // Get the owner.
 
-    if (xmlDoc.getMetaData(
+    if (workingDoc.getMetaData(
             MgResourceInfo::sm_metadataUri,
             MgResourceInfo::sm_metadataNames[MgResourceInfo::Owner],
             ownerValue))
@@ -1577,8 +1579,8 @@
     // Get the inherited flag.
 
     inheritedFlagResults = IsTransacted() ?
-        selectInheritedFlags.execute(GetXmlTxn(), xmlDoc, queryContext, 0) :
-        selectInheritedFlags.execute(xmlDoc, queryContext, 0);
+        selectInheritedFlags.execute(GetXmlTxn(), workingDoc, queryContext, 0) :
+        selectInheritedFlags.execute(workingDoc, queryContext, 0);
 
     if (inheritedFlagResults.next(inheritedValue))
     {
@@ -1598,11 +1600,11 @@
         // Get user permissions.
 
         nameResults = IsTransacted() ?
-            selectUserNames.execute(GetXmlTxn(), xmlDoc, queryContext, 0) :
-            selectUserNames.execute(xmlDoc, queryContext, 0);
+            selectUserNames.execute(GetXmlTxn(), workingDoc, queryContext, 0) :
+            selectUserNames.execute(workingDoc, queryContext, 0);
         permissionResults = IsTransacted() ?
-            selectUserPermissions.execute(GetXmlTxn(), xmlDoc, queryContext, 0) :
-            selectUserPermissions.execute(xmlDoc, queryContext, 0);
+            selectUserPermissions.execute(GetXmlTxn(), workingDoc, queryContext, 0) :
+            selectUserPermissions.execute(workingDoc, queryContext, 0);
 
         if (nameResults.size() != permissionResults.size())
         {
@@ -1621,11 +1623,11 @@
         // Get group permissions.
 
         nameResults = IsTransacted() ?
-            selectGroupNames.execute(GetXmlTxn(), xmlDoc, queryContext, 0) :
-            selectGroupNames.execute(xmlDoc, queryContext, 0);
+            selectGroupNames.execute(GetXmlTxn(), workingDoc, queryContext, 0) :
+            selectGroupNames.execute(workingDoc, queryContext, 0);
         permissionResults = IsTransacted() ?
-            selectGroupPermissions.execute(GetXmlTxn(), xmlDoc, queryContext, 0) :
-            selectGroupPermissions.execute(xmlDoc, queryContext, 0);
+            selectGroupPermissions.execute(GetXmlTxn(), workingDoc, queryContext, 0) :
+            selectGroupPermissions.execute(workingDoc, queryContext, 0);
 
         if (nameResults.size() != permissionResults.size())
         {

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -41,7 +41,7 @@
 
 public:
 
-    CREFSTRING GetDescription() const;
+    STRING GetDescription() const;
     void SetDescription(CREFSTRING description);
 
 /// Data Members
@@ -58,7 +58,7 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgResourcePackageManifestHandler::GetDescription() const
+inline STRING MgResourcePackageManifestHandler::GetDescription() const
 {
     return m_description;
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ResourceServiceDefs.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -27,6 +27,7 @@
 #include <vector>
 #include <dbxml/DbXml.hpp>
 #include <dwfcore/ZipFileDescriptor.h>
+#include "db_cxx.h"
 
 using namespace DbXml;
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -28,7 +28,7 @@
 #include "UnmanagedDataManager.h"
 #include "LogDetail.h"
 
-INT32 MgServerResourceService::sm_retryAttempts = 10;
+INT32 MgServerResourceService::sm_retryAttempts = 50;
 ACE_Time_Value MgServerResourceService::sm_retryInterval;
 
 MgSiteRepository*    MgServerResourceService::sm_siteRepository    = NULL;
@@ -42,50 +42,62 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 /// Server Resource Service retry macros.
-/// This pauses briefly (about 10 ms) before trying the operation again.
+/// This pauses briefly before trying the operation again.
 ///
-#define MG_RESOURCE_SERVICE_BEGIN_OPERATION(transacted)                       \
-    int numRetries = 0;                                                       \
+// DBXML always uses a transaction regardless.
+#define MG_RESOURCE_SERVICE_BEGIN_OPERATION()                                 \
+    MG_RESOURCE_SERVICE_BEGIN_RETRY()                                         \
+    repositoryMan->Initialize(true);                                          \
+
+#define MG_RESOURCE_SERVICE_END_OPERATION(maxRetries)                         \
+    MG_RESOURCE_SERVICE_END_RETRY(maxRetries)                                 \
+    MG_RESOURCE_SERVICE_BEGIN_RETRY()                                         \
+        repositoryMan->Terminate();                                           \
+    MG_RESOURCE_SERVICE_END_RETRY(maxRetries)                                 \
+
+#define MG_RESOURCE_SERVICE_BEGIN_RETRY()                                     \
+    {                                                                         \
+        int numRetries = 0;                                                   \
                                                                               \
-    while (true)                                                              \
-    {                                                                         \
-        try                                                                   \
+        while (true)                                                          \
         {                                                                     \
-            repositoryMan->Initialize(transacted);                            \
+            try                                                               \
+            {                                                                 \
 
-#define MG_RESOURCE_SERVICE_END_OPERATION(maxRetries)                         \
-            break;                                                            \
-        }                                                                     \
-        catch (MgException* e)                                                \
-        {                                                                     \
-            ++numRetries;                                                     \
+#define MG_RESOURCE_SERVICE_END_RETRY(maxRetries)                             \
+                break;                                                        \
+            }                                                                 \
+            catch (MgException* e)                                            \
+            {                                                                 \
+                ++numRetries;                                                 \
                                                                               \
-            if ((e->IsOfClass(MapGuide_Exception_MgDbXmlException) || e->IsOfClass(MapGuide_Exception_MgDbException)) \
-             && (DB_LOCK_DEADLOCK == (static_cast<MgThirdPartyException*>(e))->GetErrorCode())) \
-            {                                                                 \
-                if (numRetries < maxRetries)                                  \
+                if ((e->IsOfClass(MapGuide_Exception_MgDbXmlException) || e->IsOfClass(MapGuide_Exception_MgDbException)) \
+                 && (DB_LOCK_DEADLOCK == (static_cast<MgThirdPartyException*>(e))->GetErrorCode())) \
                 {                                                             \
-                    SAFE_RELEASE(e);                                          \
+                    if (numRetries < maxRetries)                              \
+                    {                                                         \
+                        SAFE_RELEASE(e);                                      \
+                    }                                                         \
+                    else                                                      \
+                    {                                                         \
+                        throw e;                                              \
+                    }                                                         \
                 }                                                             \
                 else                                                          \
                 {                                                             \
                     throw e;                                                  \
                 }                                                             \
             }                                                                 \
-            else                                                              \
+            catch (...)                                                       \
             {                                                                 \
-                throw e;                                                      \
+                throw;                                                        \
             }                                                                 \
+                                                                              \
+            ACE_Time_Value sleepTime;                                         \
+            sleepTime.msec((long)(sm_retryInterval.msec() + ((ACE_OS::rand()%10)+1))); \
+            ACE_OS::sleep(sleepTime);                                         \
         }                                                                     \
-        catch (...)                                                           \
-        {                                                                     \
-            throw;                                                            \
-        }                                                                     \
-                                                                              \
-        ACE_OS::sleep(sm_retryInterval);                                      \
-    }                                                                         \
-                                                                              \
-    repositoryMan->Terminate();                                               \
+    }
 
 ///----------------------------------------------------------------------------
 /// <summary>
@@ -123,7 +135,7 @@
 
     // Initialize performance tuning settings.
 
-    INT32 retryInterval = 10; // in milliseconds
+    INT32 retryInterval = 25; // in milliseconds
     MgConfiguration* configuration = MgConfiguration::GetInstance();
     assert(NULL != configuration);
 
@@ -225,7 +237,7 @@
     auto_ptr<MgSessionRepositoryManager> repositoryMan(
         new MgSessionRepositoryManager(*sm_sessionRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateRepositories();
 
@@ -278,7 +290,7 @@
         maxRetries = 0;
     }
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     if (NULL != content && content->IsRewindable())
     {
@@ -331,7 +343,7 @@
     auto_ptr<MgSessionRepositoryManager> repositoryMan(
         new MgSessionRepositoryManager(*sm_sessionRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->DeleteRepository(resource);
 
@@ -376,7 +388,7 @@
         maxRetries = 0;
     }
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     if (NULL != content && content->IsRewindable())
     {
@@ -424,7 +436,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->GetRepositoryContent(resource);
 
@@ -472,7 +484,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->GetRepositoryHeader(resource);
 
@@ -509,7 +521,7 @@
         maxRetries = 0;
     }
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     if (packageStream->IsRewindable())
     {
@@ -550,7 +562,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->LoadResourcePackage(packagePathname, logActivities);
 
@@ -599,7 +611,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->MakeResourcePackage(resource, packagePathname,
         packageDescription, logActivities);
@@ -631,7 +643,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     existed = repositoryMan->ResourceExists(resource);
 
@@ -680,7 +692,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateResources(resource, depth, type,
         properties, fromDate, toDate, computeChildren);
@@ -729,7 +741,8 @@
         maxRetries = 0;
     }
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    set<STRING> changedResources;
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     if (NULL != content && content->IsRewindable())
     {
@@ -743,10 +756,11 @@
 
     repositoryMan->SetResource(resource, content, header);
 
+    changedResources = repositoryMan->GetChangedResources();
     MG_RESOURCE_SERVICE_END_OPERATION(maxRetries)
 
     // Update the current set of changed resources.
-    UpdateChangedResources(repositoryMan->GetChangedResources());
+    UpdateChangedResources(changedResources);
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.SetResource")
 }
@@ -776,7 +790,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->DeleteResource(resource);
 
@@ -819,7 +833,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(destResource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->MoveResource(sourceResource, destResource, overwrite, cascade);
 
@@ -857,7 +871,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(destResource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->CopyResource(sourceResource, destResource, overwrite);
 
@@ -900,7 +914,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->GetResourceContent(resource, preProcessTags);
 
@@ -947,7 +961,7 @@
         auto_ptr<MgApplicationRepositoryManager> repositoryMan(
             CreateApplicationRepositoryManager(resourceId));
 
-        MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+        MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
         byteReader = repositoryMan->GetResourceContent(resourceId, preProcessTag);
 
@@ -999,7 +1013,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->GetResourceHeader(resource);
 
@@ -1048,7 +1062,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     dateTime = repositoryMan->GetResourceModifiedDate(resource);
 
@@ -1087,7 +1101,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateReferences(resource);
 
@@ -1177,7 +1191,7 @@
         {
             MgLibraryRepositoryManager libraryRepositoryMan(*sm_libraryRepository);
 
-            libraryRepositoryMan.Initialize(false);
+            libraryRepositoryMan.Initialize(true);
             libraryRepositoryMan.EnumerateParentMapDefinitions(childResources,
                 parentResources);
             libraryRepositoryMan.Terminate();
@@ -1185,7 +1199,7 @@
 
         MgSessionRepositoryManager sessionRepositoryMan(*sm_sessionRepository);
 
-        sessionRepositoryMan.Initialize(false);
+        sessionRepositoryMan.Initialize(true);
         sessionRepositoryMan.EnumerateParentMapDefinitions(childResources,
             parentResources);
         sessionRepositoryMan.Terminate();
@@ -1225,7 +1239,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     resourceList = repositoryMan->EnumerateResourceDocuments(
         resources, type, properties);
@@ -1272,7 +1286,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->ChangeResourceOwner(resource, owner, includeDescendants);
 
@@ -1316,7 +1330,7 @@
     auto_ptr<MgLibraryRepositoryManager> repositoryMan(
         new MgLibraryRepositoryManager(*sm_libraryRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->InheritPermissionsFrom(resource);
 
@@ -1353,7 +1367,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateResourceData(resource);
 
@@ -1401,7 +1415,7 @@
         maxRetries = 0;
     }
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     if (data->IsRewindable())
     {
@@ -1444,7 +1458,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->DeleteResourceData(resource, dataName);
 
@@ -1482,7 +1496,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->RenameResourceData(resource, oldDataName, newDataName, overwrite);
 
@@ -1527,7 +1541,7 @@
     auto_ptr<MgApplicationRepositoryManager> repositoryMan(
         CreateApplicationRepositoryManager(resource));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->GetResourceData(resource, dataName,
         preProcessTags);
@@ -1603,7 +1617,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateUsers(group, role, includePassword,
         includeGroups);
@@ -1635,7 +1649,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->AddUser(userId, username, password, description);
 
@@ -1663,7 +1677,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->DeleteUsers(users);
 
@@ -1692,7 +1706,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->UpdateUser(userId, newUserId, newUsername, newPassword, newDescription);
 
@@ -1724,7 +1738,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     byteReader = repositoryMan->EnumerateGroups(user, role);
 
@@ -1753,7 +1767,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->AddGroup(group, description);
 
@@ -1780,7 +1794,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->DeleteGroups(groups);
 
@@ -1809,7 +1823,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->UpdateGroup(group, newGroup, newDescription);
 
@@ -1847,7 +1861,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->GrantGroupMembershipsToUsers(groups, users);
 
@@ -1885,7 +1899,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->RevokeGroupMembershipsFromUsers(groups, users);
 
@@ -1931,7 +1945,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     roles = repositoryMan->EnumerateRoles(user, group);
 
@@ -1997,7 +2011,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->GrantRoleMembershipsToUsers( roles, users );
 
@@ -2035,7 +2049,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->RevokeRoleMembershipsFromUsers( roles, users );
 
@@ -2073,7 +2087,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->GrantRoleMembershipsToGroups( roles, groups );
 
@@ -2111,7 +2125,7 @@
     auto_ptr<MgSiteRepositoryManager> repositoryMan(
         new MgSiteRepositoryManager(*sm_siteRepository));
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(true)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     repositoryMan->RevokeRoleMembershipsFromGroups( roles, groups );
 
@@ -2132,14 +2146,20 @@
 
     MG_RESOURCE_SERVICE_TRY()
 
-    MgSiteRepositoryManager repositoryMan(*sm_siteRepository);
+    auto_ptr<MgSiteRepositoryManager> repositoryMan(
+        new MgSiteRepositoryManager(*sm_siteRepository));
+
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
+
     MgSiteResourceContentManager* resourceContentMan =
         dynamic_cast<MgSiteResourceContentManager*>(
-            repositoryMan.GetResourceContentManager());
+            repositoryMan->GetResourceContentManager());
     ACE_ASSERT(NULL != resourceContentMan);
 
     securityCache = resourceContentMan->CreateSecurityCache();
 
+    MG_RESOURCE_SERVICE_END_OPERATION(sm_retryAttempts)
+
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.CreateSecurityCache")
 
     return securityCache.Detach();
@@ -2157,14 +2177,20 @@
 
     MG_RESOURCE_SERVICE_TRY()
 
-    MgLibraryRepositoryManager repositoryMan(*sm_libraryRepository);
+    auto_ptr<MgLibraryRepositoryManager> repositoryMan(
+        new MgLibraryRepositoryManager(*sm_libraryRepository));
+
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
+
     MgResourceHeaderManager* resourceHeaderManager =
         dynamic_cast<MgResourceHeaderManager*>(
-            repositoryMan.GetResourceHeaderManager());
+            repositoryMan->GetResourceHeaderManager());
     ACE_ASSERT(NULL != resourceHeaderManager);
 
     permissionCache = resourceHeaderManager->CreatePermissionCache();
 
+    MG_RESOURCE_SERVICE_END_OPERATION(sm_retryAttempts)
+
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgServerResourceService.CreatePermissionCache")
 
     return permissionCache.Detach();
@@ -2195,7 +2221,7 @@
         repositoryMan->GetResourceContentManager();
     ACE_ASSERT(NULL != resourceContentMan);
 
-    MG_RESOURCE_SERVICE_BEGIN_OPERATION(false)
+    MG_RESOURCE_SERVICE_BEGIN_OPERATION()
 
     resourceContentMan->CheckPermission(*resource, permission);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/ServerResourceService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\dbxml-2.3.10\db-4.5.20\\build_windows;..\..\..\..\Oem\dbxml-2.3.10\dbxml\include;..\..\..\..\Oem\dbxml-2.3.10\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;&quot;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows&quot;;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib libdb45d.lib libdbxml23d.lib dwfcore_wt.1.1.1.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib libdb48d.lib libdbxml25d.lib dwfcore_wt.1.1.1.lib"
 				OutputFile="$(OutDir)\MgServerResourceServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerResourceServiced.pdb"
 				SubSystem="2"
@@ -123,7 +123,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\dbxml-2.3.10\db-4.5.20\\build_windows;..\..\..\..\Oem\dbxml-2.3.10\dbxml\include;..\..\..\..\Oem\dbxml-2.3.10\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;&quot;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows&quot;;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -143,10 +143,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib libdb45d.lib libdbxml23d.lib dwfcore_wt.1.1.1.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib libdb48d.lib libdbxml25d.lib dwfcore_wt.1.1.1.lib"
 				OutputFile="$(OutDir)\MgServerResourceServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug64\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\debug64\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerResourceServiced.pdb"
 				SubSystem="2"
@@ -202,7 +202,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\dbxml-2.3.10\db-4.5.20\\build_windows;..\..\..\..\Oem\dbxml-2.3.10\dbxml\include;..\..\..\..\Oem\dbxml-2.3.10\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;&quot;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows&quot;;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -220,10 +220,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib libdb45.lib libdbxml23.lib dwfcore_wt.1.1.1.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib libdb48.lib libdbxml25.lib dwfcore_wt.1.1.1.lib"
 				OutputFile="$(OutDir)\MgServerResourceService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerResourceService.pdb"
 				SubSystem="2"
@@ -281,7 +281,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\dbxml-2.3.10\db-4.5.20\\build_windows;..\..\..\..\Oem\dbxml-2.3.10\dbxml\include;..\..\..\..\Oem\dbxml-2.3.10\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\..\Common;..\..\Common\Base;..\..\Common\Cache;..\..\Common\Manager;..\Feature;..\Site;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;;&quot;..\..\..\..\Oem\dbxml\db-4.8.26\\build_windows&quot;;..\..\..\..\Oem\dbxml\dbxml\include;..\..\..\..\Oem\dbxml\dbxml\src;..\..\..\..\Oem\DWFTK7.1\develop\global\src;..\..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_RESOURCE_EXPORTS;DWFCORE_STATIC;DWFTK_USE_DWFCORE_ZLIB"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -299,10 +299,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib libdb45.lib libdbxml23.lib dwfcore_wt.1.1.1.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib libdb48.lib libdbxml25.lib dwfcore_wt.1.1.1.lib"
 				OutputFile="$(OutDir)\MgServerResourceService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release64\vc8.0"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64;..\..\..\..\Oem\DWFTK7.1\develop\global\lib\static\release64\vc8.0"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerResourceService.pdb"
 				SubSystem="2"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -211,7 +211,7 @@
         // TODO: Remove this option if it is not in use.
 
         MgSecurityManager securityMan;
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         assert(NULL != currUserInfo);
         STRING userName = currUserInfo->GetUserName();
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Resource/SiteResourceContentManager.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -292,7 +292,6 @@
 
         string docQuery = "/Group/Users/User/Name/text()";
         XmlQueryContext docContext = xmlMan.createQueryContext();
-        docContext.setReturnType(XmlQueryContext::DeadValues);
 
         // Execute the XQuery.
 
@@ -395,7 +394,6 @@
 
         string docQuery = "/Role/Users/User/Name/text()";
         XmlQueryContext docContext = xmlMan.createQueryContext();
-        docContext.setReturnType(XmlQueryContext::DeadValues);
 
         // Execute the XQuery.
 
@@ -889,7 +887,6 @@
 
         string docQuery = "/Role/Groups/Group/Name/text()";
         XmlQueryContext docContext = xmlMan.createQueryContext();
-        docContext.setReturnType(XmlQueryContext::DeadValues);
 
         // Execute the XQuery.
 
@@ -2027,7 +2024,10 @@
 
     // Set up an XQuery.
 
-    string query = "/Group/Users/User[Name=\"";
+    string query = "delete nodes collection('";
+    query += m_container.getName();
+    query += "')";
+    query += "/Group/Users/User[Name=\"";
     query += MgUtil::WideCharToMultiByte(userId);
     query += "\"]";
 
@@ -2035,22 +2035,14 @@
 
     XmlManager& xmlMan = m_container.getManager();
     XmlQueryContext queryContext = xmlMan.createQueryContext();
-    XmlUpdateContext updateContext = xmlMan.createUpdateContext();
-    XmlModify xmlMod = xmlMan.createModify();
 
     if (IsTransacted())
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(GetXmlTxn(), query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(GetXmlTxn(), docValue, queryContext, updateContext);
+        xmlMan.query(GetXmlTxn(), query, queryContext, 0);
     }
     else
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(docValue, queryContext, updateContext);
+        xmlMan.query(query, queryContext);
     }
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgSiteResourceContentManager.RemoveUserFromGroup")
@@ -2143,7 +2135,10 @@
 
     // Set up an XQuery.
 
-    string query = "/Role/Users/User[Name=\"";
+    string query = "delete nodes collection('";
+    query += m_container.getName();
+    query += "')";
+    query += "/Role/Users/User[Name=\"";
     query += MgUtil::WideCharToMultiByte(userId);
     query += "\"]";
 
@@ -2151,22 +2146,14 @@
 
     XmlManager& xmlMan = m_container.getManager();
     XmlQueryContext queryContext = xmlMan.createQueryContext();
-    XmlUpdateContext updateContext = xmlMan.createUpdateContext();
-    XmlModify xmlMod = xmlMan.createModify();
 
     if (IsTransacted())
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(GetXmlTxn(), query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(GetXmlTxn(), docValue, queryContext, updateContext);
+        xmlMan.query(GetXmlTxn(), query, queryContext, 0);
     }
     else
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(docValue, queryContext, updateContext);
+        xmlMan.query(query, queryContext);
     }
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgSiteResourceContentManager.RemoveUserFromRole")
@@ -2259,7 +2246,10 @@
 
     // Set up an XQuery.
 
-    string query = "/Role/Groups/Group[Name=\"";
+    string query = "delete nodes collection('";
+    query += m_container.getName();
+    query += "')";
+    query += "/Roles/Groups/Group[Name=\"";
     query += MgUtil::WideCharToMultiByte(groupId);
     query += "\"]";
 
@@ -2267,22 +2257,14 @@
 
     XmlManager& xmlMan = m_container.getManager();
     XmlQueryContext queryContext = xmlMan.createQueryContext();
-    XmlUpdateContext updateContext = xmlMan.createUpdateContext();
-    XmlModify xmlMod = xmlMan.createModify();
 
     if (IsTransacted())
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(GetXmlTxn(), query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(GetXmlTxn(), docValue, queryContext, updateContext);
+        xmlMan.query(GetXmlTxn(), query, queryContext, 0);
     }
     else
     {
-        XmlQueryExpression xmlSelect = xmlMan.prepare(query, queryContext);
-
-        xmlMod.addRemoveStep(xmlSelect);
-        xmlMod.execute(docValue, queryContext, updateContext);
+        xmlMan.query(query, queryContext);
     }
 
     MG_RESOURCE_SERVICE_CATCH_AND_THROW(L"MgSiteResourceContentManager.RemoveGroupFromRole")
@@ -2358,7 +2340,6 @@
     XmlManager& xmlMan = m_container.getManager();
 
     XmlQueryContext docContext = xmlMan.createQueryContext();
-    docContext.setReturnType(XmlQueryContext::DeadValues);
 
     string xpathUserPassword = "/User/Password/text()";
     XmlQueryExpression selectUserPassword = IsTransacted() ?

Modified: sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -86,7 +86,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         m_service->NotifyResourcesChanged(resources);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -76,7 +76,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         Ptr<MgSerializableCollection> feedbackList = m_service->RegisterServicesOnServers(serverInfoList);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -76,7 +76,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         m_service->UnregisterServicesOnServers(serverInfoList);
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/ServerAdmin/ServerAdminService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Site/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Site/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Site/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -12,7 +12,7 @@
   -I../../../../Common/PlatformBase \
   -I../../../../Common/MapGuideCommon \
   -I../../../../Oem/ACE/ACE_wrappers \
-  -I../../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../../Oem/dbxml/xerces-c-src/src \
   -I../../Common \
   -I../../Common/Base \
   -I../../Common/Manager \

Modified: sandbox/rfc90/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -54,12 +54,16 @@
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpAuthenticate::Execute()\n")));
 
-    // Disabled logging this operation because it is called very often
-//  MG_LOG_OPERATION_MESSAGE(L"Authenticate");
+    // Only log this operation for DEBUG builds because it is called very often
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE(L"Authenticate");
+#endif
 
     MG_SITE_SERVICE_TRY()
 
-//  MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+#endif
 
     ACE_ASSERT(m_stream != NULL);
 
@@ -74,14 +78,15 @@
 
         BeginExecution();
 
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgUserInformation");
-//      MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
-//      MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-//      MG_LOG_OPERATION_MESSAGE_ADD_BOOL(returnAssignedRoles);
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
-
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgUserInformation");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(returnAssignedRoles);
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#endif
         // Validate() not called here since this is the operation that performs authentication.
 
         Ptr<MgStringCollection> assignedRoles = m_service->Authenticate(userInfo,
@@ -91,8 +96,10 @@
     }
     else
     {
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#endif
     }
 
     if (!m_argsRead)
@@ -102,18 +109,24 @@
     }
 
     // Successful operation
-//  MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+#endif
 
     MG_SITE_SERVICE_CATCH(L"MgOpAuthenticate.Execute")
 
     if (mgException != NULL)
     {
         // Failed operation
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+#endif
     }
 
     // Add admin log entry for operation
-//  MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+#endif
 
     MG_SITE_SERVICE_THROW()
 }

Modified: sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -728,7 +728,7 @@
 STRING MgServerSiteService::CreateSession()
 {
     STRING session;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
 
     MG_SITE_SERVICE_TRY()
@@ -839,7 +839,7 @@
 {
     STRING session;
     STRING userId;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
 
     MG_SITE_SERVICE_TRY()
@@ -1067,7 +1067,7 @@
 {
     bool bAllowed = false;
 
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     STRING currUser = userInfo->GetUserName();
     if (currUser.empty())
     {

Modified: sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Site/ServerSiteService.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_SITE_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -64,10 +64,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib"
 				OutputFile="$(OutDir)\MgServerSiteServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerSiteServiced.pdb"
 				SubSystem="2"
@@ -123,7 +123,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_SITE_EXPORTS"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -143,10 +143,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACEd.lib xerces-c_2D.lib"
+				AdditionalDependencies="ACEd.lib xerces-c_3mgD.lib"
 				OutputFile="$(OutDir)\MgServerSiteServiced.dll"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerSiteServiced.pdb"
 				SubSystem="2"
@@ -202,7 +202,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_SITE_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -220,10 +220,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib"
 				OutputFile="$(OutDir)\MgServerSiteService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml-2.3.10\lib"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib;..\..\..\..\Oem\dbxml\lib"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerSiteService.pdb"
 				SubSystem="2"
@@ -281,7 +281,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;"
+				AdditionalIncludeDirectories="..\..\..\..\Common\MdfModel;..\..\..\..\Common\Foundation;..\..\..\..\Common\Geometry;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Security;..\..\Common;..\..\Common\Base;..\..\Common\Manager;..\Resource;..\..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\..\Oem\dbxml\xerces-c-src\src&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_SITE_EXPORTS"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -299,10 +299,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="ACE.lib xerces-c_2.lib"
+				AdditionalDependencies="ACE.lib xerces-c_3mg.lib"
 				OutputFile="$(OutDir)\MgServerSiteService.dll"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml-2.3.10\lib64"
+				AdditionalLibraryDirectories="..\..\..\..\Oem\ACE\ACE_wrappers\lib64;..\..\..\..\Oem\dbxml\lib64"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)\MgServerSiteService.pdb"
 				SubSystem="2"

Modified: sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -23,7 +23,7 @@
 IMPLEMENT_CREATE_SERVICE(MgServerTileService)
 
 ACE_Recursive_Thread_Mutex MgServerTileService::sm_mutex;
-ACE_Recursive_Thread_Mutex MgServerTileService::sm_tileMutex;
+
 bool MgServerTileService::sm_initialized = false;
 MgServerTileService::MapCache MgServerTileService::sm_mapCache;
 bool MgServerTileService::sm_renderOnly = false;
@@ -88,10 +88,10 @@
     m_tileCache = new MgTileCache(this);
     
     // bail out if metatile factor to large (allocation problem)
-    if (METAMAXDIM < sm_useMetaTiles)
+    if (sm_useMetaTiles > MgConfigProperties::sm_cviTileServiceProperties->m_maximumValue)
     {
         std::wstringstream text;
-        text << L"MetaTiling Config: " << sm_useMetaTiles << L" is larger than maximum " << METAMAXDIM;
+        text << L"MetaTiling Config: " << sm_useMetaTiles << L" is larger than maximum " << MgConfigProperties::sm_cviTileServiceProperties->m_maximumValue;
 
         MgStringCollection arguments;
         arguments.Add(text.str().c_str());
@@ -136,9 +136,9 @@
         time_t currTime;
         // sm_creationCutoffTime times or found 
         // TODO think about multithreaded lockmap access
-        for  (INT32 diffTime=0;(found = m_tileCache->GetLockMap().count(tilePathname)) 
-                               && diffTime < sm_creationCutoffTime; 
-                               ACE_OS::time(&currTime),diffTime = (INT32)(currTime - startTime))
+        //(found = m_tileCache->GetLockMap().count(tilePathname)) 
+        for (INT32 diffTime=0;diffTime < sm_creationCutoffTime; 
+             ACE_OS::time(&currTime),diffTime = (INT32)(currTime - startTime))
         {   
             // sm_pollingInterval om milliseconds
             ACE_OS::sleep(polInt);
@@ -197,7 +197,7 @@
         throw new MgInvalidArgumentException(L"MgServerTileService.GetTile",
             __LINE__, __WFILE__, &arguments, L"MgInvalidScaleIndex", NULL);
     }
-
+    // 0 is default == defaut tiling mode
     if (sm_useMetaTiles)
         return GetMetaTile(mapDefinition, baseMapLayerGroupName, tileColumn, tileRow, scaleIndex);
     else
@@ -321,7 +321,8 @@
             else
             {
                 Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
-                siteConn->Open(MgUserInformation::GetCurrentUserInfo());
+                Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+                siteConn->Open(userInfo);
                 map = new MgMap(siteConn);
                 map->Create(resourceService, mapDefinition, mapString);
                 cachedMap = new MgMemoryStreamHelper();
@@ -408,42 +409,17 @@
     switch (sm_lockMethod)
     {
     case 3:    // use ace conditions no files
-        {   // protect test of lockmap entry with a guard
-            ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = 0;
-            // look for lock and wait if found
-            ACE_MT(ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileMutex, 0));
-            if (wait = m_tileCache->GetLockMap()[metaTilePathname])
-            {   // lock has been found
-                std::wstringstream text;
-                text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLock1(" << metaTilePathname << L")\n" ;
-                ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-
-                ACE_Time_Value waitTime(METATILEWAIT);
-                if (-1 == wait->wait()) // wait forever
-                {
-                    std::wstringstream text;
-                    text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockTimedOut1(" << metaTilePathname << L")\n" ;
-                    ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-
-                    MgStringCollection arguments;
-                    arguments.Add(metaTilePathname);
-                    throw new MgFileIoException(L"MgServerTileService.GetTile",
-                        __LINE__, __WFILE__, &arguments, L"MgWaitForLockTimedOut", NULL);
-                } else {
-                    std::wstringstream text;
-                    text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockCAUGHTSIGNAL1(" << metaTilePathname << L")\n" ;
-                    ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-                }
-            }
-        } 
+        m_tileCache->WaitForLock(metaTilePathname);
         break;
     case 2:
         if (DetectTileLockFile(lockPathname, tilePathname))
         {
+#ifdef _DEBUG
             std::wstringstream text;
-            text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedDanglingLockfile(" << tileRow  << L", " <<  tileColumn << L") " 
-                << lockPathname << L")\n" ;
+            text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedDanglingLockfile(" << tileRow  
+                << L", " <<  tileColumn << L") " << lockPathname << L")\n" ;
             ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
             // TODO: Handle the exception by displaying a tile with an error message?
             MgFileUtil::DeleteFile(lockPathname, true);
         }        
@@ -452,22 +428,24 @@
     case 1: // default
         if (DetectTileLockFile(metaTileLockPathname, metaTilePathname))
         {
+#ifdef _DEBUG
             std::wstringstream text;
-            text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedDanglingLockfile(" << metaTileRow  << L", " <<  metaTileColumn << L") " 
-                << metaTileLockPathname << L")\n" ;
+            text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedDanglingLockfile(" << metaTileRow  
+                << L", " <<  metaTileColumn << L") " << metaTileLockPathname << L")\n" ;
             ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
             // TODO: Handle the exception by displaying a tile with an error message?
             MgFileUtil::DeleteFile(metaTileLockPathname, true);
         }     
     } /// end switch
     // try getting the tile from the cache first time
     cacheHit = ret = m_tileCache->Get(tilePathname);
-    {
+#ifdef _DEBUG
         std::wstringstream text;
         text << L"(" << ACE_OS::thr_self() << (cacheHit?L") CACHEHIT":L") CACHEMISS") << L": GetTile(" 
             << tileRow  << L", " <<  tileColumn << L") " << tilePathname << L"\n";
         ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-    }
+#endif
     // if the reader is NULL then the tile wasn't in the cache and we need to generate it
     while (NULL == ret) // while is needed to use break; =========================================
     {
@@ -483,36 +461,8 @@
             switch(sm_lockMethod) 
             {
             case 3:// TODO do we need the second lock test here in a signal/wait algorithm?
-            {  // use ace conditions no files
-                ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = 0;  // protect test of lockmap entry with a guard
-                // look for lock and wait if found
-                ACE_MT(ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileMutex, 0));
-                if (wait = m_tileCache->GetLockMap()[metaTilePathname])
-                {   // lock has been found
-                    std::wstringstream text;
-                    text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLock2(" << metaTilePathname << L")\n" ;
-                    ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-
-                    ACE_Time_Value finalTime = ACE_OS::gettimeofday() + ACE_Time_Value(METATILEWAIT);
-                    int out = wait->wait(); // ->wait(&finalTime);
-                    if (-1 == out) // wait forever
-                    {
-                        std::wstringstream text;
-                        text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockTimedOut2(" << metaTilePathname << L")\n" ;
-                        ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-
-                        MgStringCollection arguments;
-                        arguments.Add(metaTilePathname);
-                        throw new MgFileIoException(L"MgServerTileService.GetTile",
-                            __LINE__, __WFILE__, &arguments, L"MgWaitForLockTimedOut", NULL);
-                    } else {
-                        std::wstringstream text;
-                        text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockCAUGHTSIGNAL2(" << metaTilePathname << L")\n" ;
-                        ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-                    }
-                } // if found in map
-              } // END ace_guard context
-               break;
+                m_tileCache->LockTile(metaTilePathname);
+                break;
             case 2: // Bail out if the tile file has been locked for so long.
                 if (DetectTileLockFile(lockPathname, tilePathname))
                 {
@@ -538,37 +488,34 @@
 
             if (NULL != ret)
             {
+#ifdef _DEBUG
                 std::wstringstream text;
                 text << L"(" << ACE_OS::thr_self() << L") CACHEHIT2: GetTile(" << tileRow  << L", " <<  tileColumn << L") " << tilePathname << L"\n";
                 ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
         /////////////////////////////////// tile was in tileCache .. done.
                 break;  
             } else {
+#ifdef _DEBUG
                 std::wstringstream text;
                 text << L"(" << ACE_OS::thr_self() << L") CACHEMISS2: GetTile(" << tileRow  << L", " <<  tileColumn << L") " << tilePathname << L"\n";
                 ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
             }
     
             // ============================================================================ LOCKING
             switch(sm_lockMethod) 
             {
             case 3:
-                {   // Create the directory structure for each subtile!
-                    for (int y=0; y < maxY; y++)    // rows  
-                        for (int x=0; x < maxX; x++)    // columns
-                        {   
-                            m_tileCache->CreateFullPath(mapDefinition, scaleIndex, baseMapLayerGroupName, 
-                                metaTileColumn + x, metaTileRow + y);
-                        }
-                    // create ace condition for this tile as we are going to make it
-                    ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = new ACE_Condition<ACE_Recursive_Thread_Mutex>(sm_tileMutex);
-                    // keep reference to lock (ace condition) in map
-                    m_tileCache->GetLockMap()[metaTilePathname] = wait;  
-                    std::wstringstream text;
-                    text << L"(" << ACE_OS::thr_self() << L") METATILE: CreateLock(" << metaTilePathname << L"\n" ;
-                    ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-                } 
-               break;
+                // Create the directory structure for each subtile!
+                for (int y=0; y < maxY; y++)    // rows  
+                for (int x=0; x < maxX; x++)    // columns
+                {   
+                    m_tileCache->CreateFullPath(mapDefinition, scaleIndex, baseMapLayerGroupName, 
+                        metaTileColumn + x, metaTileRow + y);
+                }
+                m_tileCache->LockTile(metaTilePathname);
+                break;
             case 2: 
                 for (int y=0; y < maxY; y++)    // rows  
                 for (int x=0; x < maxX; x++)    // columns
@@ -617,10 +564,12 @@
                     else
                     {
                         ACE_OS::fclose(lockFile);
+#ifdef _DEBUG
                         std::wstringstream text;
                         text << L"(" << ACE_OS::thr_self() << L") METATILE: CreatedLockfile(" << metaTileRow << L", " <<  metaTileColumn<< L") " 
                              << metaTileLockPathname << L")\n";
                         ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
                     }
                 } // end meta tiling loop for lockfiles
 
@@ -631,11 +580,11 @@
 
         // Render the larger meta tile but do not cache it yet! (sm_useMetaTiles [prohibits caching in GetTile)
         STRING metaTileName = L"META" + metaTilePathname;
-        {
+#ifdef _DEBUG
             std::wstringstream text;
             text << L"(" << ACE_OS::thr_self() << L") METATILE: RenderMetaTile(" << metaTileRow << L", " <<   metaTileColumn << L") " << metaTileName << L"\n";
             ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-        }
+#endif
         Ptr<MgByteReader> metaTile = GetTile(metaTileName, map, scaleIndex, baseMapLayerGroupName, metaTileColumn, metaTileRow);
 
         // Get a ServerSide rendering Service only...
@@ -658,10 +607,12 @@
 
             if (img)
             {
+#ifdef _DEBUG
                 std::wstringstream text;
                 text << L"(" << ACE_OS::thr_self() << L") METATILE: SetTileFromMetaTile(" << tileRow  << L", " <<  tileColumn << L") " << subTilePathname[x][y]
                                             << L" S(" << x << L", " << y << L")\n";
                 ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
             }
             // rewind the reader since setting the tile advances it to the end
             if (img)
@@ -678,27 +629,7 @@
     switch(sm_lockMethod) // do the locking now
     {
     case 3:
-        try 
-        {   // synchronize access to map
-            ACE_MT(ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileMutex, 0));
-            ACE_Condition<ACE_Recursive_Thread_Mutex> *lock = m_tileCache->GetLockMap()[metaTilePathname];            
-            if (lock) 
-            {   
-                int result = lock->broadcast();    // notify waiters of finished tile
-                std::wstringstream text;
-                text << L"(" << ACE_OS::thr_self() << L") METATILE: Broadcast(" << metaTilePathname 
-                    << L") returns: " << result << L"\n";
-                ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-            }
-            m_tileCache->GetLockMap().erase(metaTilePathname); // erase: this destroys the ace condition
-        } 
-        catch (MgException* e) 
-        {
-                std::wstringstream text;
-                text << L"(" << ACE_OS::thr_self() << L") METATILE: Broadcastcrash (" << metaTilePathname 
-                    << L")\n" << e->GetExceptionMessage() << L")\n";
-                ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
-        }
+        m_tileCache->ClearLock(metaTilePathname);
         break;
     case 2:
         for (int y=0; y < maxY; y++)    // rows  
@@ -707,10 +638,12 @@
             {
                 MgFileUtil::DeleteFile(subTileLockPathname[x][y], false);
                 {
+#ifdef _DEBUG
                     std::wstringstream text;
                     text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedLockfile(" << metaTileRow + y  << L", " <<  metaTileColumn + x 
                         << L") S(" << x << L", " << y << subTileLockPathname[x][y] << L")\n";
                     ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
                 }
             }
         break;
@@ -720,10 +653,12 @@
         {
             MgFileUtil::DeleteFile(metaTileLockPathname, false);
             {
+#ifdef _DEBUG
                 std::wstringstream text;
                 text << L"(" << ACE_OS::thr_self() << L") METATILE: DeletedLockfile(" << metaTileRow   << L", " <<  metaTileColumn  << L") " 
                     << metaTileLockPathname << L"\n";
                 ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
             }
         }
     } // end switch
@@ -732,10 +667,12 @@
 
     if (!cacheHit) 
     {
+#ifdef _DEBUG
         std::wstringstream text;
         text << L"(" << ACE_OS::thr_self() << L") Rendered: GetTILE(" << tileRow  << L", " <<  tileColumn << L") " 
             << L" S(" << subTileX << L", " << subTileY << tilePathname << L")\n";
         ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
     }
 
     return ret.Detach();
@@ -961,7 +898,35 @@
     MG_THROW()
 }
 
+
 ///////////////////////////////////////////////////////////////////////////////
+// accessor method for resource service
+MgResourceService* MgServerTileService::GetResourceServiceForMapDef(MgResourceIdentifier* mapDefinition,
+                                                                    CREFSTRING funcName)
+{
+    // get service manager
+    MgServiceManager* serviceMan = MgServiceManager::GetInstance();
+    assert(NULL != serviceMan);
+
+    // Get the service from service manager
+    Ptr<MgResourceService> resourceService = dynamic_cast<MgResourceService*>(
+        serviceMan->RequestService(MgServiceType::ResourceService));
+    assert(NULL != resourceService);
+
+    if (!resourceService->HasPermission(mapDefinition, MgResourcePermission::ReadOnly))
+    {
+        MG_LOG_AUTHENTICATION_ENTRY(MgResources::PermissionDenied.c_str());
+
+        MgStringCollection arguments;
+        arguments.Add(mapDefinition->ToString());
+
+        throw new MgPermissionDeniedException(
+            funcName, __LINE__, __WFILE__, &arguments, L"", NULL);
+    }
+    return resourceService.Detach();
+}
+
+///////////////////////////////////////////////////////////////////////////////
 void MgServerTileService::ClearCache(MgMap* map)
 {
     MG_TRY()
@@ -1134,32 +1099,3 @@
     double scale = map->GetFiniteDisplayScaleAt(scaleIndex);
     map->SetViewScale(scale);
 }
-
-///////////////////////////////////////////////////////////////////////////////
-// accessor method for resource service
-MgResourceService* MgServerTileService::GetResourceServiceForMapDef(MgResourceIdentifier* mapDefinition,
-                                                                    CREFSTRING funcName)
-{
-    if (m_resourceService) return m_resourceService;
-    // get service manager
-    MgServiceManager* serviceMan = MgServiceManager::GetInstance();
-    assert(NULL != serviceMan);
-
-    // Get the service from service manager
-    Ptr<MgResourceService> resourceService = m_resourceService = dynamic_cast<MgResourceService*>(
-        serviceMan->RequestService(MgServiceType::ResourceService));
-    assert(NULL != resourceService);
-
-    if (!resourceService->HasPermission(mapDefinition, MgResourcePermission::ReadOnly))
-    {
-        MG_LOG_AUTHENTICATION_ENTRY(MgResources::PermissionDenied.c_str());
-
-        MgStringCollection arguments;
-        arguments.Add(mapDefinition->ToString());
-
-        throw new MgPermissionDeniedException(
-            funcName, __LINE__, __WFILE__, &arguments, L"", NULL);
-    }
-    return resourceService.Detach();
-}
-

Modified: sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -22,6 +22,7 @@
 #include "TileCache.h"
 
 #define METATILES
+// used to define arrays on stack .... too much dependencies to move this into system config
 #define METAMAXDIM 8
 /// forward decl
 class MgServerRenderingService; 
@@ -65,7 +66,7 @@
         bool strict = true);
 
     void SetConnectionProperties(MgConnectionProperties* connProp);
-    static ACE_Recursive_Thread_Mutex sm_tileMutex;
+
     static INT32 sm_lockMethod;
     static INT32 sm_useMetaTiles;
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Tile/ServerTileService.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -28,10 +28,9 @@
 MgServerTileService* MgTileCache::sm_tileService = 0;
 INT32 MgTileCache::sm_tileColumnsPerFolder = 30;
 INT32 MgTileCache::sm_tileRowsPerFolder = 30;
+ACE_Recursive_Thread_Mutex MgTileCache::sm_tileMutex;
 std::map<STRING,ACE_Condition<ACE_Recursive_Thread_Mutex>*> MgTileCache::sm_lockMap;
-
-std::map<STRING,ACE_Condition<ACE_Recursive_Thread_Mutex>*>& MgTileCache::GetLockMap() { return sm_lockMap; }
-
+////////////////////////////////////////////////////////////////////////////////
 // default constructor
 MgTileCache::MgTileCache(MgServerTileService* tileService)
 {
@@ -147,7 +146,7 @@
     GeneratePathnames(mapDef, scaleIndex, group, tileColumn, tileRow,
         tilePathname, lockPathname, createFullPath);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 #define METATILEWAIT 300
 // returns any cached tile for the given pathname
 MgByteReader* MgTileCache::Get(CREFSTRING tilePathname)
@@ -155,23 +154,7 @@
     Ptr<MgByteReader> ret;
 
     MG_TRY()
-        /// uses wrong filename for metatiling
-    //ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = 0;
-    //// look for lock and wait if found
-    //if (sm_tileService->sm_lockMethod==3 && sm_tileService->sm_useMetaTiles)
-    //{   // protect test of lockmap entry with a guard
-    //    ACE_MT(ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileService->sm_mutex, 0));
-    //    if (wait = GetLockMap()[tilePathname])
-    //    {
-    //        std::wstringstream text;
-    //        text << L"METATILE: WaitForLock(" << tilePathname << L")\n" ;
-    //        ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
 
-    //        ACE_Time_Value waitTime(METATILEWAIT);
-    //        wait->wait(&waitTime);      // TODO is this a recursive deadlock?
-    //    }
-    //}
-
     // now check for tile
     if (MgFileUtil::PathnameExists(tilePathname))
     {
@@ -204,7 +187,7 @@
 
     return ret.Detach();
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // caches a tile for the given pathname
 void MgTileCache::Set(MgByteReader* img, CREFSTRING tilePathname)
 {
@@ -220,7 +203,7 @@
 
     }
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // clears the tile cache for the given map
 void MgTileCache::Clear(MgMap* map)
 {
@@ -233,7 +216,7 @@
             MgFileUtil::DeleteDirectory(basePath, true, false);
     }
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // clears the tile cache for the given map
 void MgTileCache::Clear(MgResourceIdentifier* mapDef)
 {
@@ -247,7 +230,7 @@
             MgFileUtil::DeleteDirectory(basePath, true, false);
     }
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // gets the base path to use with the tile cache for the given map definition resource
 STRING MgTileCache::GetBasePath(MgResourceIdentifier* mapDef)
 {
@@ -296,7 +279,7 @@
 
     return basePath;
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // gets the base path to use with the tile cache for the given map
 STRING MgTileCache::GetBasePath(MgMap* map)
 {
@@ -304,7 +287,7 @@
     Ptr<MgResourceIdentifier> mapDef = map->GetMapDefinition();
     return GetBasePath(mapDef);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // gets the full path to use with the tile cache for the given base path / scale index / group
 STRING MgTileCache::GetFullPath(CREFSTRING basePath, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
@@ -327,13 +310,13 @@
 
     return fullPath;
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // gets the full path to use with the tile cache for the given map definition / scale index / group
 STRING MgTileCache::GetFullPath(MgResourceIdentifier* mapDef, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
     return GetFullPath(GetBasePath(mapDef), scaleIndex, group, tileColumn, tileRow);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // gets the full path to use with the tile cache for the given map / scale index / group
 STRING MgTileCache::GetFullPath(MgMap* map, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
@@ -341,7 +324,7 @@
     Ptr<MgResourceIdentifier> mapDef = map->GetMapDefinition();
     return GetFullPath(mapDef, scaleIndex, group, tileColumn, tileRow);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 STRING MgTileCache::CreateFullPath(CREFSTRING basePath, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
     assert(!basePath.empty());
@@ -372,17 +355,17 @@
 
     return fullPath;
 }
-
+////////////////////////////////////////////////////////////////////////////////
 STRING MgTileCache::CreateFullPath(MgResourceIdentifier* mapDef, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
     return CreateFullPath(GetBasePath(mapDef), scaleIndex, group, tileColumn, tileRow);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 STRING MgTileCache::CreateFullPath(MgMap* map, int scaleIndex, CREFSTRING group, int tileColumn, int tileRow)
 {
     return CreateFullPath(GetBasePath(map), scaleIndex, group, tileColumn, tileRow);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // Get the folder name corresponding to the specified scale index
 STRING MgTileCache::GetScaleIndexFolder(int scaleIndex)
 {
@@ -390,19 +373,19 @@
     MgUtil::Int32ToString(scaleIndex, scaleIndexString);
     return SCALE_INDEX_PREFIX + scaleIndexString;
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // Get the folder name corresponding to the specified tile row
 STRING MgTileCache::GetRowFolder(int tileRow)
 {
     return GetFolder(ROW_PREFIX, tileRow, sm_tileRowsPerFolder);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // Get the folder name corresponding to the specified tile column
 STRING MgTileCache::GetColumnFolder(int tileColumn)
 {
     return GetFolder(COLUMN_PREFIX, tileColumn, sm_tileColumnsPerFolder);
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // Get the parent folder for a given row or column
 STRING MgTileCache::GetFolder(STRING prefix, int tileIndex, int tilesPerFolder)
 {
@@ -421,7 +404,7 @@
     }
     return prefix + folder;
 }
-
+////////////////////////////////////////////////////////////////////////////////
 // Get the filename corresponding to the specified row and column.
 // No file extension is added.
 STRING MgTileCache::GetTileName(int tileRow, int tileColumn)
@@ -430,6 +413,7 @@
         GetTileIndexString(tileColumn, sm_tileColumnsPerFolder);
 }
 
+////////////////////////////////////////////////////////////////////////////////
 // When a tile is stored in a folder, the index value of the parent folder
 // is subtracted from the overall tile index.
 // e.g. If we store 30 rows of tiles per folder, a tile with overall row
@@ -454,4 +438,87 @@
     return name;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+// wait for a previous ace condition 
+void MgTileCache::WaitForLock(CREFSTRING tilePathname)
+{   // protect test of lockmap entry with a guard
+    ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = 0;
+    // look for lock and wait if found
+    ACE_MT(ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileMutex));
+    if (wait = sm_lockMap[tilePathname])
+    {   // lock has been found
+#ifdef _DEBUG
+        std::wstringstream text;
+        text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLock1(" 
+            << tilePathname << L")\n" ;
+        ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+        //                ACE_Time_Value waitTime(METATILEWAIT);
+        if (-1 == wait->wait()) // wait forever
+        {
+#ifdef _DEBUG
+            std::wstringstream text;
+            text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockTimedOut1(" 
+                << tilePathname << L")\n" ;
+            ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+            MgStringCollection arguments;
+            arguments.Add(tilePathname);
+            throw new MgFileIoException(L"MgServerTileService.GetTile",
+                __LINE__, __WFILE__, &arguments, L"MgWaitForLockTimedOut", NULL);
+        } else {
+#ifdef _DEBUG
+            std::wstringstream text;
+            text << L"(" << ACE_OS::thr_self() << L") METATILE: WaitForLockCAUGHTSIGNAL1(" 
+                << tilePathname << L")\n" ;
+            ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+        }
+    }        
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// locktile by creating ace condition 
+void MgTileCache::LockTile(CREFSTRING tilePathname)
+{
+    // create ace condition for this tile as we are going to make it
+    ACE_Condition<ACE_Recursive_Thread_Mutex> *wait = new ACE_Condition<ACE_Recursive_Thread_Mutex>(sm_tileMutex);
+    // keep reference to lock (ace condition) in our map
+    sm_lockMap[tilePathname] = wait;
 
+#ifdef _DEBUG
+    std::wstringstream text;
+    text << L"(" << ACE_OS::thr_self() << L") METATILE: CreateLock(" << tilePathname << L"\n" ;
+    ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+} 
+////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// clear the ace condition
+void MgTileCache::ClearLock(CREFSTRING tilePathname)
+{
+    try 
+    {   // synchronize access to map
+        ACE_MT(ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, sm_tileMutex));
+        ACE_Condition<ACE_Recursive_Thread_Mutex> *lock = sm_lockMap[tilePathname];  
+        if (lock) 
+        {   
+            int result = lock->broadcast();    // notify waiters of finished tile
+#ifdef _DEBUG
+            std::wstringstream text;
+            text << L"(" << ACE_OS::thr_self() << L") METATILE: Broadcast(" << tilePathname 
+                << L") returns: " << result << L"\n";
+            ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+        }
+        sm_lockMap.erase(tilePathname); // erase: this destroys the ace condition
+    } 
+    catch (MgException* e) 
+    {
+#ifdef _DEBUG
+        std::wstringstream text;
+        text << L"(" << ACE_OS::thr_self() << L") METATILE: Broadcastcrash (" << tilePathname 
+            << L")\n" << e->GetExceptionMessage() << L")\n";
+        ACE_DEBUG ((LM_DEBUG, text.str().c_str()));
+#endif
+        throw e;
+    }
+}
\ No newline at end of file

Modified: sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Services/Tile/TileCache.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -46,9 +46,11 @@
     void Clear(MgMap* map);
     void Clear(MgResourceIdentifier* mapDef);
 
-    static std::map<STRING,ACE_Condition<ACE_Recursive_Thread_Mutex>*> &GetLockMap();
+    static ACE_Recursive_Thread_Mutex sm_tileMutex;
+    void WaitForLock(CREFSTRING tilePathname);
+    void ClearLock(CREFSTRING tilePathname);
+    void LockTile(CREFSTRING tilePathname);
 
-
 protected:
     virtual void Dispose()
     {

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/Makefile.am
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/Makefile.am	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/Makefile.am	2010-11-13 18:07:46 UTC (rev 5389)
@@ -7,7 +7,7 @@
 INCLUDES = \
   -I../../../Oem/ACE/ACE_wrappers \
   -I../../../Oem/CppUnit-1.9.14/include \
-  -I../../../Oem/dbxml-2.3.10/xerces-c-src/src \
+  -I../../../Oem/dbxml/xerces-c-src/src \
   -I../../../Common/Foundation \
   -I../../../Common/Geometry \
   -I../../../Common/PlatformBase \

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestCoordinateSystem.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -5876,17 +5876,13 @@
                             else
                             {
                                 // Failed Round trip
-                                #ifdef _DEBUG
-                                printf("%d != %d - Failed!\n", code, epsg);
-                                #endif
+                                printf("%6d - Round trip Failed! Round trip code = %d\n", code, epsg);
                             }
                         }
                         else
                         {
                             // Failed
-                            #ifdef _DEBUG
-                            printf("%d - Failed!\n", code);
-                            #endif
+                            printf("%6d - EPSG to WKT Failed!\n", code);
                         }
                     }
                     catch(MgException* e)

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestKmlService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -49,7 +49,7 @@
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
@@ -57,7 +57,7 @@
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     m_siteConnection = new MgSiteConnection();
@@ -416,7 +416,7 @@
     STRING newContent = content;
 
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
     {
         sessionId = userInfo->GetMgSessionId();

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMappingService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMappingService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMappingService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -51,7 +51,7 @@
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
@@ -59,7 +59,7 @@
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     m_siteConnection = new MgSiteConnection();

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMdfModel.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMdfModel.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestMdfModel.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -77,6 +77,11 @@
         Ptr<MgByteSource> ldfsrc3 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles.ldf", false);
         Ptr<MgByteReader> ldfrdr3 = ldfsrc3->GetReader();
         m_svcResource->SetResource(ldfres3, ldfrdr3, NULL);
+
+        Ptr<MgResourceIdentifier> mdfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestMap.MapDefinition");
+        Ptr<MgByteSource> mdfsrc4 = new MgByteSource(L"../UnitTestFiles/MdfTestMap.mdf", false);
+        Ptr<MgByteReader> mdfrdr4 = mdfsrc4->GetReader();
+        m_svcResource->SetResource(mdfres4, mdfrdr4, NULL);
     }
     catch (MgException* e)
     {
@@ -107,6 +112,8 @@
         m_svcResource->DeleteResource(sdres2);
         Ptr<MgResourceIdentifier> ldfres3 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestTypeStyles.LayerDefinition");
         m_svcResource->DeleteResource(ldfres3);
+        Ptr<MgResourceIdentifier> mdfres4 = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestMap.MapDefinition");
+        m_svcResource->DeleteResource(mdfres4);
     }
     catch(MgFileIoException* e)
     {
@@ -138,6 +145,7 @@
 
         Ptr<MgResourceIdentifier> sdresV = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDummy.SymbolDefinition");
         Ptr<MgResourceIdentifier> ldfresV = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDummy.LayerDefinition");
+        Ptr<MgResourceIdentifier> mdfresV = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestDummy.MapDefinition");
 
         // ------------------------------------------------------
         // process symbol #1 - a simple symbol definition
@@ -256,9 +264,32 @@
         // ------------------------------------------------------
 
         // iterate over the layer definition schema versions
-        for (int minorVersion=3; minorVersion>=0; --minorVersion)
+        const int LAYER_SCHEMA_COUNT = 4 + 1;      //4 for 1.x.x and 1 for 2.x.x
+        std::vector<Version> layerVersions(LAYER_SCHEMA_COUNT);
+        //layer 1.0.0 - MapGuide 2007
+        layerVersions[0].SetMajor(1);
+        layerVersions[0].SetMinor(0);
+        layerVersions[0].SetRevision(0);
+        //layer 1.1.0 - MapGuide 2008
+        layerVersions[1].SetMajor(1);
+        layerVersions[1].SetMinor(1);
+        layerVersions[1].SetRevision(0);
+        //layer 1.2.0 - MapGuide 2009
+        layerVersions[2].SetMajor(1);
+        layerVersions[2].SetMinor(2);
+        layerVersions[2].SetRevision(0);
+        //layer 1.3.0 - MapGuide 2010
+        layerVersions[3].SetMajor(1);
+        layerVersions[3].SetMinor(3);
+        layerVersions[3].SetRevision(0);
+        //layer 2.3.0 - MapGuide 2012
+        layerVersions[4].SetMajor(2);
+        layerVersions[4].SetMinor(3);
+        layerVersions[4].SetRevision(0);
+
+        for (vector<Version>::size_type layerVersionIndex = 0; layerVersionIndex != layerVersions.size(); ++layerVersionIndex)
         {
-            Version layerDefVersion(1, minorVersion, 0);
+            Version &layerDefVersion = layerVersions[layerVersionIndex];
 
             Ptr<MgResourceIdentifier> ldfres = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestTypeStyles.LayerDefinition");
 
@@ -307,6 +338,75 @@
         // delete the files
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_Copy1.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_Copy2.ldf", true);
+
+        
+        // ------------------------------------------------------
+        // process map definition with type styles
+        // ------------------------------------------------------
+
+        // iterate over the map definition schema versions
+        const int MAP_SCHEMA_COUNT = 1 + 1;      //1 for 1.x.x and 1 for 2.x.x
+        std::vector<Version> mapVersions(MAP_SCHEMA_COUNT);
+        //map 1.0.0 - MapGuide before 2012
+        mapVersions[0].SetMajor(1);
+        mapVersions[0].SetMinor(0);
+        mapVersions[0].SetRevision(0);
+        //map 2.3.0 - MapGuide 2012
+        mapVersions[1].SetMajor(2);
+        mapVersions[1].SetMinor(3);
+        mapVersions[1].SetRevision(0);
+
+        for (vector<Version>::size_type mapVersionIndex = 0; mapVersionIndex != mapVersions.size(); ++mapVersionIndex)
+        {
+            Version &mapDefVersion = mapVersions[mapVersionIndex];
+
+            Ptr<MgResourceIdentifier> mdfres = new MgResourceIdentifier(L"Library://UnitTests/MdfModel/MdfTestMap.MapDefinition");
+
+            // parse the MDF - this exercises MdfParser deserialization
+            Ptr<MgByteReader> rdr = m_svcResource->GetResourceContent(mdfres);
+            Ptr<MgByteSink> sink = new MgByteSink(rdr);
+            Ptr<MgByte> bytes = sink->ToBuffer();
+            CPPUNIT_ASSERT(bytes->GetLength() > 0);
+
+            parser.ParseString((const char*)bytes->Bytes(), bytes->GetLength());
+            CPPUNIT_ASSERT(parser.GetSucceeded());
+
+            // write the file - this exercises MdfParser serialization
+            auto_ptr<MapDefinition> mapDef1(parser.DetachMapDefinition());
+            CPPUNIT_ASSERT(mapDef1.get() != NULL);
+
+            parser.WriteToFile("../UnitTestFiles/MdfTestMap_Copy1.mdf", mapDef1.get(), NULL, NULL, NULL, NULL, NULL, &mapDefVersion);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestMap_Copy1.mdf"));
+
+            // parse and resave the newly written file
+            Ptr<MgByteSource> src1 = new MgByteSource(L"../UnitTestFiles/MdfTestMap_Copy1.mdf");
+            Ptr<MgByteReader> rdr1 = src1->GetReader();
+            Ptr<MgByteSink> sink1 = new MgByteSink(rdr1);
+            Ptr<MgByte> bytes1 = sink1->ToBuffer();
+            parser.ParseString((const char*)bytes1->Bytes(), bytes1->GetLength());
+            auto_ptr<MapDefinition> mapDef2(parser.DetachMapDefinition());
+            CPPUNIT_ASSERT(mapDef2.get() != NULL);
+
+            parser.WriteToFile("../UnitTestFiles/MdfTestMap_Copy2.mdf", mapDef2.get(), NULL, NULL, NULL, NULL, NULL, &mapDefVersion);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestMap_Copy2.mdf"));
+
+            // compare the two files
+            Ptr<MgByteSource> src2 = new MgByteSource(L"../UnitTestFiles/MdfTestMap_Copy2.mdf");
+            Ptr<MgByteReader> rdr2 = src2->GetReader();
+            Ptr<MgByteSink> sink2 = new MgByteSink(rdr2);
+            Ptr<MgByte> bytes2 = sink2->ToBuffer();
+
+            CPPUNIT_ASSERT(bytes1->GetLength() == bytes2->GetLength());
+            CPPUNIT_ASSERT(memcmp(bytes1->Bytes(), bytes2->Bytes(), bytes1->GetLength()) == 0);
+
+            // save the new resource to the repository to validate the XML
+            m_svcResource->SetResource(mdfresV, rdr1, NULL);
+            m_svcResource->DeleteResource(mdfresV);
+        }
+
+        // delete the files
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestMap_Copy1.mdf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestMap_Copy2.mdf", true);
     }
     catch (MgException* e)
     {
@@ -326,6 +426,7 @@
         Version layerDefVersion11(1, 1, 0); // MapGuide 2008
         Version layerDefVersion12(1, 2, 0); // MapGuide 2009
         Version layerDefVersion13(1, 3, 0); // MapGuide 2010
+        Version layerDefVersion23(2, 3, 0); // MapGuide 2012
         Version symbolDefVersion10(1, 0, 0); // MapGuide 2008
         Version symbolDefVersion11(1, 1, 0); // MapGuide 2009
         MdfParser::SAX2Parser parser;
@@ -475,6 +576,9 @@
             parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy1.ldf", NULL, layerDef1.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
             CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy1.ldf"));
 
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy1.ldf", NULL, layerDef1.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy1.ldf"));
+
             // parse and resave the newly written files
             Ptr<MgByteSource> src1_09 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v09_Copy1.ldf");
             Ptr<MgByteReader> rdr1_09 = src1_09->GetReader();
@@ -531,6 +635,17 @@
             parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy2.ldf", NULL, layerDef2_13.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
             CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy2.ldf"));
 
+            Ptr<MgByteSource> src1_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy1.ldf");
+            Ptr<MgByteReader> rdr1_23 = src1_23->GetReader();
+            Ptr<MgByteSink> sink1_23 = new MgByteSink(rdr1_23);
+            Ptr<MgByte> bytes1_23 = sink1_23->ToBuffer();
+            parser.ParseString((const char*)bytes1_23->Bytes(), bytes1_23->GetLength());
+            auto_ptr<VectorLayerDefinition> layerDef2_23(parser.DetachVectorLayerDefinition());
+            CPPUNIT_ASSERT(layerDef2_23.get() != NULL);
+
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy2.ldf", NULL, layerDef2_23.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy2.ldf"));
+
             // compare the files
             Ptr<MgByteSource> src2_09 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v09_Copy2.ldf");
             Ptr<MgByteReader> rdr2_09 = src2_09->GetReader();
@@ -567,52 +682,70 @@
             CPPUNIT_ASSERT(bytes1_13->GetLength() == bytes2_13->GetLength());
             CPPUNIT_ASSERT(memcmp(bytes1_13->Bytes(), bytes2_13->Bytes(), bytes1_13->GetLength()) == 0);
 
+            Ptr<MgByteSource> src2_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy2.ldf");
+            Ptr<MgByteReader> rdr2_23 = src2_23->GetReader();
+            Ptr<MgByteSink> sink2_23 = new MgByteSink(rdr2_23);
+            Ptr<MgByte> bytes2_23 = sink2_23->ToBuffer();
+            CPPUNIT_ASSERT(bytes1_23->GetLength() == bytes2_23->GetLength());
+            CPPUNIT_ASSERT(memcmp(bytes1_23->Bytes(), bytes2_23->Bytes(), bytes1_23->GetLength()) == 0);
+
             // verify extended data support is working...
             //   - layerDef2_10 was loaded from XML containing extended data
             //   - layerDef2_11 was loaded from XML containing extended data
             //   - layerDef2_12 was loaded from XML containing no extended data
             //   - layerDef2_13 was loaded from XML containing no extended data
+            //   - layerDef2_23 was loaded from XML containing no extended data
             // the data in these object models should be the same
 
-            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy3a.ldf", NULL, layerDef2_10.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
-            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3a.ldf"));
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy3a.ldf", NULL, layerDef2_10.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3a.ldf"));
 
-            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy3b.ldf", NULL, layerDef2_11.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
-            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3b.ldf"));
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy3b.ldf", NULL, layerDef2_11.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3b.ldf"));
 
-            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy3c.ldf", NULL, layerDef2_12.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
-            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3c.ldf"));
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy3c.ldf", NULL, layerDef2_12.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3c.ldf"));
 
-            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v13_Copy3d.ldf", NULL, layerDef2_13.get(), NULL, NULL, NULL, NULL, &layerDefVersion13);
-            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3d.ldf"));
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy3d.ldf", NULL, layerDef2_13.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3d.ldf"));
 
-            Ptr<MgByteSource> src3a_13 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3a.ldf");
-            Ptr<MgByteReader> rdr3a_13 = src3a_13->GetReader();
-            Ptr<MgByteSink> sink3a_13 = new MgByteSink(rdr3a_13);
-            Ptr<MgByte> bytes3a_13 = sink3a_13->ToBuffer();
+            parser.WriteToFile("../UnitTestFiles/MdfTestTypeStyles_v23_Copy3e.ldf", NULL, layerDef2_23.get(), NULL, NULL, NULL, NULL, &layerDefVersion23);
+            CPPUNIT_ASSERT(MgFileUtil::IsFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3e.ldf"));
 
-            Ptr<MgByteSource> src3b_13 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3b.ldf");
-            Ptr<MgByteReader> rdr3b_13 = src3b_13->GetReader();
-            Ptr<MgByteSink> sink3b_13 = new MgByteSink(rdr3b_13);
-            Ptr<MgByte> bytes3b_13 = sink3b_13->ToBuffer();
+            Ptr<MgByteSource> src3a_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3a.ldf");
+            Ptr<MgByteReader> rdr3a_23 = src3a_23->GetReader();
+            Ptr<MgByteSink> sink3a_23 = new MgByteSink(rdr3a_23);
+            Ptr<MgByte> bytes3a_23 = sink3a_23->ToBuffer();
 
-            Ptr<MgByteSource> src3c_13 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3c.ldf");
-            Ptr<MgByteReader> rdr3c_13 = src3c_13->GetReader();
-            Ptr<MgByteSink> sink3c_13 = new MgByteSink(rdr3c_13);
-            Ptr<MgByte> bytes3c_13 = sink3c_13->ToBuffer();
+            Ptr<MgByteSource> src3b_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3b.ldf");
+            Ptr<MgByteReader> rdr3b_23 = src3b_23->GetReader();
+            Ptr<MgByteSink> sink3b_23 = new MgByteSink(rdr3b_23);
+            Ptr<MgByte> bytes3b_23 = sink3b_23->ToBuffer();
 
-            Ptr<MgByteSource> src3d_13 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3d.ldf");
-            Ptr<MgByteReader> rdr3d_13 = src3d_13->GetReader();
-            Ptr<MgByteSink> sink3d_13 = new MgByteSink(rdr3d_13);
-            Ptr<MgByte> bytes3d_13 = sink3d_13->ToBuffer();
+            Ptr<MgByteSource> src3c_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3c.ldf");
+            Ptr<MgByteReader> rdr3c_23 = src3c_23->GetReader();
+            Ptr<MgByteSink> sink3c_23 = new MgByteSink(rdr3c_23);
+            Ptr<MgByte> bytes3c_23 = sink3c_23->ToBuffer();
 
-            CPPUNIT_ASSERT(bytes3a_13->GetLength() == bytes3b_13->GetLength());
-            CPPUNIT_ASSERT(bytes3b_13->GetLength() == bytes3c_13->GetLength());
-            CPPUNIT_ASSERT(bytes3c_13->GetLength() == bytes3d_13->GetLength());
-            CPPUNIT_ASSERT(memcmp(bytes3a_13->Bytes(), bytes3b_13->Bytes(), bytes3a_13->GetLength()) == 0);
-            CPPUNIT_ASSERT(memcmp(bytes3b_13->Bytes(), bytes3c_13->Bytes(), bytes3b_13->GetLength()) == 0);
-            CPPUNIT_ASSERT(memcmp(bytes3c_13->Bytes(), bytes3d_13->Bytes(), bytes3c_13->GetLength()) == 0);
+            Ptr<MgByteSource> src3d_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3d.ldf");
+            Ptr<MgByteReader> rdr3d_23 = src3d_23->GetReader();
+            Ptr<MgByteSink> sink3d_23 = new MgByteSink(rdr3d_23);
+            Ptr<MgByte> bytes3d_23 = sink3d_23->ToBuffer();
 
+            Ptr<MgByteSource> src3e_23 = new MgByteSource(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3e.ldf");
+            Ptr<MgByteReader> rdr3e_23 = src3e_23->GetReader();
+            Ptr<MgByteSink> sink3e_23 = new MgByteSink(rdr3e_23);
+            Ptr<MgByte> bytes3e_23 = sink3e_23->ToBuffer();
+
+            CPPUNIT_ASSERT(bytes3a_23->GetLength() == bytes3b_23->GetLength());
+            CPPUNIT_ASSERT(bytes3b_23->GetLength() == bytes3c_23->GetLength());
+            CPPUNIT_ASSERT(bytes3c_23->GetLength() == bytes3d_23->GetLength());
+            CPPUNIT_ASSERT(bytes3d_23->GetLength() == bytes3e_23->GetLength());
+            CPPUNIT_ASSERT(memcmp(bytes3a_23->Bytes(), bytes3b_23->Bytes(), bytes3a_23->GetLength()) == 0);
+            CPPUNIT_ASSERT(memcmp(bytes3b_23->Bytes(), bytes3c_23->Bytes(), bytes3b_23->GetLength()) == 0);
+            CPPUNIT_ASSERT(memcmp(bytes3c_23->Bytes(), bytes3d_23->Bytes(), bytes3c_23->GetLength()) == 0);
+            CPPUNIT_ASSERT(memcmp(bytes3d_23->Bytes(), bytes3e_23->Bytes(), bytes3d_23->GetLength()) == 0);
+
             // save the new resources to the repository to validate the XML
             m_svcResource->SetResource(ldfresV, rdr1_09, NULL);
             m_svcResource->DeleteResource(ldfresV);
@@ -624,8 +757,10 @@
             m_svcResource->DeleteResource(ldfresV);
             m_svcResource->SetResource(ldfresV, rdr1_13, NULL);
             m_svcResource->DeleteResource(ldfresV);
-            m_svcResource->SetResource(ldfresV, rdr3a_13, NULL);
+            m_svcResource->SetResource(ldfresV, rdr1_23, NULL);
             m_svcResource->DeleteResource(ldfresV);
+            m_svcResource->SetResource(ldfresV, rdr3a_23, NULL);
+            m_svcResource->DeleteResource(ldfresV);
         }
 
         // delete the files
@@ -634,17 +769,24 @@
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v11_Copy1.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v12_Copy1.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy1.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy1.ldf", true);
 
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v09_Copy2.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v10_Copy2.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v11_Copy2.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v12_Copy2.ldf", true);
         MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy2.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy2.ldf", true);
 
-        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3a.ldf", true);
-        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3b.ldf", true);
-        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3c.ldf", true);
-        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v13_Copy3d.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3a.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3b.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3c.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3d.ldf", true);
+        MgFileUtil::DeleteFile(L"../UnitTestFiles/MdfTestTypeStyles_v23_Copy3e.ldf", true);
+
+        // As MapDefinition 1.0.0 doesn't take extension into consideration, if a MDF 2.3 is
+        // stored into 1.0.0, there will be some information missing. So no test code about
+        // version.
     }
     catch (MgException* e)
     {

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -51,7 +51,7 @@
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
@@ -59,7 +59,7 @@
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     m_siteConnection = new MgSiteConnection();
@@ -312,6 +312,19 @@
         Ptr<MgByteReader> sdrdr5 = sdsrc5->GetReader();
         m_svcResource->SetResource(sdres5, sdrdr5, NULL);
 
+        // For watermark test
+        // publish the map definition
+        Ptr<MgResourceIdentifier> mapres12 = new MgResourceIdentifier(L"Library://UnitTests/Maps/SheboyganWithWatermark.MapDefinition");
+        Ptr<MgByteSource> mdfsrc12 = new MgByteSource(L"../UnitTestFiles/UT_SheboyganWithWatermark.mdf", false);
+        Ptr<MgByteReader> mdfrdr12 = mdfsrc12->GetReader();
+        m_svcResource->SetResource(mapres12, mdfrdr12, NULL);
+
+        // publish the watermark definition
+        Ptr<MgResourceIdentifier> wdfres1 = new MgResourceIdentifier(L"Library://UnitTests/Watermarks/PoweredByMapGuide.WatermarkDefinition");
+        Ptr<MgByteSource> wdfsrc1 = new MgByteSource(L"../UnitTestFiles/UT_PoweredByMapGuide.wdf", false);
+        Ptr<MgByteReader> wdfrdr1 = wdfsrc1->GetReader();
+        m_svcResource->SetResource(wdfres1, wdfrdr1, NULL);
+
     }
     catch (MgException* e)
     {
@@ -420,6 +433,11 @@
         m_svcResource->DeleteResource(ldfres11);
         Ptr<MgResourceIdentifier> sdres5 = new MgResourceIdentifier(L"Library://UnitTests/Symbols/AreaSymbol.SymbolDefinition");
         m_svcResource->DeleteResource(sdres5);
+        
+        Ptr<MgResourceIdentifier> mapres12 = new MgResourceIdentifier(L"Library://UnitTests/Maps/SheboyganWithWatermark.MapDefinition");
+        m_svcResource->DeleteResource(mapres12);
+        Ptr<MgResourceIdentifier> wdfres1 = new MgResourceIdentifier(L"Library://UnitTests/Watermarks/PoweredByMapGuide.WatermarkDefinition");
+        m_svcResource->DeleteResource(wdfres1);
 
        #ifdef _DEBUG
         MgFdoConnectionManager* pFdoConnectionManager = MgFdoConnectionManager::GetInstance();
@@ -521,7 +539,35 @@
     }
 }
 
+void TestRenderingService::TestCase_RenderMapWithWatermark()
+{
+    try
+    {
+        // make a runtime map
+        Ptr<MgMap> map = CreateTestMapWithWatermark();
 
+        // call the API using scales of 75000 and 12000
+        map->SetViewScale(75000.0);
+        Ptr<MgByteReader> rdr1 = m_svcRendering->RenderMap(map, NULL, L"PNG");
+        rdr1->ToFile(L"../UnitTestFiles/RenderMapWithWatermark75k.png");
+
+        map->SetViewScale(12000.0);
+        Ptr<MgByteReader> rdr2 = m_svcRendering->RenderMap(map, NULL, L"PNG");
+        rdr2->ToFile(L"../UnitTestFiles/RenderMapWithWatermark12k.png");
+    }
+    catch (MgException* e)
+    {
+        STRING message = e->GetDetails(TEST_LOCALE);
+        SAFE_RELEASE(e);
+        CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+    }
+    catch (...)
+    {
+        throw;
+    }
+}
+
+
 void TestRenderingService::TestCase_RenderLegend()
 {
     try
@@ -539,6 +585,40 @@
         map->SetViewScale(12000.0);
         Ptr<MgByteReader> rdr2 = m_svcRendering->RenderMapLegend(map, 200, 400, bgc, L"PNG");
         rdr2->ToFile(L"../UnitTestFiles/RenderLegend12k.png");
+
+        // add a layer group
+        Ptr<MgLayerGroupCollection> layerGroups = map->GetLayerGroups();
+        Ptr<MgLayerCollection> layers = map->GetLayers();
+
+        Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(L"Library://UnitTests/Layers/Parcels.LayerDefinition");
+
+        Ptr<MgLayerGroup> group = new MgLayerGroup(L"Can't see me");
+        group->SetLegendLabel(L"Can't see me");
+        group->SetDisplayInLegend(true);
+        layerGroups->Add(group);
+
+        Ptr<MgLayer> layer = new MgLayer(resId, m_svcResource);
+        layer->SetName(L"MyParcels");
+        layer->SetLegendLabel(L"Parcels");
+        layer->SetGroup(group);
+        layer->SetDisplayInLegend(true);
+
+        layers->Add(layer);
+
+        //Re-draw at 75k. Layer group should not be there because it has no visible layers
+        map->SetViewScale(75000.0);
+        Ptr<MgByteReader> rdr3 = m_svcRendering->RenderMapLegend(map, 200, 400, bgc, L"PNG");
+        rdr3->ToFile(L"../UnitTestFiles/RenderLegend75kWithEmptyLayerGroup.png");
+
+        //Re-draw at 14000. Layer group should still not be there because it has no visible layers
+        map->SetViewScale(14000.0);
+        Ptr<MgByteReader> rdr4 = m_svcRendering->RenderMapLegend(map, 200, 400, bgc, L"PNG");
+        rdr4->ToFile(L"../UnitTestFiles/RenderLegend14kWithEmptyLayerGroup.png");
+
+        //Re-draw at 12000. Layer group should now be there because its child layer (Parcels) should be visible
+        map->SetViewScale(12000.0);
+        Ptr<MgByteReader> rdr5 = m_svcRendering->RenderMapLegend(map, 200, 400, bgc, L"PNG");
+        rdr5->ToFile(L"../UnitTestFiles/RenderLegend12kWithLayerGroup.png");
     }
     catch (MgException* e)
     {
@@ -590,7 +670,23 @@
     }
 }
 
+MgMap* TestRenderingService::CreateTestMapWithWatermark()
+{
+    Ptr<MgResourceIdentifier> mdfres = new MgResourceIdentifier(L"Library://UnitTests/Maps/SheboyganWithWatermark.MapDefinition");
+    MgMap* map = new MgMap(m_siteConnection);
+    map->Create(mdfres, L"UnitTestSheboyganWithWatermark");
 
+    Ptr<MgCoordinate> coordNewCenter = new MgCoordinateXY(-87.733253, 43.746199);
+    Ptr<MgPoint> ptNewCenter = new MgPoint(coordNewCenter);
+    map->SetViewCenter(ptNewCenter);
+    map->SetViewScale(75000.0);
+    map->SetDisplayDpi(96);
+    map->SetDisplayWidth(1024);
+    map->SetDisplayHeight(1024);
+
+    return map;
+}
+
 MgMap* TestRenderingService::CreateTestMap()
 {
     Ptr<MgResourceIdentifier> mdfres = new MgResourceIdentifier(L"Library://UnitTests/Maps/Sheboygan.MapDefinition");

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestRenderingService.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -37,6 +37,7 @@
 
     CPPUNIT_TEST(TestCase_RenderDynamicOverlay);
     CPPUNIT_TEST(TestCase_RenderMap);
+    CPPUNIT_TEST(TestCase_RenderMapWithWatermark);
     CPPUNIT_TEST(TestCase_RenderLegend);
     CPPUNIT_TEST(TestCase_QueryFeatures);
 
@@ -56,6 +57,7 @@
 
     void TestCase_RenderDynamicOverlay();
     void TestCase_RenderMap();
+    void TestCase_RenderMapWithWatermark();
     void TestCase_RenderLegend();
     void TestCase_QueryFeatures();
 
@@ -73,6 +75,7 @@
 
 private:
     MgMap* CreateTestMap();
+    MgMap* CreateTestMapWithWatermark();
     MgPolygon* CreateSelectionPolygon(MgMap* map, double width, double height);
 
 private:

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -25,6 +25,13 @@
 
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(TestResourceService, "TestResourceService");
 
+// define thread group for tiling tests
+#define THREAD_GROUP 65530
+
+#define TESTREQUESTS 500
+
+static const INT32 MG_TEST_THREADS = 8; // Adjust this to get failures!
+
 const STRING adminName = L"Administrator";
 const STRING adminPass = L"admin";
 const STRING userLocale = L"en";
@@ -1635,3 +1642,182 @@
         CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
     }
 }
+
+// data structure which is passed to each thread
+struct ThreadData
+{
+    INT32 threadId;
+    INT32 command;
+    bool success;
+    bool done;
+};
+
+// the method which gets executed by the ACE worker thread
+ACE_THR_FUNC_RETURN RepositoryWorker(void* param)
+{
+    // get the data for this thread
+    ThreadData* threadData = (ThreadData*)param;
+    INT32 threadId = threadData->threadId;
+    INT32 command = threadData->command;
+    ACE_DEBUG((LM_INFO, ACE_TEXT("> thread %d started\n"), threadId));
+
+    try
+    {
+        // set user info
+        Ptr<MgUserInformation> userInfo = new MgUserInformation(L"Administrator", L"admin");
+        userInfo->SetLocale(TEST_LOCALE);
+        MgUserInformation::SetCurrentUserInfo(userInfo);
+
+        // get the tile service instance
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        Ptr<MgResourceService> svcResource = dynamic_cast<MgResourceService*>(
+            serviceManager->RequestService(MgServiceType::ResourceService));
+        assert(svcResource != NULL);
+
+        switch (command)
+        {
+        case 0:
+            {
+            //Set the resource
+            Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(L"Library://UnitTests/Data/test-1.FeatureSource");
+            Ptr<MgByteSource> contentSource = new MgByteSource(resourceContentFileName);
+            Ptr<MgByteReader> contentReader = contentSource->GetReader();
+            svcResource->SetResource(resId, contentReader, NULL);
+            }
+        case 1:
+            {
+            //Set the resource data
+            Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(L"Library://UnitTests/Data/test-1.FeatureSource");
+            Ptr<MgByteSource> dataSource = new MgByteSource(dataFileName);
+            Ptr<MgByteReader> dataReader = dataSource->GetReader();
+            svcResource->SetResourceData(resId, resourceDataName, L"File", dataReader);
+            }
+            // Need to add a case that updates the session with runtime map
+        }
+
+        MgUserInformation::SetCurrentUserInfo(NULL);
+        threadData->success = true;
+    }
+    catch (MgException* e)
+    {
+        STRING message = e->GetDetails(TEST_LOCALE);
+        message += L"\n";
+        message += e->GetStackTrace(TEST_LOCALE);
+        SAFE_RELEASE(e);
+        ACE_DEBUG((LM_INFO, ACE_TEXT("RepositoryWorker - Exception:\n%W\n"), message.c_str()));
+    }
+    catch (...)
+    {
+        throw;
+    }
+
+    // clear the user info to prevent leaks - if an exception happens and this is not called it leaks about 500 bytes!
+    MgUserInformation::SetCurrentUserInfo(NULL);
+
+    ACE_DEBUG((LM_INFO, ACE_TEXT("> thread %d done\n"), threadId));
+
+    threadData->done = true;
+    return 0;
+}
+
+void TestResourceService::TestCase_RepositoryBusy()
+{
+    // specify the number of threads to use
+    const INT32 numThreads = MG_TEST_THREADS;
+    ThreadData threadData[numThreads];
+
+    try
+    {
+        long lStart = GetTickCount();
+
+        // get the tile service instance
+        MgServiceManager* serviceManager = MgServiceManager::GetInstance();
+        Ptr<MgResourceService> svcResource = dynamic_cast<MgResourceService*>(
+            serviceManager->RequestService(MgServiceType::ResourceService));
+        assert(svcResource != NULL);
+
+        // set user info
+        Ptr<MgUserInformation> userInfo = new MgUserInformation(L"Administrator", L"admin");
+        userInfo->SetLocale(TEST_LOCALE);
+        MgUserInformation::SetCurrentUserInfo(userInfo);
+
+        // Initialize the resource
+        Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(L"Library://UnitTests/Data/test-1.FeatureSource");
+        Ptr<MgByteSource> contentSource = new MgByteSource(resourceContentFileName);
+        Ptr<MgByteReader> contentReader = contentSource->GetReader();
+        svcResource->SetResource(resId, contentReader, NULL);
+
+        // need a thread manager
+        ACE_Thread_Manager* manager = ACE_Thread_Manager::instance();
+
+        // initialize the thread data
+        for (INT32 i=0; i<numThreads; i++)
+        {
+            threadData[i].threadId = i;
+            threadData[i].success  = false;
+            threadData[i].done     = true;
+        }
+
+        ACE_DEBUG((LM_INFO, ACE_TEXT("\nTestCase_RepositoryBusy\nThreads: %d  Requests: %d\n\n"), numThreads, TESTREQUESTS));
+
+        INT32 nRequest = 0;
+        INT32 nSuccessful = 0;
+        bool bExceptionOcurred = false;
+        for (;;)
+        {
+            INT32 dc = 0;
+            for (INT32 i=0; i<numThreads; i++)
+            {
+                // check if the thread is available
+                if (threadData[i].done)
+                {
+                    if(threadData[i].success)
+                        nSuccessful++;
+
+                    threadData[i].success = false;
+                    threadData[i].done    = false;
+                    threadData[i].command = i%2;
+
+                    // spawn a new thread using a specific group id
+                    int thid = manager->spawn(ACE_THR_FUNC(RepositoryWorker), &threadData[i], 0, NULL, NULL, 0, THREAD_GROUP);
+                    nRequest++;
+                }
+            }
+
+            // move on if all threads are done
+            if ((nRequest > TESTREQUESTS) || (bExceptionOcurred))
+                break;
+
+            // under Linux we get a deadlock if we don't call this every once in a while
+            if (nRequest % 25 == 0)
+                manager->wait_grp(THREAD_GROUP);
+            else
+            {
+                // pause briefly (10ms) before checking again
+                ACE_Time_Value t(0, 10000);
+                ACE_OS::sleep(t);
+            }
+        }
+
+        // make sure all threads in the group have completed
+        manager->wait_grp(THREAD_GROUP);
+
+        for (INT32 i=0; i<numThreads; i++)
+        {
+            if(threadData[i].success)
+                nSuccessful++;
+        }
+
+        ACE_DEBUG((LM_INFO, ACE_TEXT("\nRequests: %d/%d - Execution Time: = %6.4f (s)\n"), nSuccessful, nRequest, ((GetTickCount()-lStart)/1000.0)));
+    }
+    catch (MgException* e)
+    {
+        STRING message = e->GetDetails(TEST_LOCALE);
+        SAFE_RELEASE(e);
+        CPPUNIT_FAIL(MG_WCHAR_TO_CHAR(message.c_str()));
+    }
+    catch (...)
+    {
+        throw;
+    }
+}

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.h
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.h	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestResourceService.h	2010-11-13 18:07:46 UTC (rev 5389)
@@ -54,6 +54,7 @@
     CPPUNIT_TEST(TestCase_DeleteResource);
 
     CPPUNIT_TEST(TestCase_EnumerateUnmanagedData);
+    CPPUNIT_TEST(TestCase_RepositoryBusy);
 
     CPPUNIT_TEST(TestEnd); // This must be the very last unit test
     CPPUNIT_TEST_SUITE_END();
@@ -96,6 +97,7 @@
     void TestCase_DeleteResource();
 
     void TestCase_EnumerateUnmanagedData();
+    void TestCase_RepositoryBusy();
 };
 
 #endif // TESTRESOURCESERVICE_H_

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/TestTileService.cpp
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/TestTileService.cpp	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/TestTileService.cpp	2010-11-13 18:07:46 UTC (rev 5389)
@@ -58,7 +58,7 @@
         L"Administrator", L"admin");
     userInfo->SetLocale(TEST_LOCALE);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     // This must be done before calling CreateSession()
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
@@ -66,7 +66,7 @@
     assert(!session.empty());
     userInfo->SetMgSessionId(session);
 
-    // Set the current MgUserInformation - this makes a TLS copy of the MgUserInformation object
+    // Set the current MgUserInformation
     MgUserInformation::SetCurrentUserInfo(userInfo);
 
     m_siteConnection = new MgSiteConnection();

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.rc
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.rc	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.rc	2010-11-13 18:07:46 UTC (rev 5389)
@@ -6,7 +6,7 @@
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "afxres.h"
+#include "winresrc.h"
 
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
@@ -28,7 +28,7 @@
 
 1 TEXTINCLUDE 
 BEGIN
-    "#include ""afxres.h""\r\n"
+    "#include ""winresrc.h""\r\n"
     "\0"
 END
 

Modified: sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.vcproj
===================================================================
--- sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.vcproj	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/UnitTesting/UnitTesting.vcproj	2010-11-13 18:07:46 UTC (rev 5389)
@@ -44,7 +44,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -123,7 +123,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
@@ -202,7 +202,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
@@ -281,7 +281,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="2"
-				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
+				AdditionalIncludeDirectories="..\Common;..\Common\Cache;..\Common\Manager;..\Services\Feature;..\Services\Kml;..\Services\Mapping;..\Services\Rendering;..\Services\Resource;..\Services\ServerAdmin;..\Services\Site;..\Services\Tile;..\..\..\Common\Foundation;..\..\..\Common\Geometry;..\..\..\Common\PlatformBase;..\..\..\Common\MapGuideCommon;..\..\..\Common\MdfModel;..\..\..\Common\MdfParser;..\..\..\Common\Stylization;..\..\..\Oem\ACE\ACE_wrappers;&quot;..\..\..\Oem\CppUnit-1.9.14\include&quot;;&quot;..\..\..\Oem\dbxml\xerces-c-src\src&quot;;..\..\..\Oem\FDO\inc"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"

Modified: sandbox/rfc90/MgDev/Server/src/Wfs/1.0.0.xml.awd
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wfs/1.0.0.xml.awd	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Wfs/1.0.0.xml.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -98,17 +98,17 @@
  <Define item="GeometryOperands.xml"><ogc:GeometryOperand>&Enum.item;</ogc:GeometryOperand></Define>
  <Define item="SpatialOperators.xml"><ogc:SpatialOperator name="&Enum.item;"/></Define>
  <Define item="ComparisonOperators.xml"><ogc:ComparisonOperator>&Enum.item;</ogc:ComparisonOperator></Define>
- <Define item="FunctionNames.xml"><ogc:FunctionName nArgs="&Enum.item.args;">&Enum.item;</ogc:FunctionName></Define>
+ <Define item="FunctionNames.xml"><ogc:Function_Name nArgs="&Enum.item.args;">&Enum.item;</ogc:Function_Name></Define>
  <Define item="OtherSRS.xml"><wfs:OtherSRS>&Enum.item;</wfs:OtherSRS></Define>
  <Define item="Format.xml"><ows:Format>&Enum.item;</ows:Format></Define>
 
  <Define item="DescribeFeature.EnumDelim.xml">
    <!-- &Enum.iteration; -->
-   <xs:import schemaLocation="&Url.DescribeFeatureType;?request=DescribeFeatureType&amp;service=WFS&amp;typeName=&Enum.item;"/>
+   <xs:import schemaLocation="&Url.DescribeFeatureType;?request=DescribeFeatureType&amp;service=WFS&amp;version=1.0.0&amp;typeName=&Enum.item;"/>
  </Define>
  <Define item="DescribeFeature.EnumFeature.xml">
    <!-- &Feature.iteration; -->
-   <xs:import schemaLocation="&Url.DescribeFeatureType;?request=DescribeFeatureType&amp;service=WFS&amp;typeName=&Feature.FullName;"/>
+   <xs:import schemaLocation="&Url.DescribeFeatureType;?request=DescribeFeatureType&amp;service=WFS&amp;version=1.0.0&amp;typeName=&Feature.FullName;"/>
  </Define>
 
  <Define item="Format.OgcElement">
@@ -120,6 +120,11 @@
    &Feature.OuterXml;
  </Define>
 
+ <Define item="GetFeatureCollection.xml">
+   <wfs:FeatureCollection &FeatureCollection.Namespaces;>
+     <?EnumFeatures using="&GetFeature.xml;" ?> 
+   </wfs:FeatureCollection>
+ </Define>
 </Definitions>
 
 <!--
@@ -254,9 +259,7 @@
 
 -->
 <Response request="GetFeature" content-type="text/xml; subtype=gml/2.1.2">
- <wfs:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs">
-  <?EnumFeatures using="&GetFeature.xml;" ?>
- </wfs:FeatureCollection>
+ <?GetFeatureCollection using="&GetFeatureCollection.xml;" ?>
 </Response>
 
 <!--
@@ -265,11 +268,18 @@
 
 -->
 <Response request="Exception" content-type="text/xml">
-<ServiceExceptionReport version="&TemplateVersion;" xmlns="http://www.opengis.net/ogc">
- <ServiceException code="&Exception.Type;">
-  Request=&Request.request; resulted in an exception: &Exception.message;
- </ServiceException>
-</ServiceExceptionReport>
+<ows:ExceptionReport 
+   version="&TemplateVersion;"
+   xmlns:ows="http://www.opengis.net/ows"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
+  <ows:Exception exceptionCode="&Exception.Type;" locator="&Exception.Locator;">
+  <ows:ExceptionText>
+   &Exception.message;
+  </ows:ExceptionText>
+ </ows:Exception>
+</ows:ExceptionReport>
+
 </Response>
 
 </Template>

Modified: sandbox/rfc90/MgDev/Server/src/Wfs/1.1.0.xml.awd
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wfs/1.1.0.xml.awd	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Wfs/1.1.0.xml.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -11,13 +11,13 @@
        Feature class #&Feature.iteration;
     -->
   <wfs:FeatureType
-     xmlns:ns="&Feature.namespace;">
-   <wfs:Name>&Feature.name;</wfs:Name>
+     xmlns:&Feature.Prefix;="&Feature.Resource;">
+   <wfs:Name>&Feature.FullName;</wfs:Name>
    <wfs:Title>&Feature.Title;</wfs:Title>
    <wfs:Abstract>&Feature.Abstract;</wfs:Abstract>
-   <?Ifdef item="Feature.KeywordList"?>
+   <?Ifdef item="Feature.Keywords"?>
    <ows:Keywords>
-    <?EnumDelim list="&Feature.KeywordList;" using="&Keywords.xml;"?>
+    <?EnumDelim list="&Feature.Keywords;" using="&Keywords.xml;"?>
    </ows:Keywords>
    <?Endif?>
    <wfs:DefaultSRS>&Feature.DefaultSRS;</wfs:DefaultSRS>
@@ -50,6 +50,7 @@
 
 
  <!-- Routine Enum formats, in xml -->
+ <Define item="ServiceTypeVersion.xml"><ows:ServiceTypeVersion>&Enum.item.number;</ows:ServiceTypeVersion></Define>
  <Define item="Keywords.xml"><ows:Keyword>&Enum.item;</ows:Keyword></Define>
  <Define item="ParameterValue.xml"><ows:Value>&Enum.item;</ows:Value></Define>
  <Define item="ParameterValue.Version.xml"><ows:Value>&Enum.item.number;</ows:Value></Define>
@@ -58,47 +59,51 @@
  <Define item="ComparisonOperators.xml"><ogc:ComparisonOperator>&Enum.item;</ogc:ComparisonOperator></Define>
  <Define item="FunctionNames.xml"><ogc:FunctionName nArgs="&Enum.item.args;">&Enum.item;</ogc:FunctionName></Define>
  <Define item="OtherSRS.xml"><wfs:OtherSRS>&Enum.item;</wfs:OtherSRS></Define>
- <Define item="Format.xml"><ows:Format>&Enum.item;</ows:Format></Define>
+ <Define item="Format.xml"><Format>&Enum.item;</Format></Define>
  <Define item="BoundingBox.xml">
    <ows:LowerCorner>&Enum.item.west; &Enum.item.south;</ows:LowerCorner>
    <ows:UpperCorner>&Enum.item.east; &Enum.item.north;</ows:UpperCorner>
  </Define>
-
+ <Define item="Formats.GetCapabilities">
+   <item>text/xml</item>
+ </Define>
+ 
  <!-- TODO: these will need to come from the full Feature metadata store -->
  <!-- for now, these are operating defaults. -->
  <Define item="Feature.namespace">http://fdo.osgeo.org/schemas</Define>
  <Define item="Feature.Abstract">Abstract for this layer</Define>
- <Define item="Feature.KeywordList"></Define>
- <Define item="Feature.DefaultSRS">EPSG:4326</Define>
+ <Define item="Feature.DefaultSRS">urn:ogc:def:crs:EPSG::4326</Define>
  <!--Define item="Feature.OtherSRS"></Define-->
  <Define item="Feature.Bounds.north">90</Define>
  <Define item="Feature.Bounds.south">-90</Define>
  <Define item="Feature.Bounds.west">-180</Define>
  <Define item="Feature.Bounds.east">180</Define>
+ <Define item="FeatureCollection.Namespaces">xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</Define>
 
-
  <Define item="DescribeFeature.EnumDelim.xml">
    <!-- &Enum.iteration; -->
-   <?EnumDelim list="&Enum.item;" sep=":" subset="1" using="&DescribeFeature.Import.xml;"?>
+   <?EnumDelim list="&Enum.item;" sep="," subset="1" using="&DescribeFeature.Import.xml;"?>
  </Define>
  <Define item="DescribeFeature.EnumFeature.xml">
    <!-- &Feature.iteration; -->
-   <?EnumDelim list="&Feature.name;" sep=":" subset="1" using="&DescribeFeature.Import.xml;"?>
+   <?EnumDelim list="&Feature.Fullname;" sep="," subset="1" using="&DescribeFeature.Import.xml;"?>
  </Define>
 
  <Define item="DescribeFeature.Import.xml">
-  <xs:import schemaLocation="&Url.DescribeFeatureType;?OPERATION=DESCRIBEFEATURESCHEMA&amp;VERSION=1.0.0&amp;LOCALE=en&amp;RESOURCEID=Library://&Enum.item;.FeatureSource&amp;SCHEMA="/>
+  <xs:import schemaLocation="&Url.DescribeFeatureType;?request=DescribeFeatureType&amp;service=WFS&amp;version=1.1.0&amp;typeName=&Enum.item;"/>
  </Define>
 
- <Define item="DescribeFeature.Import.xml">
-  <xs:import schemaLocation="&Url.DescribeFeatureType;?OPERATION=DESCRIBEFEATURESCHEMA&amp;VERSION=1.0.0&amp;LOCALE=en&amp;RESOURCEID=Library://&Enum.item;.FeatureSource&amp;SCHEMA="/>
- </Define>
-
  <Define item="GetFeature.xml">
   <!-- Feature &Feature.iteration; -->
   &Feature.OuterXml;
  </Define>
 
+ <Define item="GetFeatureCollection.xml">
+    <wfs:FeatureCollection &FeatureCollection.Namespaces;>
+        <?EnumFeatures using="&GetFeature.xml;" ?> 
+    </wfs:FeatureCollection>
+ </Define>
+ 
 </Definitions>
 
 <!--
@@ -108,34 +113,41 @@
 -->
 <Response request="GetCapabilities" content-type="text/xml">
 <wfs:WFS_Capabilities
+  xmlns:gml="http://www.opengis.net/gml"
+  xmlns:wfs="http://www.opengis.net/wfs"
   xmlns:ows="http://www.opengis.net/ows"
-  xmlns:ogc="http://www.opengis.net/ogc"
-  xmlns:wfs="http://www.opengis.net/wfs"
-  xmlns:gml="http://www.opengis.net/gml"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.opengis.net/wfs ../wfs.xsd" version="1.1.0" updateSequence="0">
-  <!-- ================================================================== -->
-  <!-- SERVICE IDENTIFICATION SECTION                                     -->
-  <!-- ================================================================== -->
-  <ows:ServiceIdentification>
-    <ows:ServiceType>WFS</ows:ServiceType>
-    <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion>
-    <ows:Title>&Service.Title;</ows:Title>
-    <ows:Abstract>&Service.Abstract</ows:Abstract>
+  xmlns:ogc="http://www.opengis.net/ogc"
+  xmlns="http://www.opengis.net/wfs"
+  version="1.1.0" 
+  xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
+ >
+ 
+  <?Ifdef item="Section.ServiceIdentification"?>
+    <!-- ================================================================== -->
+    <!-- SERVICE IDENTIFICATION SECTION                                     -->
+    <!-- ================================================================== -->
+    <ows:ServiceIdentification>
+	<ows:Title>&Service.Title;</ows:Title>
+	<ows:Abstract>&Service.Abstract;</ows:Abstract>
     <ows:Keywords>
-      <?EnumDelim list="&Service.Keywords;"   using="&Keywords.xml;" ?>
+      <?Enum list="&Service.Keywords;" using="&Keywords.xml;"?>
     </ows:Keywords>
+	<ows:ServiceType>WFS</ows:ServiceType>
+	<?Enum list="&SupportedVersions;" using="&ServiceTypeVersion.xml;" item="Version"?>
     <ows:Fees>&Service.Fees;</ows:Fees>
     <ows:AccessConstraints>&Service.AccessConstraints;</ows:AccessConstraints>
   </ows:ServiceIdentification>
-
-  <!-- ================================================================== -->
-  <!-- SERVICE PROVIDER SECTION                                           -->
-  <!-- ================================================================== -->
-  <ows:ServiceProvider>
-    <ows:ProviderName></ows:ProviderName>
-    <ows:ProviderSite/>
+  <?Endif?>
+  
+  <?Ifdef item="Section.ServiceProvider"?>
+    <!-- ================================================================== -->
+    <!-- SERVICE PROVIDER SECTION                                           -->
+    <!-- ================================================================== -->
+    <ows:ServiceProvider>
+    <ows:ProviderName>&Service.Contact.ProviderName;</ows:ProviderName>
+    <ows:ProviderSite>&Service.Contact.ProviderSite;</ows:ProviderSite>
     <ows:ServiceContact>
       <ows:IndividualName>&Service.Contact.Name;</ows:IndividualName>
       <ows:PositionName>&Service.Contact.Position;</ows:PositionName>
@@ -153,18 +165,20 @@
           <ows:ElectronicMailAddress>&Service.Contact.Email;</ows:ElectronicMailAddress>
         </ows:Address>
         <ows:OnlineResource xlink:href="&URL.OnlineResource;"/>
-        <ows:HoursOfService>24x7</ows:HoursOfService>
+        <ows:HoursOfService>&Service.Contact.HoursOfService;</ows:HoursOfService>
         <ows:ContactInstructions>&Service.Contact.Instructions;</ows:ContactInstructions>
       </ows:ContactInfo>
-      <ows:Role>PointOfContact</ows:Role>
+      <ows:Role>&Service.Contact.Role;</ows:Role>
     </ows:ServiceContact>
   </ows:ServiceProvider>
+  <?Endif?>
+  
+  <?Ifdef item="Section.OperationsMetadata"?>
+    <!-- ================================================================== -->
+    <!-- OPERATIONS METADATA SECTION                                        -->
+    <!-- ================================================================== -->
+    <ows:OperationsMetadata>
 
-  <!-- ================================================================== -->
-  <!-- OPERATIONS METADATA SECTION                                        -->
-  <!-- ================================================================== -->
-  <ows:OperationsMetadata>
-
     <!-- GetCapabilities -->
     <ows:Operation name="GetCapabilities">
       <ows:DCP>
@@ -228,15 +242,18 @@
     </ows:Constraint>
 
   </ows:OperationsMetadata>
-
+  <?Endif?>
+  
+  <?Ifdef item="Section.FeatureTypeList"?>
+     <!-- ================================================================== -->
+     <!-- FEATURE TYPE LIST SECTION                                          -->
+     <!-- ================================================================== -->
+     <wfs:FeatureTypeList>
+       <?EnumFeatureTypes using="&Feature.xml;"?>
+     </wfs:FeatureTypeList>
+  <?Endif?>
+ 
   <!-- ================================================================== -->
-  <!-- FEATURE TYPE LIST SECTION                                          -->
-  <!-- ================================================================== -->
-  <wfs:FeatureTypeList>
-   <?EnumFeatureTypes using="&Feature.xml;"?>
-  </wfs:FeatureTypeList>
-
-  <!-- ================================================================== -->
   <!-- FILTER CAPABILITIES SECTION                                        -->
   <!-- ================================================================== -->
 
@@ -259,7 +276,7 @@
         <ogc:SimpleArithmetic/>
         <ogc:Functions>
           <ogc:FunctionNames>
-            <?Enum list="Query.FunctionNames" using="FunctionNames.xml"?>
+            <?Enum list="&Query.FunctionNames" using="&FunctionNames.xml"?>
           </ogc:FunctionNames>
         </ogc:Functions>
       </ogc:ArithmeticOperators>
@@ -273,17 +290,28 @@
  </wfs:WFS_Capabilities>
 </Response>
 
+<!--
 
+  WFS DescribeFeatureType - XML, GML 2.1.2
 
+-->
+<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/2.1.2">
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <?Ifdef item="Request.typename"?>
+ <?EnumDelim list="&Request.typename;" using="&DescribeFeature.EnumDelim.xml;"?>
+ <?Else?>
+ <?EnumFeatureTypes using="&DescribeFeature.EnumFeature.xml;" ?>
+ <?Endif?>
+ </xs:schema>
+</Response>
 
-
-
 <!--
 
-  WFS DescribeFeatureType - XML, GML 2.1.2
+  WFS DescribeFeatureType - XML, GML 3.1.1
 
 -->
-<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/2.1.2">
+<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/3.1.1">
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" attributeFormDefault="unqualified">
  <?Ifdef item="Request.typename"?>
@@ -300,22 +328,35 @@
 
 -->
 <Response request="GetFeature" content-type="text/xml; subtype=gml/2.1.2">
- <wfs:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs">
-  <?EnumFeatures using="&GetFeature.xml;" ?>
- </wfs:FeatureCollection>
+ <?GetFeatureCollection using="&GetFeatureCollection.xml;" ?>
 </Response>
 
 <!--
 
+  WFS GetFeature - XML, GML 3.1.1
+
+-->
+<Response request="GetFeature" content-type="text/xml; subtype=gml/3.1.1">
+  <?GetFeatureCollection using="&GetFeatureCollection.xml;" ?>
+</Response>
+
+<!--
+
   Exception Format  - XML
 
 -->
 <Response request="Exception" content-type="text/xml">
-<ServiceExceptionReport version="&TemplateVersion;">
- <ServiceException code="&Exception.Type;">
-  &Exception.message;
- </ServiceException>
-</ServiceExceptionReport>
+<ows:ExceptionReport 
+   version="&TemplateVersion;"
+   xmlns:ows="http://www.opengis.net/ows"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd">
+ <ows:Exception exceptionCode="&Exception.Type;" locator="&Exception.Locator;">
+  <ows:ExceptionText>
+   &Exception.message;
+  </ows:ExceptionText>
+ </ows:Exception>
+</ows:ExceptionReport>
 </Response>
 
 </Template>

Modified: sandbox/rfc90/MgDev/Server/src/Wfs/OgcWfsService.config.awd
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wfs/OgcWfsService.config.awd	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Wfs/OgcWfsService.config.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -9,6 +9,7 @@
       Also, anything other than a <Version> element is ignored.    -->
  <Define item="SupportedVersions">
    <Version number="1.0.0"/>
+   <Version number="1.1.0"/>
  </Define>
 
  <!-- These are edited by the Site Administration tool, though you
@@ -19,6 +20,8 @@
  <Define item="Service.Abstract">MapGuide WFS Server</Define>
  <Define item="Service.AccessConstraints">none</Define>
  <!-- Who to contact -->
+ <Define item="Service.Contact.ProviderName"></Define>
+ <Define item="Service.Contact.ProviderSite"></Define>
  <Define item="Service.Contact.Name"></Define>
  <Define item="Service.Contact.Organization"></Define>
  <Define item="Service.Contact.Position"></Define>
@@ -31,8 +34,9 @@
  <Define item="Service.Contact.Phone"></Define>
  <Define item="Service.Contact.Fax"></Define>
  <Define item="Service.Contact.Email"></Define>
+ <Define item="Service.Contact.HoursOfService">24x7</Define>
  <Define item="Service.Contact.Instructions"></Define>
-
+ <Define item="Service.Contact.Role"></Define>
  <!-- The URL elements.  Change to suit, as this is reported -->
  <Define item="SERVER_NAME">localhost:8008</Define>
  <Define item="SCRIPT_NAME">/mapguide/mapagent/mapagent.fcgi</Define>
@@ -44,7 +48,7 @@
  <Define item="Url.GetFeature">http://&SERVER_NAME;&SCRIPT_NAME;</Define>
 
  <!-- List the keywords to be associated with the WFS - pick what describes your data -->
- <Define item="Service.Keywords"><item>GIS</item><item>WFS</item><item>Server</item></Define>
+ <Define item="Service.Keywords"><item>GIS WFS Server</item></Define>
 
 
  <!-- Enumerates an element in a dictionary for HTML
@@ -130,28 +134,35 @@
  <!-- These are the supported DescribeFeatureType formats
       Specific version templates can override these -->
  <Define item="Formats.DescribeFeatureType">
+   <item>GML2</item>
    <item>text/xml; subtype=gml/2.1.2</item>
-   <!--item>text/xml; subtype=gml/3.1.1</item-->
+   <item>GML3</item>
+   <item>text/xml; subtype=gml/3.1.1</item>
  </Define>
 
- <Define item="Formats.DescribeFeatureType.default">text/xml; subtype=gml/2.1.2</Define>
-
+ <Define item="Formats.DescribeFeatureType.default.1.0.0">text/xml; subtype=gml/2.1.2</Define>
+ <Define item="Formats.DescribeFeatureType.default.1.1.0">text/xml; subtype=gml/3.1.1</Define>
+ 
  <!-- For historic reasons, we need to accept these output formats, -->
  <!-- which we convert into the indicated notations                 -->
  <Define item="Parameter.OutputFormat.ValueMap">
   <translate from="GML2">text/xml; subtype=gml/2.1.2</translate>
   <translate from="XMLSCHEMA">text/xml; subtype=gml/2.1.2</translate>
+  <translate from="GML3">text/xml; subtype=gml/3.1.1</translate>
  </Define>
 
  <!-- These are the supported GetFeature formats
       Specific version templates can override these    -->
  <Define item="Formats.GetFeature">
+   <item>GML2</item>
    <item>text/xml; subtype=gml/2.1.2</item>
-   <!--item>text/xml; subtype=gml/3.1.1</item-->
+   <item>GML3</item>
+   <item>text/xml; subtype=gml/3.1.1</item>
  </Define>
 
- <Define item="Formats.GetFeature.default">text/xml; subtype=gml/2.1.2</Define>
-
+ <Define item="Formats.GetFeature.default.1.0.0">text/xml; subtype=gml/2.1.2</Define>
+ <Define item="Formats.GetFeature.default.1.1.0">text/xml; subtype=gml/3.1.1</Define>
+ 
  <!-- These are the supported Exception formats
       Specific version templates can override these -->
  <Define item="Formats.Exception">
@@ -254,6 +265,15 @@
  * &Enum.item;
  </Define>
 
+ <!-- This definition allows a site to override the behavior of -->
+ <!-- the SRS= parameter of requests.                           -->
+ <!-- Add translate elements here to map any particularly       -->
+ <!-- troublesome SRS to some appropriate WKT.                  -->
+ <Define item="SRS.WKT.map">
+  <translate from="URN:OGC:DEF:CRS:EPSG::4326">GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</translate>
+  <translate from="CRS:84">GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</translate>
+ </Define>
+ 
 </Definitions>
 
 

Modified: sandbox/rfc90/MgDev/Server/src/Wms/1.1.1.xml.awd
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wms/1.1.1.xml.awd	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Wms/1.1.1.xml.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -132,7 +132,7 @@
 
  <Define item="GetCapabilities.xml">
   <!DOCTYPE WMT_MS_Capabilities SYSTEM
- "http://schemas.opengis.net/wms/1.1.1/capabilities_1_1_1.dtd"
+ "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
   [
    <!ELEMENT VendorSpecificCapabilities EMPTY>
   ]>

Copied: sandbox/rfc90/MgDev/Server/src/Wms/1.3.0.xml.awd (from rev 5096, trunk/MgDev/Server/src/Wms/1.3.0.xml.awd)
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wms/1.3.0.xml.awd	                        (rev 0)
+++ sandbox/rfc90/MgDev/Server/src/Wms/1.3.0.xml.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -0,0 +1,404 @@
+<?xml version='1.0'?>
+<Template service="WMS" version="1.3.0">
+
+<Definitions>
+
+  <!-- This defines the format of each individual layer
+      advertised by GetCapabilities                    -->
+  <!-- Note: Studio published the following metadata fields                                -->
+  <!-- Layer.Name      - The canonical machine-readable name for a layer                   -->
+  <!-- Layer.Abstract  - Free-form human readable description for the layer                -->
+  <!-- Layer.Bounds    - Structured XML in the form of one or more of these elements       -->
+  <!--                     <Bounds CRS= north= south= east= west=/>                        -->
+  <!--                     (Note: Studio currently publishes this as plain text, which     -->
+  <!--                     the template engine converts to an XML fragment; future work    -->
+  <!--                     in Studio is expected to remedy this.)                          -->
+  <!--                     (An example is shown below in Layer.BoundingBox.default)        -->
+  <!-- Layer.Cascaded  - the WMS "cascade" value, indicating whether the data came from    -->
+  <!--                     another server, or originated on this server                    -->
+  <!-- Layer.ExtendedMetadata - like Layer.Bounds, should be structured XML, but Studio    -->
+  <!--                            just writes it out as plain text.  Format: zero or more  -->
+  <!--                            <Link href= type= format= /> elements.  Currently not    -->
+  <!--                            implemented in templates.                                -->
+  <!-- Layer.Keywords  - A comma-separated list of keywords associated with this layer.    -->
+  <!-- Layer.Opaque    - boolean indicating whether the layer is opaque or transparent.    -->
+  <!-- Layer.Queryable - boolean indicating whether the layer supports GetFeatureInfo.     -->
+  <!-- Layer.Title     - The user-provided human-readable name for the layer.              -->
+  <!--                                                                                     -->
+  <!-- Layer.NoSubsets is currently not emitted by Studio, its value is defaulted within   -->
+  <!-- the OwsWmsService.config.awd file.                                                  -->
+  <Define item="Layer.xml">
+  <!-- Published Layer #&Layer.iteration; -->
+  <Layer queryable="&Layer.Queryable;" cascaded="&Layer.Cascaded;" noSubsets="&Layer.NoSubsets;" opaque="&Layer.Opaque;">
+   <Name>&Layer.Name;</Name>
+   <Title>&Layer.Title;</Title>
+   <?Ifdef item="Layer.Abstract"?><Abstract>&Layer.Abstract;</Abstract><?Endif?>
+   <?Ifdef item="Layer.Keywords"?>
+   <KeywordList>
+     <?EnumDelim list="&Layer.Keywords;" using="&Service.Keywords.xml;"?>
+   </KeywordList>
+   <?Endif?>
+   <?Ifdef item="Layer.Bounds"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&CRS.xml;"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&EX_GeographicBoundingBox.xml;"?>
+    <?Enum list="&Layer.Bounds;" item="Bounds" using="&BoundingBox.xml;"?>
+   <?Else?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&CRS.xml;"?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&EX_GeographicBoundingBox.xml;" ?>
+    <?Enum list="&Layer.BoundingBox.default;" item="Bounds" using="&BoundingBox.xml;" ?>
+   <?Endif?>
+  </Layer>
+ </Define>
+
+ <!-- An example of what can be expected in the Layer.Bounds definition -->
+ <Define item="Layer.BoundingBox.default">
+  <Bounds CRS="EPSG:4326" west="-180" south="-90" east="180" north="90"/>
+ </Define>
+
+ <!-- This pair of definitions works around a current limitation that -->
+ <!-- <?If...?><?Endif?> cannot be nested.                            -->
+ <Define item="EX_GeographicBoundingBox.xml">
+    <?Translate text="&Enum.item.SRS;" with="&EX_GeographicBoundingBox.translate.xml;"?>
+ </Define>
+
+ <Define item="EX_GeographicBoundingBox.translate.xml">
+    <translate from="EPSG:4326" ?>
+        <EX_GeographicBoundingBox>
+            <westBoundLongitude>&Enum.item.west;</westBoundLongitude>
+            <eastBoundLongitude>&Enum.item.east;</eastBoundLongitude>
+            <southBoundLatitude>&Enum.item.south;</southBoundLatitude>
+            <northBoundLatitude>&Enum.item.north;</northBoundLatitude>
+        </EX_GeographicBoundingBox>
+    </translate>
+    <translate></translate>
+</Define>
+
+ <Define item="BoundingBox.xml">
+  <BoundingBox CRS="&Enum.item.SRS;" minx="&Enum.item.west;" miny="&Enum.item.south;" maxx="&Enum.item.east;" maxy="&Enum.item.north;"/>
+ </Define>
+
+ <Define item="CRS.xml">
+  <CRS>&Enum.item.SRS;</CRS>
+ </Define>
+
+ <Define item="FeatureInfo.xml">
+  <?Ifdef item="FeatureInfo.LayerName"?>
+  <FeatureInfo layer="&FeatureInfo.LayerName;">
+  <?Else?>
+  <FeatureInfo>
+  <?Endif?>
+  <?EnumFeatureProperties using="&FeatureProperty.xml;" ?>
+  </FeatureInfo>
+ </Define>
+
+ <Define item="FeatureInfo.html">
+  <tr>
+   <td>
+    <table>
+     <?EnumFeatureProperties using="&FeatureProperty.html;" ?>
+    </table>
+   </td>
+  </tr>
+ </Define>
+
+ <Define item="FeatureInfo.text">
+  FeatureInfo:
+  <?EnumFeatureProperties using="&FeatureProperty.text;" ?>
+
+ </Define>
+
+ <Define item="FeatureProperty.xml">
+  <Property name="&FeatureProperty.Name;" value="&FeatureProperty.Value;"></Property>
+ </Define>
+
+ <Define item="FeatureProperty.html">
+  <tr><td class="name">&FeatureProperty.Name;</td><td>&FeatureProperty.Value;</td></tr>
+ </Define>
+
+ <Define item="FeatureProperty.text">
+  &FeatureProperty.Name;=&FeatureProperty.Value;
+ </Define>
+
+ <!-- We're currently not supporting child layers... -->
+ <Define item="Layer.Sublayers"></Define>
+
+ <!-- In this version, keywords are enumerated enclosed in Keyword elements -->
+ <Define item="Service.Keywords.xml"><Keyword>&Enum.item;</Keyword>
+ </Define>
+
+ <!-- Overrides of default Exception formats
+  specific to this version template -->
+ <Define item="Formats.Exception">
+  <item>XML</item>
+ </Define>
+
+ <!-- These are the supported (Get)Capabilities formats
+  for version 1.1.1.     -->
+ <Define item="Formats.GetCapabilities">
+  <item>text/xml</item>
+  <item>text/html</item>
+ </Define>
+
+ <Define item="GetCapabilities.xml">
+  <WMS_Capabilities version="&TemplateVersion;"
+    xmlns="http://www.opengis.net/wms"
+    xmlns:xlink="http://www.w3.org/1999/xlink"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd">
+   <!--
+
+   SERVICE METADATA
+
+   -->
+   <Service>
+    <Name>&Service.Name;</Name>
+    <Title>&Service.Title;</Title>
+    <?Ifdef item="Service.Abstract"?>
+    <Abstract>&Service.Abstract;</Abstract>
+    <?Endif?>
+    <?Ifdef item="Service.Keywords"?>
+    <KeywordList>
+     <?Enum list="&Service.Keywords;" using="&Service.Keywords.xml"?>
+    </KeywordList>
+    <?Endif?>
+    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.OnlineResource;"></OnlineResource>
+
+    <ContactInformation>
+     <ContactPersonPrimary>
+      <ContactPerson>&Service.Contact.Name;</ContactPerson>
+      <ContactOrganization>&Service.Contact.Organization;</ContactOrganization>
+     </ContactPersonPrimary>
+     <?Ifdef item="Service.Contact.Position"?>
+     <ContactPosition>&Service.Contact.Position;</ContactPosition>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Address.Type"?>
+     <ContactAddress>
+      <AddressType>&Service.Contact.Address.Type;</AddressType>
+      <Address>&Service.Contact.Address.Street;</Address>
+      <City>&Service.Contact.Address.City;</City>
+      <StateOrProvince>&Service.Contact.Address.StateProv;</StateOrProvince>
+      <PostCode>&Service.Contact.Address.PostCode;</PostCode>
+      <Country>&Service.Contact.Address.Country;</Country>
+     </ContactAddress>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Phone"?>
+     <ContactVoiceTelephone>&Service.Contact.Phone;</ContactVoiceTelephone>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Fax"?>
+     <ContactFacsimileTelephone>&Service.Contact.Fax;</ContactFacsimileTelephone>
+     <?Endif?>
+     <?Ifdef item="Service.Contact.Email"?>
+     <ContactElectronicMailAddress>&Service.Contact.Email;</ContactElectronicMailAddress>
+     <?Endif?>
+    </ContactInformation>
+
+    <Fees>&Service.Fees;</Fees>
+    <AccessConstraints>&Service.AccessConstraints;</AccessConstraints>
+   </Service>
+
+   <!--
+
+   SERVICE CAPABILITIES
+
+   -->
+   <Capability>
+
+    <Request>
+     <GetCapabilities>
+      <?Enum list="&Formats.GetCapabilities;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetCapabilities;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetCapabilities>
+
+     <GetMap>
+      <?Enum list="&Formats.GetMap;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetMap;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetMap>
+
+     <GetFeatureInfo>
+      <?Enum list="&Formats.GetFeatureInfo;" using="&Format.xml;" ?>
+      <DCPType>
+       <HTTP>
+        <Get>
+        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="&Url.GetFeatureInfo;?"/>
+        </Get>
+       </HTTP>
+      </DCPType>
+     </GetFeatureInfo>
+
+    </Request>
+
+    <Exception>
+     <?Enum list="&Formats.Exception;" using="&Format.xml;" ?>
+    </Exception>
+
+    <!-- No VendorSpecificCapabilities -->
+    <!-- No UserDefinedSymbolization -->
+
+    <!--
+
+    PUBLISHED LAYERS
+
+    -->
+    <Layer>
+     <Title>&Service.Title;</Title>
+     <?Enum list="&ReferenceSystems;" using="&RS_CRS.xml;"?>
+     <?EnumLayers using="&Layer.xml;" ?>
+    </Layer>
+   </Capability>
+  </WMS_Capabilities>
+ </Define>
+
+</Definitions>
+
+<!--
+
+  WMS GetCapabilities  - XML as text/xml
+
+-->
+<Response request="GetCapabilities" content-type="text/xml">
+&GetCapabilities.xml;
+</Response>
+
+<!--
+
+  WMS GetCapabilities  - XML as application/vnd.ogc.wms_xml
+
+-->
+<Response request="GetCapabilities" content-type="application/vnd.ogc.wms_xml">
+&GetCapabilities.xml;
+</Response>
+
+<!--
+
+  WMS GetCapabilities  - HTML
+
+-->
+<Response request="GetCapabilities" content-type="text/html">
+<html>
+ <head>
+  <title>GetCapabilities Response for &Service.Title;</title>
+  &html.stylesheet;
+ </head>
+ <body>
+  <table border="1">
+   <tr><td class="title" colspan="2">Service Metadata - version &TemplateVersion;</td></tr>
+   <tr><td class="name">Name</td><td>&Service.Name;</td></tr>
+   <tr><td class="name">Title</td><td>&Service.Title;</td></tr>
+  <?Ifdef item="Service.Abstract"?>
+   <tr><td class="name">Abstract</td><td>&Service.Abstract;</td></tr>
+  <?Endif?>
+  <?Ifdef item="Service.Keywords"?>
+   <tr><td class="name">Keywords</td><td>
+    <?Enum list="&Service.Keywords;" using="&Format.html;"?>
+   </td></tr>
+  <?Endif?>
+   <tr><td class="name">Online Resource</td><td>&Url.OnlineResource;</td></tr>
+   <tr><td class="name">Contact Information</td><td>
+     &Service.Contact.Name;<br/>
+     &Service.Contact.Organization<br/>
+   <?Ifdef item="Service.Contact.Position"?>&Service.Contact.Position;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Address.Type"?>
+     &Service.Contact.Address.Street;<br/>
+     &Service.Contact.Address.City;, &Service.Contact.Address.StateProv;<br/>
+     &Service.Contact.Address.PostCode;<br/>
+     &Service.Contact.Address.Country;
+   <?Ifdef item="Service.Contact.Phone"?>Phone: &Service.Contact.Phone;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Fax"?>Fax: &Service.Contact.Fax;<br/><?Endif?>
+   <?Ifdef item="Service.Contact.Email"?>Email: &Service.Contact.Email;<br/><?Endif?>
+    </tr></td>
+    <?Endif?>
+  <tr><td class="name">Fees</td><td>&Service.Fees;</td></tr>
+  <tr><td class="name">Access Constraints</td><td>&Service.AccessConstraints;</td></tr>
+  <tr><td class="title" colspan="2">Capbilities</td></tr>
+  <tr><td class="name">GetCapabilities</td><td>
+   URL: &Url.GetCapabilities;<br/>
+   Formats:
+   <?Enum list="&Formats.GetCapability;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="name">GetMap</td><td>
+   URL: &Url.GetMap;<br/>
+   Formats:
+   <?Enum list="&Formats.GetMap;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="name">GetFeatureInfo</td><td>
+   URL: &Url.GetFeatureInfo;<br/>
+   Formats:
+   <?Enum list="&Formats.GetFeatureInfo;" using="&Format.html;"?>
+  </td></tr>
+  <tr><td class="title" colspan="2">Published Layers</td></tr>
+  <?EnumLayers using="&EnumLayer.html;"?>
+  </table>
+ </body>
+</html>
+</Response>
+
+<!--
+
+  WMS GetFeatureInfo  - XML
+
+-->
+<Response request="GetFeatureInfo" content-type="text/xml">
+ <FeatureInfoCollection>
+  <?EnumFeatureInfo using="&FeatureInfo.xml;" ?>
+ </FeatureInfoCollection>
+</Response>
+
+
+<!--
+
+  WMS GetFeatureInfo  - HTML
+
+-->
+<Response request="GetFeatureInfo" content-type="text/html">
+<html>
+<head>
+<title>GetFeatureInfo</title>
+</head>
+<body>
+<table border="1">
+ <?EnumFeatureInfo using="&FeatureInfo.html;" ?>
+</table>
+</body>
+</html>
+</Response>
+
+
+<!--
+
+  WMS GetFeatureInfo  - TEXT
+
+-->
+<Response request="GetFeatureInfo" content-type="text/plain">
+ <?EnumFeatureInfo using="&FeatureInfo.text;" ?>
+</Response>
+
+
+<!--
+
+  Exception format - XML
+
+-->
+<Response request="Exception" content-type="text/xml">
+<ServiceExceptionReport version="&TemplateVersion;" 
+   xmlns="http://www.opengis.net/ogc"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
+ <ServiceException code="&Exception.Type;">
+  &Exception.message;
+ </ServiceException>
+</ServiceExceptionReport>
+</Response>
+
+</Template>

Modified: sandbox/rfc90/MgDev/Server/src/Wms/OgcWmsService.config.awd
===================================================================
--- sandbox/rfc90/MgDev/Server/src/Wms/OgcWmsService.config.awd	2010-11-12 18:50:17 UTC (rev 5388)
+++ sandbox/rfc90/MgDev/Server/src/Wms/OgcWmsService.config.awd	2010-11-13 18:07:46 UTC (rev 5389)
@@ -11,7 +11,7 @@
    <Version number="1.0.0"/>
    <Version number="1.1.0"/>
    <Version number="1.1.1"/>
-   <!--Version number="1.3.0"/-->
+   <Version number="1.3.0"/>
  </Define>
 
  <!-- These are edited by the Site Administration tool, though you
@@ -115,7 +115,8 @@
 
  <!-- This is the default definition for a reference system (SRS, or CRS) -->
  <Define item="RS.xml"><SRS>&Enum.item;</SRS></Define>
-
+ <Define item="RS_CRS.xml"><CRS>&Enum.item;</CRS></Define>
+ 
  <!-- You can control the formats supported by various
       WMS responses by (a) modifying these lists and
       (b) adding (if necessary) the appropriate
@@ -189,6 +190,10 @@
    <item>application/vnd.ogc.se_blank</item>
    <item>text/html</item>
    <item>text/plain</item>
+   <item>XML</item>
+   <item>INIMAGE</item>
+   <item>BLANK</item>
+
  </Define>
 
 
@@ -222,6 +227,7 @@
       types in a badly-formed <Bounds /> element that isn't EPSG:4326
       then the whole enchilada is serious GIGO. -->
  <Define item="Enum.item.SRS">EPSG:4326</Define>
+ <Define item="Enum.item.CRS">EPSG:4326</Define>
  <Define item="Enum.item.north">90</Define>
  <Define item="Enum.item.south">-90</Define>
  <Define item="Enum.item.west">-180</Define>
@@ -236,7 +242,7 @@
        finding the WKT for EPSG:21781 in the CS library.
   -->
   <translate from="EPSG:21781">PROJCS["CH1903.LV03/01",GEOGCS["LLCH1903",DATUM["CH-1903",SPHEROID["BESSEL",6377397.155,299.15281535],TOWGS84[660.0770,13.5510,369.3440,0.804816,0.577692,0.952236,5.66000000]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Swiss_Oblique_Cylindrical"],PARAMETER["false_easting",600000.000],PARAMETER["false_northing",200000.000],PARAMETER["latitude_of_origin",46.95240555555556],PARAMETER["central_meridian",7.43958333333333],UNIT["Meter",1.00000000000000]]</translate>
-
+  <translate from="CRS:84">GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</translate>
  </Define>
 
 </Definitions>



More information about the mapguide-commits mailing list