I am having a weird problem calling crossdomain web service in Silverlight 4.
Immediately after launch, the application calls the web service on the same host from where it was downloaded, but on a different port (for example, the application is located at http://www.mydomain.com:80 , and the web service is http: // www.mydomain.com:81 ). SSL is not involved. The host provides the proper clientaccesspolicy.xml file, and everything works correctly most of the time (for example, 99.9%).
However, in some cases, the browser does not request clientaccesspolicy.xml, and as a result, the webservice call is blocked and fails with a cross-domain error.
Typically, this is the sequence of queries that you see with the Fiddler or Chrome developer tools:
- index.html (the page hosting the silverlight application)
- Silverlight.js
- application.xap
- clientaccesspolicy.xml (requested and downloaded correctly)
- call webservice
In some cases, however, you only see
- index.html (the page hosting the silverlight application)
- Silverlight.js
- application.xap
- → cross-domain error (without clientaccesspolicy request, without calling a web service).
This only happens on a minority of machines (everything works under Windows 7), if all these conditions are true:
- the application works in Chrome, Firefox or outside the browser (IE always works)
- the first time the page loads (that is, if you click the browser reload button, the problem will disappear. Close / restart the browser and the first time you still have a problem)
- Fiddler does not work (if you run traffic through Fiddler, the problem disappears). However, the Chrome developer tools do not work.
- the machine is inside the same domain as the application server . If you go to a page from an external network (with the same device), there is no problem there.
On these machines, under these conditions, the problem is reproduced 100%.
What could be the reason for this? What steps can I follow to track the problem?
Francesco de vittori
source share