Share via


Exercise 3: Deploy the ClientAccessPolicy.xml

In this exercise you will deploy an existing ClientAccessPolicy.xml to finweb.contoso.com. This policy will allow the Web Part in intranet.contoso.com access to the finweb.contoso.com site.

Task 1 – Deploying the Existing ClientAccessPolicy.xml to the Root of the finweb.contoso.com Site

Silverlight will only look for client access policies in the root of the web. It cannot be located in any other location.

  1. Open the ClientAccessPolicy.xml file located in the <Install>/Labs/AccessingCrossDomainServices/source/begin folder SupportingFiles folder. Review the policy file. This policy file allows all access from all domains.
  2. Review ClientAccessPolicy.xml. The policy allows for all connections from all domains.
  3. Copy the existing ClientAccessPolicy.xml file located in the <Install>/Labs/AccessingCrossDomainServices/source/begin folder SupportingFiles folder.
  4. Using Windows Explorer, open the root of the intranet.contoso.com site located at C:\inetpub\wwwroot\wss\VirtualDirectories\finweb.contoso.com80.
  5. Paste the ClientAccessPolicy.xml file into the finweb.contoso.com80 folder.

    Figure 10

    ClientAccessPolicy.xml

  6. Open a Command Prompt and type IISReset and then press Enter.

Task 2 – Testing the Web Part Located on internet.contoso.com

Silverlight will only look for client access policies in the root of the web. It cannot be located in any other location.

  1. After the IISReset has completed, open Internet Explorer and navigate to https://internet.contoso.com.
  2. The Web Part now displays the names of the lists from the intranet.contoso.com site.

    Figure 11

    Web Part listing the content of finweb.contoso.com

Exercise 3 Verification

In order to verify that you have correctly performed all steps of exercise 3, proceed as follows:

Verification 3

In this verification, you open the internet.contoso.com site and display the names of lists on the finweb.contoso.com site. This verifies the Silverlight application can now call a service across a domain.

  1. Open Internet Explorer and navigate to https://internet.contoso.com
  2. The Web Part should display the lists names from the intranet.contoso.com site.