<div dir="ltr">Thanks Hans,<div>I had actually abandoned everything for the REST service. But got stuck on the Make Selection and PUT aspects and my requests for help have gone unanswered so I appreciate this allot.</div><div>I will now revisit using the Maestro SDK although I really did like the idea of using the REST service..Jackie Really does do amazing work! I just wish I could ever get his work to work for me.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 2:33 AM, Hans Milling [via OSGeo.org] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=5231994&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

        This is how I would query a layer on a remote MapGuide server (I've cut bits and pieces fom my source):
<br><br><pre>// 1. Connect:
      private static IServerConnection mgconnection;
      private static IMapDefinition map_definition;
        mgconnection = ConnectionProviderRegistry.CreateConnection("Maestro.Http", "Url", url, "Username", username, "Password", password);
        map_definition = (IMapDefinition)mgconnection.ResourceService.GetResource("library://maps/mymap.mapdefinition");
            ModelSetup.Initialize(); // Needed if you use v1.3 or later resources
//2. Query the layer:
        ILayerDefinition layer_definition = null;
        foreach (IMapLayer layer in map_definition.MapLayer)
          if (layer.Name.ToLower() == "TestLayer")
          {
            layer_definition = (ILayerDefinition)mgconnection.ResourceService.GetResource(layer.ResourceId);
            break;
          }
IVectorLayerDefinition vlayer = layer_definition.SubLayer as IVectorLayerDefinition;
        IFeatureSource fs = (IFeatureSource)mgconnection.ResourceService.GetResource(vlayer.ResourceId);


      IFeatureService featSvc = (IFeatureService)mgconnection.GetService((int)ServiceType.Feature);


      using (IReader fsr = featSvc.QueryFeatureSource(vlayer.ResourceId, vlayer.FeatureName, "ColumnA=1234", new string[] { vlayer.Geometry }))
        {
        while (fsr.ReadNext())     
          {
            IGeometry geometry = fsr[vlayer.Geometry] as IGeometry
 // Do whatever you lik with the geometry
          }
        }
        return ret;
</pre><br>Best regards
<br>  Hans Milling...

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://osgeo-org.1560.x6.nabble.com/How-to-use-API-get-selection-geom-on-Remote-Server-using-a-GETRUNTIMEMAP-session-ID-tp5231522p5231862.html" target="_blank" rel="nofollow" link="external">http://osgeo-org.1560.x6.nabble.com/How-to-use-API-get-selection-geom-on-Remote-Server-using-a-GETRUNTIMEMAP-session-ID-tp5231522p5231862.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from How to use API (get selection geom) on Remote Server using a GETRUNTIMEMAP session ID?, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><b style="color:rgb(136,136,136);font-family:Calibri,sans-serif;font-size:14.6666660308838px"><span style="font-size:10pt;font-family:Tahoma,sans-serif;color:rgb(0,0,139)">Scott Hameister | <a href="http://www.mpowerinnovations.com/" style="color:rgb(17,85,204)" target="_blank" rel="nofollow" link="external"><span style="color:blue">www.mpowerinnovations.com</span></a><br>________________________________________<br></span></b><b style="color:rgb(136,136,136);font-family:Calibri,sans-serif;font-size:14.6666660308838px"><span style="font-size:10pt;font-family:Tahoma,sans-serif;color:gray">mPower Innovations</span></b><span style="font-size:9pt;font-family:Tahoma,sans-serif;color:gray"><br>1051 N Lynndale Drive, Suite 2A, Appleton, WI 54914<br></span><span style="font-size:10pt;font-family:Tahoma,sans-serif;color:gray">Main: <a href="tel:%28877%29%20269-6971%20x%20207" value="+18772696971" style="color:rgb(17,85,204)" target="_blank">(877) 269-6971 x 204</a> | Mobile: <a href="tel:%28920%29%20470-0292" value="+19204700292" style="color:rgb(17,85,204)" target="_blank">(920) 419-6250</a></span><span style="font-size:9pt;font-family:Tahoma,sans-serif;color:gray"></span></div></div>
</div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/How-to-use-API-get-selection-geom-on-Remote-Server-using-a-GETRUNTIMEMAP-session-ID-tp5231522p5231994.html">Re: How to use API (get selection geom) on Remote Server using a GETRUNTIMEMAP session ID?</a><br/>
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html">MapGuide Users mailing list archive</a> at Nabble.com.<br/>