tags:

views:

94

answers:

2

Hi

I want to create a remote webservice for an application that is now avaliable only localy. This application controlls three devices (each is controlled separately) connected on serial port. The problem is that I don't know how to take care of passing back information that a device return requested data. For example - I send move command to the motion device (which is very slow and can take a minute or more). Can I just set a big timeout on the client side (and server side) and return for example a true/false if operation is completed or is this a bad idea? Is SOAP with big timeouts ok? And the other question is if Mono on Linux (Ubuntu 9.10, Mono 2.4) is stable enought for making a web service or should I chose Java or some other language?

I'm open for recommendations.

Thanks for your help!

+2  A: 

Using big timeouts is not a good idea. It wastes resources on both the server and the client and you will not be able to detect a "true" timeout condition, when the server is unavailable for example, before the allocated timeout expires.

You really have two options. The first is to use polling. Return immediately from the motion request command, acknowledging the reception of the command (and not the completion of it). Then send requests in regular intervals, asking whether the command is completed or not.

The other alternative requires the client to be able to register a callback endpoint, which the server will call when the motion completes. This makes the whole process asynchronous, but requires the client to be able to operate in server mode. This is very easy to do with WCF - I don't know however if this functionality is available in Mono.

kgiannakakis
Can you point me on the right direction on how to that with SOAP... what I have to look after.Thanks for your answer, it was helpfull!
redman
If it is polling you need to have two web service methods, for example SendStartCommand and GetCommandStatus. If you go for the asynchronous option the client must implement a SOAP method StartCommandCallback and send the endpoint as a parameter in SendStartCommand method. I recommend starting with polling, it will be easier with you.
kgiannakakis
A: 

Not directly related to your question..., but consider com0com and its friends hub4com and com2tcp.

kenny