Silverlight application not funcitoning - silverlight

I have made a silverlight application for drag and drop uploading. Now, this application works fine when I deploy it from local server. But whenever I deploy it from QA server (machine on the same LAN but has a global ip associated with it), it does nothing. It just shows a white background screen (default parameter). There is no error that it couldn't find xap file or such, neither any other console errors as well.
I can't seem to figure out what the error is for.
As suggested by some other blogs and posts, I have tried to change the extension from xap to DLL, but still same thing.
Please help.

To access a silverlight app on a remote server, you need to put on the root folder of this server a ClientAccessPolicy.xml file.
A basic one, allowing you to use it from any domain:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from>
<Domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
More details here:
http://msdn.microsoft.com/fr-fr/library/cc197955%28v=vs.95%29.aspx

Related

BingMaps Silverlight can not use tilesouce that is http, only https works

I've been following a whole bunch of tutorials on how to get overlays working in bing maps silverlight and they all appear to not even mention this problem of mine.
Example of tutorial: https://alastaira.wordpress.com/2011/01/07/accessing-a-wms-tile-server-from-bing-maps-silverlight/
What is happening is i set the tilesource to something like: "http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/germany/germany.map&&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG%3A4326&BBOX={0}&WIDTH=256&HEIGHT=256&LAYERS=Bundeslaender"
When i run the application and check the calls with fiddler not a single call is made to this service. If i change the source to start with https then the calls are seen in fiddler.
I also tried spinning up a webclient and doing a get request on http://google.com and fiddler actually recorded a call to http://google.com/clientaccesspolicy.xml which seems to be in line with how its supposed to work.
I have the following xml files in my website root.
ClientAccessPolicy.xml
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<!-- IMPORTANT! Include these lines -->
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
crossdomain.xml
<cross-domain-policy>
<allow-access-from domain="*.*" headers="SOAPAction"/>
<allow-http-request-headers-from domain="*.*" headers="SOAPAction"/>
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>
Anyone have any ideas? It just seems like the bingmaps SDK just refuses to even attempt an http call.
If your own Silverlight app is hosted on https, it cannot make requests to any http sites. I assume this is the reason - otherwise it should work

Silverlight cross domain error while working in the same domain

I'm trying to access an .asmx web service with ssl and silverlight client application,
things I have done:
1. I have a crossdomain.xml (only need clientaccesspolicy.xml or crossdomain.xml).
2. I have the tag in the serviceReferences.ClientConfig file.
3. when I call the webservice with ssl ("https:// . . .") I get the cross domain error
and when I change the access point to be without ssl ("http:// . . .") It works!
4. I browsed the webservice address with and without ssl, boath works.
how can I get a cross domain error while working at the same domain?...
Make sure you have proper entry for the SSL in the clientaccesspolicy.xaml. You can check out on msdn http://msdn.microsoft.com/en-us/library/cc645032%28v=vs.95%29.aspx. However if your web service is hosted in the same web application as the Silverlight application you can pass a relative path to WS in the endpoint configuration of the client (.ClientConfig) and the crossdomain/clientaccesspolicy files won't be required. For example, instead of using address="http://localhost/Services/ExampleService.asmx" use sth like address="../Services/ExampleService.asmx" (depending on the folder in which the XAP file is located).
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
<domain uri="http://*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Like this.
For not obvious reason <domain uri="http://*" /> actually helps

clientaccesspolicy.xml not being called

I'm currently trying to put a silverlight web part in place onto our intranet.
As I do not have access to the ClientBin folder of the SharePoint 2010 box, I created a simple list and a content editor web part to host my app.
The silverlight app runs correctly from my local machine (xxxx.int.mydomain.com) but not from the SharePoint site (siteTest.int.mydomain.com).
This app is calling a web service hosted at: http://xxx.mydomain.com/yyy/ws.asmx
I get the following error message:
An error occurred while trying to make a request to URI
'http://xxx.imd.ch/yyy/ws.asmx'.
This could be due to attempting to access a service in a cross-domain
way without a proper cross-domain policy in place, or a policy that is
unsuitable for SOAP services. You may need to contact the owner of the
service to publish a cross-domain policy file and to ensure it allows
SOAP-related HTTP headers to be sent. This error may also be caused by
using internal types in the web service proxy without using the
InternalsVisibleToAttribute attribute. Please see the inner exception
for more details. System.
The clientaccesspolicy.xml file reads:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Calling the clientaccesspolicy from the browser is working fine:
<?xml version="1.0" encoding="utf-8" ?>
- <access-policy>
- <cross-domain-access>
- <policy>
- <allow-from http-request-headers="*">
<domain uri="*" />
</allow-from>
- <grant-to>
<resource path="/" include-subpaths="true" />
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
When I use fiddler to try to understand what's happening, I cannot see any request to any xml file.
Could it be related to any specific thing with SharePoint 2010. How could I debug it further?

silverlight crossdomainpolicy.xml file problem

I have made a silverlight application and I have hosted it on my localhost IIS. and the URL of this application is http://localhost/default.aspx I have developed and other xml-rpc server which is also running on same machine and its address is https://localhost:8000, I am having problem in calling the remote functions from the url https://localhost:8000 I want to know that where should I place the clientaccesspolicy.xml and what should be the contents of that xml file specifically for this case?
You would need to put a clientaccesspolicy.xml file in the root folder of the web site at port 8000.
It could be something like this (although you should decide what the proper security would be best for you scenario):
<?xml version=""1.0"" encoding=""utf-8""?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers=""*"">
<domain uri=""*""/>
</allow-from>
<grant-to>
<resource path=""/"" include-subpaths="" true""/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>

Still having issues with my cross domain policy in Silverlight 3.0

So I'm using both xml files listed below with no luck. They both exist in the root of my IIS hosted web service on a different web server (behind the firewall). The web service is a simple POX like service that returns a JSON string.
Also I'm trying to get access to this service from a cassini run project on my local machine (to test it out). I can view the JSON from a browser but get a security error in silverlight when I try to do an HTTP GET using the same uri (4004 is the error code shown)
Anything simple that I missed here?
clientaccesspolicy.xml
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
crossdomain.xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only" />
<allow-access-from domain="*" secure="true" />
</cross-domain-policy>
Are you using a tool like fiddler to see what address the request for the cross domain policy file is pointed at? That's usually my first check; if the policy file isn't being found I'll know where it's supposed to be and if it is then I usually need to look elsewhere.
Your clientaccesspolicy.xml is identical to my reference one. Should be no problems there.
If you get a 404 response code, the only reason can be that the server can not find the resource you are looking for. So are you absolutely sure you are using the correct url?

Resources