is it possible to use SocketClientAccessPolicyProtocol.Http while in development using Cassini - silverlight

I have 3 projects in a Visual Studio 2010 solution. A Console App that is acting as my socket server, a Silverlight Client that would like to consume data from said socket server, and a Web project that hosts the Silverlight client and a clientaccesspolicy.xml file.
It seems to me that using SocketClientAccessPolicyProtocol.Http will not work as the Silverlight client would try and download the clientaccesspolicy.xml file over port 80 and not the port that Cassini is using for that debugging session.
I would rather not have to build a Policy Server, or more accurately, I would rather not have to open up port 943 in addition to 4502-4534 that I'm currently allowing.
Is it possible to use the Http option for retrieving the accesspolicyfile.xml in this case?

Related

SignalR Silverlight and LoadBalancer

We have an application with Silverlight 5 and WCF RIA backend.
Our Client's environment has load balancing but has only 30 - 40 users.
We wanted to use SignalR for messaging, but instead of using a backplane, i am planning to
install a seperate MVC service as Hub which will sit outside the Loadbalancer, where all clients can connect to.
Is this approach okay for a small user base (30 - 40 users)? And since its going to be cross domain, do i need to copy clientaccesspolicy.xml to the root folders for silverlight to work ? Or do i need to configure SignalR to allow cross domain?
Thanks !
You need both.
Enabling cross domain on SignalR server allows requests to be processed on server side.
Adding clientaccesspolicy.xml allows Silverlight to establish the connection.

WCF Winform Hosting

I have a WCF service hosted in a Winforms application, it's running on a vista machine and I've used netsh to allow the application to listen on port 6003.
I have a client application which can call the WCF service when it is running on the same machine.
The problem is I cannot access the WCF service from any other PC on the network.
I've run netstat and it's definately listening on the port.
I'm using the basicHttpBinding, and it's .Net 4.
Any help would be great.
Regards
Steve
Check the firewall settings on the PC hosting the service. It is probably blocking the access.
Have you tried hitting the services through a web browser?
You can try adding a clientaccesspolicy.xml (and a crossdomain.xml, for good measure) to the root of your server. Check the following link - http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx

What is the current state of Web Sockets for Silverlight applications

From what I've read Web Sockets holds more promise than the duplex polling that is currently available to Silverlight developers for receiving server notifications. However I'm not finding much written in the last 10 months, nor am I finding much at all from a Silverlight perspective.
Please don't answer, that Silverlight can open sockets. I know that --- howerver what I don't know is how silverlight can do that with its web server over port 80 in a firewall friendly way -- all of which is why I'm interested in Web Sockets.
The underlying Silverlight network stack won't allow port 80 to be connected to. The port restrictions are that the port must be between 4502-4534. See Network Security Access Restrictions in Silverlight.
Microsoft recently release a WebSockets prototype part of which includes a Silverlight WebSocket client. One additional restriction with the Microsoft Silverlight WebSocket prototype implementation is that a clientaccesspolicy.xml file must be served up from port 80 on the server that is being connected to.
The Super Websockets project also contains a Silverlight client somewhere. It will most probably have the same restrictions as the Microsoft implementation.
SL4 and 5 do not implement websockets. If browser used to host silverlight plugin supports websockets then you can use browser interop to call websockets api form the silverlight app.
Alternatively a trusted application can connect to any TCP port including port 80.

Cross Domain Silverlight Problem with localhost

I am currently looking into developing a silverlight app. I want to develop the app on my local machine for ease of development. I am using Apache Server on Windows which is hosting php. I am doing a WebClient DownloadStringASync to http://localhost/getData.php but the Silverlight webpage is running in visual studio asp server at http://localhost:54994/MySilverlight.aspx. I think because the silverlight app is running from the vs2010 server and I am making a call to my standard apache server it is having a cross domain problem. When the app is run the innerexception says System.Security.SecurityException at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse.
I have tried putting accesspolicy.xml file in the root of the asp server and the apache server but it still isn't fixing the problem. I know its not a problem with the code as if I run it from my website server and call the webclient request to the same domain it works fine.
Any help you can provide would be great thanks.
I've managed to solve the problem. I needed to have to crossdomain.xml and clientaccesspolicy.xml with the same code. For some reason if I only have one or the other it keeps on bringing up the security exception. As soon as both files in the root of the localhost directory of apache (i.e. in the root of htdocs) the silverlight app works fine

Silverlight cross domain confusion

I have a Silverlight application that does two things:
1) connects to a WCF server (hosted inside a WPF app on a different PC) and sends small packets of info (using PollingDuplexHttpBinding if it matters)
2) sends a web request for get an XML file from a different remote server for parsing
At dev time, its all running locally, but in production it will be a scattered deployment each running on a different server.
But I am running into issues that I think are related to the clientaccesspolicy.xml and crossdomain.xml files
My Silverlight app runs at a random port (as defined by VS2010)
The WCF service runs at: http://localhost:80/MyService which I can connect to just fine from the SL client (I have got a clientaccesspolicy.xml file on the WCF side)
But, and here is the part that is failing, when I send a request for the XML file, which is http://localhost/MY_TEST_SITE/thefile.xml I get the error:
The remote server returned an error: NotFound.
but I put that address into Firefox I can see the XML file no problem. I do have a clientaccesspolicy.xml in that location, which I think is correct.
If it was a cross-domain issue should I be getting a security exception here? instead of a not found exception?
How can I debug this?
Its ok I figured it out, I had something blocking on port 80, which was causing a whole heap of issues, once I switched that off, it was back to normal

Resources