locked
An error occurred while trying to make a request to URI 'http://localhost:3141/Service1.svc' RRS feed

  • Question

  •  I am getting the following error:

    An error occurred while trying to make a request to URI 'http://localhost:3141/Service1.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.

     

        <services>
    
          <service name="BasicHttpBinding_IService1">
            <endpoint address="http://localhost:3141/Service1.svc"
                       binding="basicHttpBinding"
                       contract="WcfService1.IService1"/>
    
          </service>
        </services>
    Friday, October 14, 2011 8:35 AM

Answers

  • Use the xml file clientaccesspolicy.xml

    Its contents are:-

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="SOAPAction">
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
    Friday, October 14, 2011 10:22 AM