[mapguide-users] Getting exception with Open method of MgMap Object

Kenneth, GEOGRAF A/S ks at geograf.dk
Thu Apr 10 11:14:07 EDT 2008


You must create and save the runtime map (MgMap.Create/MgMap.Save) 
before you can open it.
The viewer does this for you, and it will overwrite an existing runtime map.
If you belive the map is already created, you must obtain the session id 
from the viewer.
You cannot create a session and read the map from another session.

You probably want to remove the first 6 lines of code, and pass in the 
sessionId by querystring.

Regards, Kenneth, GEOGRAF A/S



Nick Aizen skrev:
>
> Having some trouble with the MapGuide API, we installed MapGuide 
> Enterprise 2008 ,we are using asp.net and c # with the MapGuide API. 
> I'm trying to have my page when it initially loads, use a map feature 
> service to filter and select parcels. All seems to work except when I 
> try to open a map object, I get the following exception:
>
>  
>
> /OSGeo.MapGuide.MgResourceNotFoundException was unhandled by user code/
>
> /  Message="Resource was not found: 
> Session:eb1f513e-ffff-ffff-8000-001c23a550ea_en_C0A800020AFC0AFB0AFA//Sheboygan.Map"/
>
> /  Source="MapGuideDotNetApi"/
>
> /  StackTrace:/
>
> /    - MgResourceServiceHandler.ProcessOperation line 80 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceServiceHandler.cpp/
>
> /    - MgOpGetResourceData.Execute line 132 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\OpGetResourceData.cpp/
>
> /    - MgServerResourceService.GetResourceData line 1416 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ServerResourceService.cpp/
>
> /    - MgApplicationRepositoryManager.GetResourceData line 1194 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ApplicationRepositoryManager.cpp/
>
> /    - MgResourceContentManager.GetDocument line 590 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceContentManager.cpp/
>
> /    - MgResourceDefinitionManager.GetDocument line 476 file 
> c:\build_bond_area\bond_nightly\build_41.3\ent\os\server\src\services\resource\ResourceDefinitionManager.cpp/
>
>  
>
> *Here's my code below:*
>
>  
>
>     String webLayout = "Library://DevTV/HelloWorld.WebLayout";
>
>     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();
>
>     map.Open(resourceSrvc, mapName);
>
>  
>
>  
>
> Do I need to perform certain steps in a certain order to get this to 
> work? I would appreciate any help with this issue.
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>
> *Nick Aizen*
>
> GCR & Associates, Inc.
>
> 2021 Lakeshore Dr., Suite 500
>
> New Orleans, LA 70122
>
> www.gcr1.com <http://www.gcr1.com>
>
> (504) 304-2500 ext. 2320
>
> Fax: (504) 304-2525
>
>  
>
> cid:338554203 at 20092007-3664
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>
> *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:338554203 at 20092007-3664
>
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
Skipped content of type multipart/related


More information about the mapguide-users mailing list