Skip to main content

Exposing REST to Silverlight, nothing showing up

Comments

6 comments

  • Drew Millen
    Hi Scott,   I have a suspicion that you are witnessing a symptom of Silverlight's built-in protection against cross-domain access (that is, a Silverlight client application making requests to multiple domains).  In this case, a request is sent to the Site hosted on the REST server; however, another request is sent to the server hosting ArcGIS Server.   If this is indeed the problem, there's a simple solution.  You can place a file called "clientaccesspolicy.xml" in the root of your server hosting ArcGIS Server (that is, at C:\Inetpub\wwwroot).  We have done this to our "sampleserver1.geocortex.com" server, which is why the error doesn't happen when you use the Charlotte sample site.   To learn more about this, and to discover the contents of the clientaccesspolicy.xml file, take a look at the MSDN article here: http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspx   I hope this helps!   Drew.

     

    0
  • Permanently deleted user
    Hey Drew, I confirmed that the clientaccesspolicy.xml exists on my wwwroot of ArcGIS Server. When I tap into the REST endpoint directly (ie. http://myServer/arcgis/rest/services), I see my services and can consume the resources in my silverlight application. Only when I create my Site.xml and reference the ArcGIS REST endpoint, it doesn't work. That's why I thought it was a permissions issue. I uninstalled and deleted all related files with Essentials and did a fresh install and still have the same problem. Scott

     

    0
  • Drew Millen
    Hi Scott,   I spoke with a couple of the developers here and we have a few suggestions:   1.) Can you run the Silverlight application using "(http://www.fiddler2.com/fiddler2/) Fiddler ", and interrogate the request to the client access policy?  I'd like to confirm that you receive a 200 response when requesting the client access policy.  Fiddler may also give you some insight to the issue if this is not the problem.   2.) The issue could be related to Internet/intranet zones... if you are hosting your Silverlight application on a website on the Internet (or that your browser thinks is in an Internet zone), and then the Silverlight application makes a connection to a more restrictive zone (i.e., an intranet zone), the symptoms you are experiencing could show up.  There's a lot of information about this topic here: http://msdn.microsoft.com/en-us/library/cc189008(VS.95).aspx  

     

    I hope this gives you some direction, and some clues about what the problem might be.  Please let me know how it goes.   Drew.

     

    0
  • Permanently deleted user
    Drew,   Thanks. I installed Fiddler and I am receiving a 200 response when requesting the client access policy so that's good to go.   I checked the json response from ArcGIS REST Endpoint directly and it works fine. When using the Essentials REST endpoint at this location (http:///Geocortex/Essentials/REST/sites/test?f=json), it gives the following: {"id":"test","displayName":"test01","hasNamedExtents":false,"hasPrintTemplates":false,"hasOverviewMap":false,"hasNorthArrow":false,"hasVirtualDirectory":false,"properties":[],"extensions":[]}   When I run the silverlight app, the json request (http:///Geocortex/Essentials/REST/sites/test?f=json&ts=634268068319349988&v=3.0), throws the following error: {"error":{"code":500,"hresult":-2147467259,"message":"The requested version is unavailable or unknown.","details":["The requested version is unavailable or unknown."]}}   I also dropped/lowered all security for my ArcGIS Server - Internet/Intranet. I hope this json error is easy to correct. Any more hints you could provide would be awesome. Thanks. Scott

     

    0
  • Drew Millen
    Hi Scott,   It would seem the problem has revealed itself: It looks like you are using a 2.X version of our Silverlight API to access a 2.X version of the Geocortex Essentials REST API, which isn't permitted (2.X client APIs require the 3.X version of our Geocortex Essentials REST API)... but read on.   When released Geocortex Essentials 3.0, we released 2.0 versions of the client APIs to work with it.  In the case of Silverlight, the 2.0 API is also compiled with Esri's 2.0 Silverlight API.   If you are going to use a 2.X version of Essentials then you will need to use a 1.X version of our Silverlight API (and therefor a 1.X version of Esri's Silverlight API).   Now... my recommendation is to upgrade to the latest version of Geocortex Essentials (3.1 is available today and we're planning on releasing 3.2 as soon as the end of this week).

     

    With Essentials 3.X, you can use the REST technology to point to ArcGIS Server 9.3/9.3.1 as well as ArcGIS Server 10 so you don't have to worry about upgrading to ArcGIS Server 10 just yet.   Let me know if you have any other questions about versioning.   Drew.

     

    0
  • Permanently deleted user
    Drew, worked like a charm. Thanks for all your help and the explanation, much appreciated!!

     

    0

Please sign in to leave a comment.