Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Silverlight
Good Morning,
 
I am having a peculiar problem where it seems that a Silverlight 4 app running in Internet Explorer is ignoring both the clientacesspolicy.xml and crossdomain.xml. The problem does not occur in Firefox or Chrome.
 
I am accessing an asmx web service on a client's public facing site. I did not write the service but I do have the ability to tweak or move the clientaccesspolicy.xml file.
 
In Fiddler, clientaccesspolicy.xml is located and downloaded and the response looks correct. However, then the app goes ahead and also accesses crossdomain.xml, which is also downloaded successfully. When the app then tries to hit the service I get a cross domain error.
 
Clientaccesspolicy.xml is in the web root and I can browse to it in the address bar of IE. The content of it looks like this:
 
<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>
 
I've tried also adding
<domain uri="http://*"/><domain uri="https://*"/>
and explicit access to the domain hosting the Silverlight app. I've also tried changing the the fourth line to
<allow-from http-request-headers="SOAPAction">
 
I've reduced the Silverlight app to the bare minimum of code required to call the service...
 
Public Sub New()
        InitializeComponent()
       
        Dim serviceProxy = New DistrictOfficialsSoapClient()
        AddHandler serviceProxy.GetElecAuthCompleted, AddressOf GetElecAuth_Complete
        serviceProxy.GetElecAuthAsync("5")
 
    End Sub
Private Sub GetElecAuth_Complete(ByVal sender As Object, ByVal args As GetElecAuthCompletedEventArgs)
 
        If args.Error Is Nothing Then
            MessageBox.Show(args.Result.ToString)
        Else
            MessageBox.Show(args.Error.Message)
        End If
    End Sub
 
I've tested the same code against other asmx web services on other domains and had success, so I don't think it's an IE setting. I've tested it against other services on the same site and had the same problem.
 
I've tested it on multiple machines. In both the VS internet server and IIS. I've tested it with Fiddler open and Fiddler closed. I've tried it in various versions of IE.
 
What is missing from the clientaccesspolicy.xml?
 
Thank you!!
Posted 18-Jan-13 5:38am
jesslc105

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 166
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100