[mapguide-users] Invalid stream header exception

A H hizperion at hotmail.com
Thu Sep 20 19:39:56 PDT 2012


i recently upgraded from MGOS2.1 to MGOS2.2
this code used to work:

        MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;
        MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

        MgResourceIdentifier featureSourceId = new
MgResourceIdentifier("Library://World/Data/" + featureSource +
".FeatureSource");
        MgFeatureCommandCollection Commands = new
MgFeatureCommandCollection();

        MgStringCollection colStringClass =
featureService.GetClasses(featureSourceId, "");

        MgFeatureAggregateOptions newQuery = new
MgFeatureAggregateOptions();
        newQuery.SetFilter("");
        newQuery.AddComputedProperty("Count", "Count(1)");

        MgDataReader featureReader =
featureService.SelectAggregate(featureSourceId, featureClass, newQuery);
        double featureCount = 0;

        while (featureReader.ReadNext())
        {
            featureCount = featureReader.GetInt64("Count");
        }

but now i got this error:

/MgDataReader featureReader =
featureService.SelectAggregate(featureSourceId, featureClass, newQuery);/
OSGeo.MapGuide.MgInvalidStreamHeaderException: Invalid stream header
exception.

OSGeo.MapGuide.SWIGExceptionHelper.ThrowCustomException(String className,
IntPtr cptr) +190
   OSGeo.MapGuide.MapGuideApiPINVOKE.MgFeatureService_SelectAggregate(IntPtr
jarg1, IntPtr jarg2, String jarg3, IntPtr jarg4) +0
   OSGeo.MapGuide.MgFeatureService.SelectAggregate(MgResourceIdentifier
resource, String className, MgFeatureAggregateOptions options) +38

where should i check in order to try and fix this?



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Invalid-stream-header-exception-tp5003400.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list