title: Cross domain error in WCF wsHttpBindingwith silverlight
body: <p>I have a WCF service and I am using <code>wsHttpBinding</code> in <code>web.config</code>.</p>
  
  <p>I have also created a test certificate from IIS7 and used it for https binding with website</p>
  
  <p>Web config of Service as below </p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;behaviors&gt;
     &lt;serviceBehaviors&gt;
      &lt;behavior name="WsBehaviour"&gt;
       &lt;serviceMetadata httpsGetEnabled="true"/&gt;
       &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
      &lt;/behavior&gt;
     &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
  
    &lt;bindings&gt;
     &lt;wsHttpBinding&gt;
      &lt;binding name="WsBinding"&gt;
        &lt;security mode="Transport"&gt;
          &lt;transport clientCredentialType="None" proxyCredentialType="None" realm=""/&gt;
          &lt;message clientCredentialType="None" algorithmSuite="Default" /&gt;        
        &lt;/security&gt;            
      &lt;/binding&gt;
     &lt;/wsHttpBinding&gt;    
    &lt;/bindings&gt;
  
    &lt;services&gt;
     &lt;service name="WsService.Service1" behaviorConfiguration ="WsBehaviour"&gt;
       &lt;endpoint address="https://MachineName.DomainName:8087/WsService/Service1.svc"
        binding="wsHttpBinding" bindingConfiguration="WsBinding" contract="WsService.IService1" &gt;
  
         &lt;identity&gt;
           &lt;dns value="localhost" /&gt;
         &lt;/identity&gt;
  
       &lt;/endpoint&gt;
     &lt;/service&gt;
    &lt;/services&gt;  
   &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>When I open the URL in a browser it works perfectly, and also works perfectly when I add a Service reference to the silverlight project. </p>
  
  <p>But when I call the service from the application it gives a cross-domain error.</p>
  
  <p>I have also include <code>clientaccesspolicy.xml</code> and <code>crossDomain.xml</code> in the project, but still face a problem </p>
  
  <pre><code>An error occurred while trying to make a request to URI
  'https://MachineName.DomainName:8087/WsService/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.
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Wovem.png" alt="enter image description here"></p>