[mapguide-users] Using .NET Api to connect from a different Machine

Johann Nothbauer nothbauer at rmdata.at
Thu Jul 17 10:15:26 EDT 2008


Hi Kenneth!

Thank you for your fast answer.
I already changed the IpAdress in the "webconfig.ini" file. The 
MGSiteConnection works perfectly. It's the Resource-Service that I can't 
connect to (MgConnectionFailedException). Do you know which files I have 
to copy for to use the Resource Service?

Thany yo for the warning, I am absolutely aware of the security issues. 
My solution is designed for administrative access over local LAN only.


Kenneth Skovhede, GEOGRAF A/S wrote:
> The file "webconfig.ini" must be changed to point to the correct server 
> instead of "127.0.0.1".
> Its under the section [SiteConnectionProperties]
> IpAddress                          =127.0.0.1
> Port                               = 2812
> 
> You might also have to copy some of the folders referenced in there, 
> depending on what you want to do.
> I would not recommend doing this over the internet, because the data 
> transmitted over the wire ends up in the MapGuide server process which 
> runs in the "Local System Account".
> 
> Regards, Kenneth Skovhede, GEOGRAF A/S
> 
> 
> 
> Johann Nothbauer skrev:
>> Hi all!
>>
>> I'm trying to use the .NET Api to establish a connection to a Mapguide 
>> 2.0.1 Site without using a Web Viewer. My Application is a smart 
>> client and should run on a different Machine the MapGuide Server runs on.
>>
>> So I tried the following (in a Winforms Button_Click):
>>
>> MapGuideApi.MgInitializeWebTier("webconfig.ini");
>> // Connect to the site.
>> MgUserInformation userInfo = new MgUserInformation("Administrator", 
>> "admin");
>> MgSiteConnection siteConnection = new MgSiteConnection();
>> siteConnection.Open(userInfo);
>> MgResourceService resService = 
>> (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); 
>>
>>
>> This works so far, but when I try to use the Resource-Service like this:
>> MgResourceIdentifier resID = new MgResourceIdentifier("Library://");
>> MgByteReader resEnum = resService.EnumerateResources(resID, -1, "");
>>
>> the API throws get an "OSGeo.MapGuide.MgConnectionFailedException" 
>> (Message: "Cannot establish connection").
>>
>> The same code works on the MapGuide Server Machine.
>>
>> Is it possible to use the API to connect to a Mapguide Server on a 
>> different machine? Or do I have to use the Web-API (XML) over HTTP? I 
>> can change all my firewall rules, no problem.
>>
>> Any Ideas?
>> Thanx,
>> Nothi
>>
>>
>>
>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users



More information about the mapguide-users mailing list