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

Zac Spitzer zac.spitzer at gmail.com
Mon Aug 11 13:30:43 EDT 2008


http://trac.osgeo.org/mapguide/ticket/659

On Tue, Aug 12, 2008 at 3:13 AM, Zac Spitzer <zac.spitzer at gmail.com> wrote:
> I have just hit this as well... using the java api with coldfusion.
>
> Johann, can you file a bug?
>
> z
>
> On Fri, Jul 18, 2008 at 12:21 AM, Kenneth Skovhede, GEOGRAF A/S
> <ks at geograf.dk> wrote:
>> AFAIK, it should work then.
>> Do you have both port 2812 and 2811 open on both machines?
>>
>> Since you are using .Net, you could also use the Web API.
>>
>> I have wrapped most of the calls in the MaestroAPI, so they appear to be
>> native .Net classes:
>> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Johann Nothbauer skrev:
>>>
>>> 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
>>>
>>> _______________________________________________
>>> 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
>>
>
>
>
> --
> Zac Spitzer -
> http://zacster.blogspot.com (My Blog)
> +61 405 847 168
>



-- 
Zac Spitzer -
http://zacster.blogspot.com (My Blog)
+61 405 847 168


More information about the mapguide-users mailing list