1

I have a .asmx web service which is hosted on IIS. I took the service reference and i am calling this web service from my silverlight application. But i am getting a communication exception as follows.

An error occurred while trying to make a request to URI 'http://test.bookmyshow.com/services/wsDebtorTrans.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.

I have added the required policy files (clientaccesspolicy.xml and crossdomain.xml) to my web service. Following is the content of my clientaccesspolicy.xml and crossdomain.xml

crossdomain.xml and clientaccesspolicy

I tried to access the above two files from my browser and the xml files are displayed properly in my browser. I have used basicHttpBinding. I have seen lot of tutorials online and tried them but still I am facing the same problem. Am I missing anything here? Please help me with this problem.

Gavin Miller
  • 43,168
  • 21
  • 122
  • 188
Madhur2479
  • 11
  • 6

1 Answers1

0

Just to clarify, you only need a CrossDomain.xml file OR a ClientAccessPolicy.xml file. You don't need both. Also, where did you put those files? Did you put it in the Services folder, or did you put it in the root of the server? For example, http://test.bookmyshow.com/ClientAccessPolicy.xml instead of http://test.bookmyshow.com/Services/ClientAccessPolicy.xml . The file should be put in the Root of your application and not the Services folder.

Joe McBride
  • 3,789
  • 2
  • 34
  • 38
  • Thank you for your reply. I have placed the file inside the services folder. Is this the right location ?. Just out of curiosity, is there any harm if i have included both crossdomain.xml and clientaccesspolicy.xml files in my web service – Madhur2479 May 10 '11 at 05:46
  • Updated my answer. The file should be in the root of your application and not the Services folder. There's not technically any harm with having both - Silverlight will just check for one before the other. However that means you have to keep both files up to date, and that creates a possible security hole (if your particular application cares about that). – Joe McBride May 10 '11 at 14:13