[mapguide-internals] FeatureSet xml serialization issues (RE: SELECTFEATURES via mapagent and null values)

Jackie Ng jumpinjackie at gmail.com
Thu Apr 8 21:19:16 EDT 2010


Sorry to necro a 1.5 year old post but this issue has stuck for over 1.5
years without a solution and is severly hampering what I want to do with
some new Maestro features (see tickets 1238, 1228 and 708)

I've done some digging around attempting to piece the trail of logic from
the moment a SELECTFEATURES request is made to the point where a
MgNullPropertyValueException is thrown.

So far, I've pieced the flow of logic as follows:

1. Send SELECTFEATURES on mapagent
2. MgHttpSelectFeatures handles this request and does a call to
MgProxyFeatureService::SelectFeatures
3. MgHttpSelectFeatures calls ToXml() on the MgProxyFeatureReader
4. In the process of iterating through the MgProxyFeatureReader, it fetches
features from the server in batches via MgBatchPropertyCollection, which may
contain null property values.
5. Each iterated feature (a MgPropertyCollection) is individually serialized
to xml
6. Each feature property in the MgPropertyCollection fetches and writes the
boxed values to xml, which throws a MgNullPropertyValueException if the
property is actually null property value.
7. The XML content is written out to the HTTP response stream.

So from my observation, it seems that in the process of serializing features
to xml it does not consider the scenario of null feature property values,
instead just blindly writing each property value. 

Does my observation sound about right? If so, how should be properly
handling this? Do we serialize null values? Or should we omit writing the
xml if the property value is null?

- Jackie

-- 
View this message in context: http://n2.nabble.com/SELECTFEATURES-via-mapagent-and-null-values-tp1822076p4874808.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.


More information about the mapguide-internals mailing list