[mapguide-users] How to use API (get selection geom) on Remote Server using a GETRUNTIMEMAP session ID?

Flipper scotth at mpowerinnovations.com
Tue Oct 20 14:43:19 PDT 2015


I have gotten a little closer (I think) by attempting to use a generic INI
file from Maestro
now getting the Error: Session has expired or is invalid. Please log in
again. The session
(50d06814-7772-11e5-8000-02e11e7a2023_en_MTI3LjAuMC4x0AFC0AFB0AFA) has
expired. 

string IPAddress = "http://www.MyRemoteServer.com/mapguide";
string MyMapDef = "Library://ROOTFOLDERE/Maps/MYMAP.MapDefinition";
//Maestro INI file
string WebConfigLocation = @"C:\Program Files (x86)\OSGeo\MapGuide Maestro
6.0m4\AddIns\Local\Platform.ini";
requestoutput = new WebConnect().WebRequest( IPAddress +
"/mapagent/mapagent.fcgi?OPERATION=CREATERUNTIMEMAP&MAPDEFINITION=" +
MyMapDef +
"&REQUESTEDFEATURES=7&VERSION=2.6.0&USERNAME=Administrator&PASSWORD=admin&clientagent=Ajax%20Viewer&targetMapName=TESTER1023&iconFormat=PNG");
m_xmld.LoadXml(requestoutput);
RuntimeMap obj = new RuntimeMap();
using (XmlReader reader = XmlReader.Create(new StringReader(requestoutput)))
{
	obj = (RuntimeMap) new 
XmlSerializer(typeof(RuntimeMap)).Deserialize(reader);
}
MapGuideApi.MgInitializeWebTier(WebConfigLocation);
MgUserInformation mguserinformation = new MgUserInformation();
mguserinformation.SetMgSessionId(obj.SessionId); ;
mguserinformation.SetClientAgent("Ajax Viewer");
mguserinformation.SetClientIp(IPAddress);
MgSite mgsite = new MgSite();
mgsite.Open(mguserinformation);

Any help would be greatly Appreciated
			

			



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-use-API-get-selection-geom-on-Remote-Server-using-a-GETRUNTIMEMAP-session-ID-tp5231522p5231534.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list