I need some help regarding WCF Services. Situation is one thing such as this, I've designed a website project insinternet 4. after which I added a Silverlight-Enabled WCF service using the title AdminService.svc. I authored a couple of techniques within this service, obviously, built them into [OperationContracts]. I Quickly produced another Silverlight 5. project within the same workspace and attempted to eat the service (AdminService.svc), added it's reference within this project (We must bear in mind that AdminService is running in another website type project within the same workspace). However each time I run the applying and then try to call a technique which simply return some data, I recieve this error !
A mistake happened while attempting to make a request to URI
'http://localhost:2850/XYZServices/AdminService.svc'. This may be because of trying to gain access to something inside a mix-domain way with no proper mix-domain policy in position, or perhaps a policy that's unacceptable for Cleaning soap services. You may want to contact who owns the plan to create a mix-domain policy file and also to ensure it enables Cleaning soap-related HTTP headers to become sent. This error can also be triggered by using internal types within the web service proxy without needing the InternalsVisibleToAttribute attribute. Please visit the interior exception for additional particulars.
Apparent response to this issue would be to give a crossdomain.xml and clientaccesspolicy.xml, right? I've each of them in position during my wcf website type project at the bottom level using the following content,
<?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 include-subpaths="true" path="/"/> </grant-to> </policy> </cross-domain-access> </access-policy>
and also the other one
<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-http-request-headers-from domain="*" headers="*"/> </cross-domain-policy>
Kindly assist me of the, it's becoming difficult now.
I've observed that the single error within the clientaccesspolicy.xml file may cause this message.
When copying this content from the file of the web site (blog, MSDN) to Visual Studio sometime you will get the incorrect quote figures or hidden/invisible unicode figures.
Copying this content from the xml file to notepad and pasting it back to Visual Studio solved this problem for me personally many occasions.
You may also make use of the Silverlight Client Access Policy File Extension in Visual Studio (Tools Extension Manager)