Good Day all, I'm new to MapGuide and would appreciate a little assistance in getting over a hump. I'm trying to create a map object so I may query it later in my process. It seems that I'm not creating the map correctly. My code snippet is below and is called when my page loads. Seems as though the map object is not obtaining the sessionID. Can someone advise me as to what I'm doing incorrectly or provide recourses to get me going in the right direction.
MapGuideApi.MgInitializeWebTier(@"C:\Program
Files\Autodesk\MapGuideEnterprise2008\WebServerExtensions\www\webconfig.ini");
MgUserInformation userInfo = new MgUserInformation("Administrator",
"admin");
MgSite site = new MgSite();
site.Open(userInfo);
String sessionId = site.CreateSession();
//Associate a session ID with the MgSiteConnection Object
MgUserInformation userInfo_new = new MgUserInformation(sessionId);
MgSiteConnection siteConnection = new MgSiteConnection();
siteConnection.Open(userInfo_new);
MgResourceService resourceSrvc
=(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService
);
MgMap map = new MgMap(siteConnection);
MgResourceIdentifier resId = new
MgResourceIdentifier("Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition");
String mapName = resId.GetName();
map.Create(resourceSrvc, resId, mapName);
map.Save(resourceSrvc);
map.Open(resourceSrvc, mapName);
Many Thanks.
Nick Aizen
GCR & Associates, Inc.
2021 Lakeshore Dr., Suite 500
New Orleans, LA 70122
www.gcr1.com
(504) 304-2500 ext. 2320
Fax: (504) 304-2525
[cid:[email protected]]
<<inline: image001.gif>>
_______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users
