[mapguide-internals] Intergrating DWF Viewer of MapGuide Enterprise 2009 into Windows Forms

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Fri Aug 29 05:53:41 EDT 2008


You might want to have a look at the Web API:
http://localhost/mapguide/mapagent/index.html

That page has test forms for most of the avalible Web API methods,
including CreateSession (it's under Others).

Using the .Net WebClient class, it is very easy to send a request that 
mimics the form,
and reads out the sessionId.

If you want to skip some of the work, I have done so already in the 
MaestroAPI (C# code):
http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI

This is the code you would use to create a session, and grab the ID:

' Create HttpServerConnection object with credentials enabling establishing a session
ServerConnectionI con = new HttpServerConnection(new Uri("http://server/mapguide/mapagent/mapagent.fcgi")
, "Administrator", "admin", "en", True);

'Grab the id
string sessionId = con.SessionID;


If the sessionId is your only worry, I think you can also pass the 
querystring: "&USERNAME=Administratror&PASSWORD=admin" instead of the 
session id.

Regards, Kenneth Skovhede, GEOGRAF A/S



Carl Jokl skrev:
>
> Carl Jokl wrote:
>   
>> It looks like in order to build the URL in the right format that the
>> viewer will expect I need to use some of the MapGuide api to establish a
>> session and pass the id of that session to the DWF Viewer. Would the
>> MapGuide API classes work when running on a client computer or do the
>> MapGuide API Classes only work when running on the same host as the
>> MapGude Enterprise server?
>>
>>     
>
> Scratch that. I am not going to use the MapGuide classes in the client
> application. I am going to add some functionality to a existing Http Handler
> portal on the web server to do that for me. I can just get the client
> application to communicate and authenticate via that and the portal will
> return the mapguide session id as well as other details needed to form the
> correct url
>   


More information about the mapguide-internals mailing list