How can I access a WCF service hosted in a windows service in my silverlight app

Posted on 2012-04-12
Last Modified: 2012-05-05
I am trying to access a WCF service in my silverlight app (silverlight 4)
I have added the clientaccesspolicy and crosdomainpolicy files to the root directory.

But I keep getting the error - The remote server returned an error: NotFound
Question by:countrymeister
  • 3
  • 3
LVL 25

Expert Comment

ID: 37846785
where you able to access wcf wsdl in Browser ? You have any firewall between ur client and server ?

Fiddler might hlep you to give you more details on this.

Author Comment

ID: 37846805
I checked the raw output in Fiddler, the error states - Bad Request.
It gives an error on the clientaccesspolicy.xml and then an error on the crossdomainpolicy files error.
The wcf is working fine when accessed from a regular console app.
I have the two files in the location of the windows exe.
But I guess I need to make code changes to dynamically load the access policy files, which I am trying to avoid. Because this is an existing working WCF service I want to access
LVL 25

Expert Comment

ID: 37848413
Save the crossdomain.xml and clientaccesspolicy.xml file to the root of the domain where the service is hosted. If, for example, the service is hosted in, then the file must be located at
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline


Author Comment

ID: 37853731
It does not work that way for a WCF service hosted in a windows service.
My windows service has bindings with some port numbers
SO it cannot find the policy files. So this has to be done via code to dynamically load the cap file.
LVL 25

Accepted Solution

apeter earned 500 total points
ID: 37863227

Author Closing Comment

ID: 37932828
This just gave me a few things to read and dig more into

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now