Hosting a Silverlight database application that works with MySQL - mysql

I have a basic hosting package that gives me access to create a MySQL database. I can of course host silverlight applications on any site. But how can I work with a database from within Silverlight? I cannot run any service on my hosting provider, they only allow php or perl scripts.

You can use the C# webclient to make HTTP calls to a PHP page hosted on the server. The PHP page can proxy queries/results between the silverlight client and the mysql database.
remember, just because it's not a SOAP/WCF "service" does not mean that it's not a web service. Look into PHP based REST solutions for some nice alternatives that can easily be invoked via silverlight:
http://www.bing.com/search?q=PHP+REST
Edit: As #Spencer Ruport correctly points out in the comments, you of course have to be wary of the fact that the web service will be exposed to the public, and anyone can easily sniff the http traffic between your silverlight application and the server. This enable them to call your service directly so be sure to think about authentication and what it means in the context of your app/data

You can use the WebClient class in silverlight to communicate to a php service. Here is the first google result I found: link

Related

Hosting html file over mosquitto

I just found that mosquitto had got a websockets upgrade which allows it to
host the HTTP services.
I tried hosting a html file using the websockets feature on the port 8080.
The mosquitto broker seems to start fine and the mqtt services on the other ports seem to function properly. But when i try to access the html file over the localhost I get the a response saying no data sent by the server.
I am not sure where my mistake lies..Any ideas?
Mosquitto is not a HTTP server, it can not serve generic files.
The HTTP listener is only there to facilitate an upgrade to the websocket protocol in order to run MQTT over a websocket connection.
You might want to look out for a different broker that is flexible enough to do what you're looking for. I don't know of any MQTT broker that allows you to do that out of the box, but many are fairly extensible. For one I can talk about is VerneMQ, as I am one of the core developers. Developing a simple VerneMQ plugin that serves some static files over HTTP is a matter of a few lines of code, as the plugin only requires to setup some configuration for the internal webserver.
However, unfortunately we haven't yet documented this feature. But feel free to drop us a line if such an approach sounds interesting for you.
Cheers,
Andre

CAS server with SAML.2

I'm starting to work with CAS on my company. This is totally new for me, so I had to read lot of documents and how to's to have an idea of how CAS works.
So, we have to provide a single sign on service in our server to a company with two different applications. One of those, uses SAML2.
My CAS server is now working against a MySQL database, so I'll have the users of those 2 apps on my database to provide authentication service.
What I don't get clear is about SAML. All the tutorials I've read about SAML2 integrated with CAS 4.0.0 are using Google Accounts. I don't know why! I have some SAML2 configuration on a xml on my CAS directories, but I don't know how to prove if it's working or not.
If you are going to authenticate both of the applications using your single database, CAS is enough, SAML not required. With SAML you can connect to an external application(which supports SAML), both might be having their own internal authentication, but they will commnicate each other through SAML2 protocol/agreement
CAS is ideal ,if you want to setup a web single sign-on to different web applications (exclusively for a single institution), which all use the same authentication (DB, LDAP or whatever). With this the authentication will be centralized for all these different applications.
For users from another external institution to use your web application, SAML would be the choice, provided the External application also should support SAML.

Can I push server side events from client's localhost?

My intention is when the user logs in to the service to be able to send from a native app on localhost events and read it from clients JavaScript. Will it require to use JSONP instead of JSON? Since each clients localhost is different from our domain?
Yes, if serverside = localhost.
For example, when you are running Google App Engine development server on your machine during development, it is actually sending push notifications to you localhost.
You might consider also doing that using node.js http://vimeo.com/13043828

Using a MySQL database on Windows Phone 7?

I'm attempting to write a Windows Phone 7 application which needs to connect to a remote data source, in this case it's a MySQL database on a Linux server. I'm not able to move this over to MSSQL, nor to build any kind of windows-based solution (like a WCF web service on the server).
Is there a way for me to use my MySQL database from my Windows Phone 7 application? The MySQL assemblies don't seem to work on the phone. If not, what would the best solution for me to use this database from the phone?
You could build your self a service which would send you json or xml. this can easily be built using mono, python, Ruby, php or any technology that you are comfortable with.
You can build it in a restful manner where all you have to do is call urls in a HTTP GET to retreive data which you handle with the services.
and use the HTTP POST to submit changes to your service.
you can then from WP7 make calls to this service and consume the data.
WP7 does not support sockets at the moment. So your best bet is transfering your payloads over HTTP.
As I mentioned before, if you have access to the machines configuration. You could run Mono which isn't too far off of .Net in terms of language and functionality.
further more, from the phone you can use the Rx library to make these calls Async and keep your application responsive.

Do I need a server to use HTML5's WebSockets?

When using WebSockets, will I need to write server code? In other words, will the JavaScript in my client application need to connect to a specialized server, or will my existing Apache server work to support this?
The server has to support web sockets. After a first handshake in HTTP, the server and the client open a socket connection. The server must be able to understand and accept this handshake.
In my last project we run quite successfully web socket connections using the last Jetty version.
27/02/2014:
Now I'm also implementing websockets under .net with XSockets.net and works like a charm, you don't even need a web server (self hosting). The WebSocket implementation of ASP.NET works also quite good.
Yes,you need to write server code.
I recommend another web socket server based on php: ratchet.
And this link is benchmarking webSocket servers between ratchet and sockJS.
Complete list of client & server side codes and browsers support please check this link
Of course you need a WebSocket server. But there are many free websocket server in different language, like jWebSocket in Java and SuperWebSocket in .NET, you can use them directly.
There are some plugins currently being developed on google code for Apache...
By definition websockets like normal sockets are client-server so yes, you need a server. However there is an alternative to waiting for Apache plugins.
I am using a hosted server http://www.achex.ca. Its free and you have tutorials in javascript on how to use the server. A good start for websockets development.
The server is basically a message router and you can connect to it and use it as a meeting point for all your websocket clients.
Short Answer: Yes, You need a specialized server, Apache does not come with websockets.OR The alternative, check out www.achex.ca.
In such a situation the role of server comes when :
In HTML 5,WebSocket like a fone(2-way comm.) not walky-talky.
http protocol upgraded to websocket protocol.(wss:// from ws://)
SERVER should be able to open duplex channel and hence AGREE with duplex communication.
Please go through this link : http://www.html5rocks.com/en/tutorials/websockets/basics/
If using php please look at RATCHET.
Thanks.
The Perl Mojolicious server supports web sockets, and implementations can be only a few lines long.
Node.js has several WebSocket libraries but details of the latest, greatest, most supportive of the latest spec vary, so choose carefully.
Apache Active MQ is also worth a look, along with the stomp protocol it implements.