Crossdomain Files in IIS [Resolved]

Posted by Vuyiswamb under WCF on 7/12/2011 | Points: 10 | Views : 2973 | Status : [Member] [MVP] [Administrator] | Replies : 2
Good Day All

i have placed a CrossDomain and the ClientPolicy Files in the Root of the IIS directory wwwroot.

We are currently having a problem on our side, our Network administrator says he has opened port 80 , but those policy files are not accessible from outside.

i change the port of my site to 8081 and the site is fine, but it needs to policy files that are accessible through port 80.

i goolged a bit and i see some people trying to programatically change the address location of the policy file.

You see the policy files that i can access , i can access them if i entered the port, and IIS looks for the policy Files in the Root Directory and those are accessible with port 80.

There are two things that i can settle for.

1) Its either the port 80 issue is resolved

2) The Policy files should be accessible via the new port.

I used Fidler to inspect this and i have the results in the attachment

I need advice.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 7/15/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down

Resolved
My Policy file is in the root directory and it can be accessed via port 80, i dont want to tweak my application because of wrong security settings. I have a new server and now its working. Some service was blocking port 80.

Thanks


Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nandhini on: 7/15/2011 [Member] Starter | Points: 25

Up
0
Down
Hi ,

You can read Cross domain file inside the crossdomain service method , no need to place your crossdomain xml file in root directory.

sample code is
public Stream GetClientAccessPolicyFile()

{
const string result = @"<?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 path=""/"" include-subpaths=""true""/>
</grant-to>
</policy>
</cross-domain-access></access-policy>";
if (WebOperationContext.Current != null) WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml";
return new MemoryStream(Encoding.UTF8.GetBytes(result));
}


Thanks & Regards,
Nandhini.R

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response