jumpinjackie / mapguide-rest

REST Extension for MapGuide Open Source
GNU Lesser General Public License v2.1
26 stars 14 forks source link

GET /session/{session}/{resName}.LayerDefinition/features.{type} issue #183

Closed AlenKelemen closed 6 years ago

AlenKelemen commented 6 years ago

After {session} an additional slash is added by rest code:

image

jumpinjackie commented 6 years ago

But that is a how a session-based resource id is formatted. There is meant to be // after the session id.

Are you sure the session wasn't expired?

AlenKelemen commented 6 years ago

Maybe I am doing it in the wrong way, please check the following:

  1. Run Seboygan WebLayout in browser (session is active) http://localhost/mapguide/mapviewerajax/?WEBLAYOUT=Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout&LOCALE=en
  2. Get SessionId (in Chrome developer tools using getSessionId() viewer API)
  3. Copy/paste SessionId and resName (Buildings) in mapguide-rest API Reference under GET /session/{session}/{resName}.LayerDefinition/features.{type} so request is like: http://localhost/mapguide/rest/session/8a14f6cc-33f8-11e8-8000-f0d02e3efe7f_en_MTI3LjAuMC4x0AFC0AFB0AFA/Buildings.LayerDefinition/features.geojson

I get response: Type": "mgresourcenotfoundexception"

jumpinjackie commented 6 years ago

Did you copy the Buildings layer into your session repository first? If you haven't, I would expect a mgresourcenotfoundexception because when you init a weblayout, the only thing in your session repository when it's created will be a runtime map state and selection resources and nothing else.

AlenKelemen commented 6 years ago

Thanks for explanation, I get it now...