I have the following operation for hosting my client access policy in my WCF service:
[OperationContract]
[WebGet(UriTemplate = "/clientaccesspolicy.xml")]
XElement RetrieveClientAccessPolicy();
public XElement RetrieveClientAccessPolicy()
{
String policy = @"<?xml version=""1.0"" encoding=""utf-8""?>
<access-policy>
...
</access-policy>";
return XElement.Parse(policy);
}
When I try to connect to my the service from my silverlight app, I get an error because it can't find the client access policy. It's looking for it here:
When I browse there in IE, I get a 404. However, I can find the clientaccesspolicy.xml file if I browse to here:
How can I get my operation to make the client access policy file accessible from the root, and not from that directory (server is the service's name)?