Hi, and sorry for another Cross Domain question.
I have been fighting with this all day now and am at the point of boiling over.
I have a Silverlight Application Project (SLApp1), a Web project for hosting the Silverlight (SLApp1.Web) and the WCF Project (SLWcfService).
Now I am building everything together and all the projects are in one solution. The Web project is hosted by Visual Studio and the WCF Service is hosted by the WcfSvcHost.
The problem that because the web and wcf are hosted separately there is a cross domain issue, so every time my Silverlight application attempts to make a call to the WCF the Cross Domain Exception is thrown.
I have tried:
- Adding clientaccesspolicy.xml to C:\inetpud\wwwroot
- Using webHttpBinding and having a ReadPolicy method in the service
The problem is I am still developing the solution and so publishing the service and then hosting in IIS is simply not a feasible solution.
Why does this have to be so INCREDIBLY difficult?
Please Help!
Reference Material:
My App.config:
<system.serviceModel>
<services>
<service name="Test.Service1" behaviorConfiguration="Test.Service1Behavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8055" />
</baseAddresses>
</host>
<endpoint address="Service1" binding="basicHttpBinding" contract="Test.IService1"/>
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="webHttpBehavior" contract="Test.WCFService.IClientAccessPolicy" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Test.WCFService.Service1Behavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>