Infrastructure Map Server Developer

New Member
Posts: 2
Registered: ‎02-17-2009
Message 1 of 2 (133 Views)

MgServiceNotSupportedException: The specified service is not supported

133 Views, 1 Replies
02-17-2009 02:38 AM

I would like to enumerate all resources but I get an Exception everytime I try to get a MgResourceService object:
"org.osgeo.mapguide.MgServiceNotSupportedException: The specified service is not supported."

But when I browse MapAgent ( Services API > "Resources" > "EnumerateResources"), I can retrieve the resources.

Here the source code I'm using:
MapGuideJavaApi.MgInitializeWebTier("C:\\Program Files\\MapGuideOpenSource2.0\\Server\\Bin\\serverconfig.ini");
MgUserInformation cred = new MgUserInformation("Administrator", "admin");

// Connect to the site and get a feature service and a resource service instances
MgSiteConnection siteConn = new MgSiteConnection();

// Create a session repository
MgSite site = siteConn.GetSite();
sessionId = site.CreateSession();

MgResourceService resourceSrvc = (MgResourceService)siteConn.CreateService(MgServiceType.ResourceService);

// Enumerates all maps in the library
MgResourceIdentifier resourceId = new MgResourceIdentifier("Library://");
MgByteReader mgBR = resourceSrvc.EnumerateResources(resourceId, -1, "MapDefinition", false);
catch(MgException mge)

I checked in MapAdmin if the service was well set... but I have seen nothing wrong.

Thanks to post a suggestion if you have an little idea.

Edited by: kdelcroix on Feb 17, 2009 10:40 AM
Added "code" tags Edited by: kdelcroix on Feb 17, 2009 10:41 AM
Better visibility of the line generating the error
New Member
Posts: 2
Registered: ‎02-17-2009
Message 2 of 2 (133 Views)

Re: MgServiceNotSupportedException: The specified service is not supported

02-17-2009 07:22 AM in reply to: kdelcroix
If found the error: the file I gave to the initializer was not the good file. Here is the good line code for the initializer:
MapGuideJavaApi.MgInitializeWebTier("C:\\Program Files\\MapGuideOpenSource2.0\\WebServerExtensions\\www\\webconfig.ini");

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community