[mapguide-users] GetResourceContent returns empty string
JillP
romanje at cdm.com
Mon Apr 9 17:51:33 EDT 2007
Every time I try to get the resource content or the repository content, I'm
always returned an empty string. I am opening the map using MapGuides
Administrator credentials, so it shouldn't be a permissions issue. My code
seems remarkably similar to other's posted in these forums who seem to have
gotten the respository content returned. Here's my code -- any help is
appreciated.
MgUserInformation userInfo = new MgUserInformation(sessionId);
MgSiteConnection siteConnection = new MgSiteConnection();
siteConnection.Open(userInfo);
MgResourceService resService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
MgMap map = new MgMap();
map.Open(resService, ConfigurationManager.AppSettings["MapName"]);
//Gets the layer
MgLayer mapLayer = GetLayerByName(map,layerName);
//Always returns the correct MgResourceIdentifier
MgResourceIdentifier resId = mapLayer.GetLayerDefinition();
MgByteReader mgByteReader = resService.GetResourceContent(resId);
String mapDefString = mgByteReader.ToString();
//mapDefString is always empty!
if (mapDefString != ""){
...
}
Thanks.
--
View this message in context: http://www.nabble.com/GetResourceContent-returns-empty-string-tf3549844s16610.html#a9910259
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list