In the Preview stuff (technical term) - the GeoRest is installed.from the C:\Autodesk\Autodesk_Infrastructure_Map_Server_2012_English_Win_64bit\TechnologyPreview
I have it working great on IIS for direct connect (i.e. FDO Features) but when I connect to AIMS 2012 - I get "MgConnectionFailedException".
I know GeoRest is configured ok since it works with direct connect data (i.e. path to SDF or ConnectString to SQL Server).
I am testing with the config.xml that comes with the GeoRest and points to the sample dataset (installed).
<Resource uripart="propertymap">
<Source type="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
</Source>
I know I have Library://Samples/Sheboygan/Data/Parcels.FeatureSource available.
Any tips?
gordon
Solved! Go to Solution.
Solved by gluckett. Go to Solution.
Discovered the issue. The ports changed with AIMS 2012.
Old connection
<Resourceuripart="property">
<Sourcetype="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
<ServerIp>192.168.0.33</ServerIp>
<ServerPort>2812</ServerPort>
</Source>
</Resource>
NOW WITH AIMS 2012 the server port is "2822"
<Resourceuripart="property">
<Sourcetype="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
<ServerIp>192.168.0.33</ServerIp>
<ServerPort>2822</ServerPort>
</Source>
</Resource>
Now I'm able to access the source type "mapguide" and use the example "Property" parameters via the url http://localhost/rest/data/property_/11530.html
The attribute were displayed without problem, but it can't to generate the map image!
<tr>
<td width="200">Image Representation</td>
<td><a href="../www/Image/{{PROPERTY_Autogenerated_SDF_ID}}.png">{{PROPERTY_Autogenerated_SDF_ID}}.png</a></td>
</tr>
Anyone have idea? Thanks.
Make sure that line 83 "Image" is configured.
C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\GeoREST\conf\SheboyganMap\restcfg.xml
This uses the AIMS Sheboygan map to get the image.
http://localhost/rest/data/Image/11530.png
Thanks.
I did changed the serverport. The error message "Failed to retrieve message for "MgConnectionFailedException"." is disappear, but the image cannot be generated properly! The webpage(http://127.0.0.1/rest/data/Image/1.png) is empty in IE7. I think the problem is the PNG image generation. 😞
The image component comes from the config file
C:\Program
Files\Autodesk\Autodesk Infrastructure Web Server Extension
2014\www\GeoREST\conf\SheboyganMap\restcfg.xml
Around line 83
<Resource uripart="Image">
<Source type="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
<ServerIp>127.0.0.1</ServerIp>
<ServerPort>2812</ServerPort>
</Source>
be sure that the Port is correct. Check out your serverconfig.ini to ensure 2812 is correct...
Thanks.
I think it seems that it is caused by the image path, because I tried to change the server ip or server port of the rectcfg file. The image box will show a cross symbol in IE browser, if the wrong port was used. The following screen capture shows the difference server port were used.
So the MGP for Sheboygan was loaded on your AIMS server in the default folders?
The PORT is correct?
In my class at AU, I use the defualt Autodesk installs and tweak the xml to ensure it is correctly installed.
The "IMAGE" path requires that Sheboygan is available and that you are using AIMS (with IIS).
Eventually it works! The map can be generated, but it is only support the feature type which is the polygon type! Is it true? Once I used the point feature, the message "Failed to retrieve message for "MgInvalidArgumentException". [SETVIEWSCALE] = "0" Failed to retrieve message for "MgValueCannotBeLessThanOrEqualToZero"." will prompt.
Hi 🙂
I don't know if you noticed that GeoRest actually generate PNG/JPEG images slowly. It took about 30 secs to generate every PNG images in my case.
Therefore, you will not see the images showed up properly on your GeoRest many/single template pages.
In my opinion, you can probably use C# or other programming languages to create a small GeoRest images pre-geneartion application to generate all the images that you need.
The code will be very similar as following:
int start = Int32.Parse(StarttextBox.Text);
int end = Int32.Parse(EndtextBox.Text);
for (int i = start; i <= end; i++)
{
string sourceUrl = @"http://localhost/rest/data/test/" + i.ToString() + ".png";
string localPath = @"C:\inetpub\wwwroot\test\png\" + i.ToString() + ".png";
byte[] imageBytes;
HttpWebRequest imageRequest = (HttpWebRequest)WebRequest.Create(sourceUrl);
WebResponse imageResponse = imageRequest.GetResponse();
Stream responseStream = imageResponse.GetResponseStream();
using (BinaryReader br = new BinaryReader(responseStream))
{
imageBytes = br.ReadBytes(500000);
br.Close();
}
responseStream.Close();
imageResponse.Close();
FileStream fs = new FileStream(localPath, FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
try
{
bw.Write(imageBytes);
}
finally
{
fs.Close();
bw.Close();
}
Hope that will help you 🙂
Before anybody gets too excited, mapguide-rest is not production-ready yet.
There's still some security hardening to be done before I can safely say that you can put this to production use.
Sure, download the current release to have a play around and see what it can do, but I strongly discourage production deployment at this point in time, especially on public-facing MapGuide/AIMS installations.
- Jackie
Is there someone try to use the post/ put of georest? I want to update/ create a new entries for the specific SDF connection. How can I generate the SHPGEOM from the fusion viewer? 🙂
<Name>SHPGEOM</Name>
<Value>
POLYGON ((-87.750602148149582 43.772512943108723, -87.750820980626941 43.772509600594994,
-87.751112034446564 43.772505154303111, -87.751191267124568 43.772701180970984, -87.750821769925366
43.772706826945878, -87.750681379906538 43.77270897188734, -87.750664555803112 43.772667347110961,
-87.750602148149582 43.772512943108723))
Check out the classic GeoREST (Comes with AIMS) how to put post and get data to a SDF or SHP.
He is my presentation at Autodesk University.