Closed LordXaosa closed 9 years ago
full text here, Git cut something... https://www.dropbox.com/s/5nms9t5ux5w3paw/fixes.txt?dl=0 Please, make this fixes in your next releases. Because rewrite it every time is butt hurt))
Fixed in pull request #165
I noticed, that there is an implementation of WCF services, so I decided to make little web tool with silverlight. I stucked at error, that my SL app using cross-domain requests and it's not allowed. I fixed it with some code rewritings: at first I rewrite WsHttpBind to basicHttpBind, it's important to SL, because it can't work with WsHttpBinds. Then I fixed web service with this code: private bool SetupWebService() { Uri webServiceAddress = new Uri("http://externalIp:" + WCFPort.ToString()); m_webHost = new WebServiceHost(typeof(WebService), webServiceAddress); try { WebHttpBinding binding = new WebHttpBinding(WebHttpSecurityMode.TransportCredentialOnly);; ServiceEndpoint endpoint = m_webHost.AddServiceEndpoint(typeof(IPolicyRetriever), binding, "");
Than I made an Interface for services: [ServiceContract] public interface IPolicyRetriever { [OperationContract, WebGet(UriTemplate = "/clientaccesspolicy.xml")] Stream GetSilverlightPolicy(); [OperationContract, WebGet(UriTemplate = "/crossdomain.xml")] Stream GetFlashPolicy(); }
After it I fixed all services by adding inheriting of this interface and add implementation of it to every of 5 services: Stream StringToStream(string result) { WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml"; return new MemoryStream(Encoding.UTF8.GetBytes(result)); } public Stream GetSilverlightPolicy() { string result = @"<?xml version=""1.0"" encoding=""utf-8""?>