An error occurred while attempting to send a request to urihttp: // localhost: 2859/service. SVC. This may be because there is no correct cross-origin policy when attempting to access the service in the Cross-origin mode, or the policy is not applicable to the soap service. You may need to contact the service owner to publish a cross-domain policy file and ensure that the file allows sending HTTP headers related to soap. This error may also occur because the internal type in the Web Service proxy is used
An error occurred while trying to send a request to Uri "http: // localhost: 2859/service. SVC. This may be because there is no correct cross-origin policy when attempting to access the service in the Cross-origin mode, or the policy is not applicable to the soap service. You may need to contact the service owner to publish a cross-domain policy file and ensure that the file allows sending HTTP headers related to soap. This error may also occur because the internal type in the Web Service proxy is used, but the internalsvisibletoattribute attribute is not used. For more information, see internal exceptions.
Add two cross-origin XML files to the WCF Directory: (under the root directory you published, my files are in c: \ Inetpub \ wwwroot. Open IIS-default website-right-click Properties-home directory-local path (where two files are stored ))
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- >
< Resource Path = "/" Include-subpaths = "True" / >
< /Grant- >
< /Policy >
< /Cross-Domain-Access >
< /Access-Policy >
Crossdomain. xml
< ? XML version = "1.0" ? >
< Cross-Domain-Policy >
< Allow-access-from domain = "*" / >
< /Cross-Domain-Policy >