1

I have a simple AGS map service. I accidentally specified an invalid SRID explicitly in my Silverlight XAML:

<esri:Map x:Name="Map" IsLogoVisible="False">
    <esri:Map.Extent>
        <esri:Envelope XMin="526801.81" YMin="489775.0655" XMax="593105.41" YMax="523904.2045">
            <esri:Envelope.SpatialReference>
                <esri:SpatialReference WKID="3807" />
            </esri:Envelope.SpatialReference>
        </esri:Envelope>
    </esri:Map.Extent>
    <esri:Map.Layers>
        <esri:ArcGISDynamicMapServiceLayer x:Name="MyLayer" ID="MyService" Url="http://localhost/ArcGIS/rest/services/MyService/MapServer" Initialized="MyLayer_Initialized" InitializationFailed="Layer_InitializationFailed" />
    </esri:Map.Layers>
</esri:Map>

This results in a RESTful request that looks like this:

http://localhost/ArcGIS/rest/services/MyService/MapServer/export?bbox=526801.8125,479254.134305427,593105.4375,534425.146944573&size=1078,897&format=png24&transparent=true&layers=show:0,1&f=image&imageSR=3807&bboxSR=3807

This request fails with the following IIS error:

Error Summary

HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.

Detailed Error Information

Module  ESRI.RestModule-Integrated
Notification    ResolveRequestCache
Handler StaticFile
Error Code  0x00000000

If I replace the invalid SRID, everything works fine.

Is there any way to get the Silverlight API to report exceptions like this? As it is I have to use Fiddler to find it.

enter image description here

4
  • what spatial reference does 3807 refer to? Mar 2, 2011 at 18:16
  • spatialreference.org/ref/epsg/3087
    – nw1
    Mar 2, 2011 at 18:33
  • Typo? 3807 isn't a valid SRID. Do you still have this problem when using 3087? Mar 2, 2011 at 20:21
  • 1
    -1 For this question to be useful, I think it should be reframed around how to catch a 500 error in Silverlight. I searched a bit but don't see an easy way. Mar 3, 2011 at 14:40

1 Answer 1

1

It doesn't look like Esri supports this spatial ref:

Update: this seems to work:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/project?inSR=4326&outSR=3087&geometries={"geometryType":"esriGeometryPoint","geometries":[{"x":-82,"y":22}]}

I'm also interested in ways to trap a 500 error in silverlight.

Update: If we were working with WCF directly, it appears that Microsoft provides a way to catch this. However, since it is Esri's Map control making the calls, it seems like they would need to catch it. I don't see something for this in the Map control's list of events. Maybe the Map needs to expose something similar to Layer.InitializationFailed, that would let us catch these types of http errors without relying on Fiddler.

4
  • What do you mean when you say they don't "support" it? It's a perfectly valid SR.
    – nw1
    Mar 2, 2011 at 19:55
  • I think OP has a typo in the original post. It's 3087, not 3807. This works: sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/…{%22geometryType%22:%22esriGeometryPoint%22,%22geometries%22:[{%22x%22:-82,%22y%22:22}]} Mar 2, 2011 at 20:18
  • 2
    @Swingley Doh! You're totally right. But seriously ESRI... how on earth is 500 Internal Server Error the right response to an invalid SRID?
    – nw1
    Mar 2, 2011 at 20:24
  • 1
    Don't check this answer if it doesn't really answer your question. Someone from Esri might be more inclined to reply to an unanswered question. Mar 3, 2011 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.