• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk MapGuide Enterprise

    Reply
    Mentor
    Posts: 242
    Registered: ‎10-10-2003
    Accepted Solution

    GeoRest PUT with AIMS 2013

    1047 Views, 2 Replies
    08-02-2012 03:27 PM

    Hi All, has anyone tried a PUT with XML with GeoRest with AIMS 2013?

     

    I am getting an "Update Done" with a responseText but the data actually isn't updating.

     

    Any clues? I am using IIS 7.5

     

     

    Please use plain text.
    Mentor
    Posts: 242
    Registered: ‎10-10-2003

    Re: GeoRest PUT with AIMS 2013

    09-12-2012 09:36 PM in reply to: gluckett

    Steps to reproduce:

    1. Modify the existing restcfg.xml in the C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2013\www\GeoREST\conf\Sheboygan\Property\ folder to (A) point to AIMS and (B) Make XML editable:

    <Resource uripart="property">
    <Source type="MapGuide">
    <FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
    <FeatureClass>SHP_Schema:smileytongue:arcels</FeatureClass>
    <ServerIp>127.0.0.1</ServerIp>
    <ServerPort>2802</ServerPort>
    </Source>

    <Representation renderer="JSON" pattern=".json"/>
    <Representation renderer="XML" pattern=".xml">
    <Method name="GET" />
    <Method name="PUT" />
    <Method name="POST" />
    <Method name="DELETE" />
    </Representation>

     

    2. Restart IIS to refresh the Config in GeoRest 

     

    3. Test the site to make sure you can see the parcel data:

    georest_aims2013.png

     

    4. Now write the PUT code to change the RACRE from 14.25 to 500

    <script language=javascript>

    var xml='<?xml version="1.0" encoding="UTF-8" ?><FeatureSet><Features><Feature>';
    xml=xml+ '<Property><Name>RACRE</Name>';
    xml=xml+ '<Value>500</Value></Property>';
    xml=xml+ '</Feature></Features></FeatureSet>';


    var xmlhttp;
    if (window.XMLHttpRequest)
    {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.onreadystatechange = function(evt)
    {
    if(this.readyState == 4)
    {
    alert(this.responseText);
    }
    };
    xmlhttp.open("PUT",'http://localhost/rest/data/property/1.xml',true);
    xmlhttp.setRequestHeader("Content-Type","application/xml; charset=UTF-8");
    xmlhttp.send(xml);
    }
    </script>

     

     

    This returns "Update Done" but the data actually does not update (this worked with MG2011)

    Load the 1.html to verify 

    Please use plain text.
    Mentor
    Posts: 242
    Registered: ‎10-10-2003

    Re: GeoRest PUT with AIMS 2013

    10-06-2012 05:45 AM in reply to: gluckett

    Aha!  You need to remove the read-only tag - unfortunately, you have to install MapGuide Maestro because there is not an option (at least I can't find it) in Autodesk Infrastructure Studio 2013 to remove this flag from the Datasource.

     

    maestro_readonly_georest.png

    Please use plain text.