Re[mapguide-users] dlining error

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Fri Jul 18 09:23:10 EDT 2008


There is a class map together with the documentation:
http://mapguide.osgeo.org/2.0/documentation.html

This can be found in the Web API documentation:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/index.htm

The specific class is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature_service.htm

And the "CreateService" is here:
http://mapguide.osgeo.org/files/mapguide/docs/webapi/df/d57/class_mg_site_connection.htm


As for dll, that depends... the class you are seeing is in 
MapGuideDotNetApi.dll, but it is actually a wrapper
for the other dll files in that folder.

Regards, Kenneth Skovhede, GEOGRAF A/S



Marius_360 skrev:
> Where does the OSGeo.MapGuide.MgService come from, in other words, in which
> dll in the bin folder?
>
>
>
> Kenneth Skovhede, GEOGRAF A/S wrote:
>   
>> So you are using JScript .Net?
>>
>> In that case you might have to typecast it:
>>
>> var featureService =
>> (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
>>
>> Not completely familiar with JScript.Net, but the error seems to 
>> indicate that the object (featureService) is of type MgService.
>> MgService is a base class, and also the signature return type for 
>> CreateService.
>> The actual type of the object returned is MgFeatureService.
>>
>> Regards, Kenneth Skovhede, GEOGRAF A/S
>>
>>
>>
>> Marius_360 skrev:
>>     
>>> This is exactly how I had it from the beginning, but it gives me “Objects
>>> of
>>> type 'OSGeo.MapGuide.MgService' do not have such a 
>>> member” error
>>>
>>>
>>>
>>> Carl Jokl wrote:
>>>   
>>>       
>>>> I will assume this must be JScript .Net because what you are doing could
>>>> not work at all otherwise but I see the problem in the code:
>>>>
>>>> var featureService = new MgFeatureService(); //You explicity create a
>>>> new
>>>> feature service. This is wrong
>>>> //This method call retrieves the feature service from the site
>>>> connection
>>>> but you are not storing the //returned value
>>>> siteConnection.CreateService(MgServiceType.FeatureService);
>>>> //This will not work because you explicity created this feature service
>>>> instead of getting it from the feature ///service
>>>> featureService.CreateFeatureSource(resourceIdentifier, sdfParams) 
>>>>
>>>> I am not completely familiar with JScript .Net but I would think that
>>>> this
>>>> should be
>>>>
>>>> //Get the feature service from the site connection, don't create it
>>>> explicity.
>>>> var featureService =
>>>> siteConnection.CreateService(MgServiceType.FeatureService);
>>>> //Assuming you correctly created the resource identifier and the sdf
>>>> params elsewhere this should work
>>>> if (featureService) //Checking the returned feature service was not null
>>>> just in case.
>>>> {
>>>>      featureService.CreateFeatureSource(resourceIdentifier, sdfParams);
>>>> }
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080718/66b059e4/attachment.html


More information about the mapguide-users mailing list