How do I implement web services on an embedded device?

We have an embedded device that needs to interface with the corporate software system.

Currently, an enterprise system uses many different mechanisms for exchanging data between its components: ODBC, RPC, proprietary protocol over TCP / IP, and moving to web services using .NET.

The nested device uses a * nix flavor, so we are looking at what is the best communication mechanism.

Post requirements:

Must be done over TCP / IP. Should also work via RS-232 or USB. Must be secure (e.g. HTTPS or SSL). Should be able to transfer ~ 32MB of data.

Our best option is gSOAP .

Does anyone on SO-land have any other suggestions?

Edit: Steven's answer gave me the newest pointers. Thanks everyone!

+1


source to share


4 answers


You can define RESTful services using HTTPS (which uses TCP / IP by definition) and is capable of transferring any amount of data.

The advantage of REST over SOAP is that REST is simpler. It can use JSON instead of XML which is simpler.



It has less overhead than SOAP.

+1


source


Can't you use SSL over TCP?

If you have a * nix of some sort (I guess it's either QNX or embedded Linux, right?) It should work pretty much out of the box over Ethernet, USB and RS232. Keep things simple.



32 MB is a lot of memory for this task. I would allocate 2 to 4 MB of memory for networking and encryption (code + data).

+1


source


It's not entirely clear why you want to tie this to a remote procedure call protocol like SOAP. Are there other requirements that you do not mention?

In general, however, this kind of thing is handled very easily using regular web services. You can get very lightweight HTTP processors written in C; see the Wikipedia article for a comparison of a number of these. Then the REST interface will work fine. There are network interfaces that treat USB as a TCP connection.

If you should be able to run via RS232, you can look elsewhere; in this case something like sftp might do better. Or write a simple application layer protocol that you can run over an encrypted connection.

+1


source


If you are going to connect your application using RS232, I will assume that you will be using PPP to connect your device to the Internet. However, the amount of data you propose to transfer is of some concern. Most RS232 connections are capped at 115200 baud, which, ignoring the overhead required for TCP / IP / PPP framing, will provide a transfer rate of no more than 11,000 bytes per second. This implies that any transfer you intend to complete will take a minimum of 2800 seconds or 46 minutes.

+1


source







All Articles