You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent.

Step1: before using WCF serive you have to add  Two XML files in C:\Inetpub\wwwroot

1. clientaccesspolicy.xml :


2. crossdomain.xml:


1. clientaccesspolicy.xml :


<?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>



2.crossdomain.xml:


<?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="*"/>
  <allow-http-request-headers-from domain="*" headers="SOAPAction" />

</cross-domain-policy>

Step 2: Next you have to deploy WCF service before using In silverlight because With out deploy in IIS your service URL like below http://localhost:3049/GlobalServices/EmpService.svc
Because of Port numbers you will get error in Silverlight for avoid this Deploy your WCF service using Web project deployment techniques .
After deploy in IIS , your URL like below
http://localhost/GlobalServices/EmpService.svc



An error occurred while trying to make a request to URI 'http://localhost:9898/MyService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

0 Responses to “You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent.”

Post a Comment

Labels

Topics