Note that there are some explanatory texts on larger screens.

plurals
  1. POConnecting Silverlight app to Self hosted WCF service
    primarykey
    data
    text
    <p>I've created a WCF service that is running on 192.168.0.199:87. The service works without a issue. However when I create a silverlight app to consume this service on my dev pc in VS I am getting the crossdomain problem. How am I going to solve this. The service is not a IIS WCF service. I also can't host the WCF service and the silverlight app on the same port. Silverlight is looking for the clientaccesspolicy.xml on 192.178.0.199:87, in this case this is the address of my self hosted WCF service.</p> <p>Any help would be great.</p> <p>This is my code I don't now if I brew something good. My app.config file is located here. I think it's a endpoint problem but I am not sure. <a href="http://213.46.36.140/app.config.txt" rel="nofollow noreferrer">http://213.46.36.140/app.config.txt</a></p> <pre> <code> namespace WindowsFormsApplication11 { public partial class Form1 : Form { public ServiceHost _host = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { _host = new ServiceHost(typeof(WmsStatService)); _host.Open(); } } // Define a service contract. [ServiceContract(Namespace = "http://WindowsFormsApplication11")] public interface IWmsStat { [OperationContract] string sayHello(string name); [OperationContract, WebGet(UriTemplate = "/clientaccesspolicy.xml")] Stream GetSilverlightPolicy(); } public class WmsStatService : IWmsStat { public string sayHello(string name) { return "hello there " + name + " nice to meet you!"; } Stream StringToStream(string result) { WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml"; return new MemoryStream(Encoding.UTF8.GetBytes(result)); } public Stream GetSilverlightPolicy() { // result cointains the clienaccpolicy.xml content. // string result = @" "; return StringToStream(result); } } } </code> </pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload