Exposing REST to Silverlight, nothing showing up
Hi, I'm running Windows Server 2008 64-bit. I'm running Essentials 2.4.0 and AGS 9.3.1 sp1. The Web ADF works fine but am having problems with the REST elements. If I access the REST end point directly, it works fine. Code below: I created a Site.xml with the above REST end point and is accepted, I can see it in http://myServer/Geocortex/Essentials/REST/sites. But nothing is displayed when I run in my Silverlight site with the following code: I'm using Firefox with Firebug and did not detect any problems. On the bottom status bar, it says "Transferring data from myServer..." Is this a permissions issue? I have just about gave permissions to everything on the server and still can't access it. On another note, the link to the geocortex sample server site works (http://sampleserver1.geocortex.com/geocortex/essentials/rest/sites/CharlotteArcGISOnline), but the when linked to my server (http://myServer/geocortex/essentials/rest/sites/CharlotteArcGISOnline), I get the same result. I have tried with the Flex viewer also, with the same problem. Anybody have any ideas on the next steps? Thanks, Scott
0
-
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 -
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 -
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 0 -
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 -
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). 0 -
Drew, worked like a charm. Thanks for all your help and the explanation, much appreciated!! 0
Please sign in to leave a comment.
Comments
6 comments