Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-06

Web Service Toolkit - Notify the Client

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Johann Glaser

Hi!

I'm going to implement a data logger and a GUI frontend in FreePascal. One (daemon) program gets data from a device connected via USB and stores it to a file. A second program, the GUI frontend, connects to the daemon and can retrieve the measured data and other stuff. Additionally it can send commands to change the measurement settings.

All this is quite a typical application for RPC, so I plan to use the Web Service Toolkit with SOAP.

Usually the frontend does a remote procedure call to the backend. There is one important problem I'm facing now. I want the backend (service provider) to notify the frontend (service consumer) as soon as a new measurement value has arrived. So this is the reverse direction of communication.

Is this possible? Can you please point me to information how to accomplish this?

Thanks
Hansi

Johann Glaser Vienna University of Technology Electrical Engineering ____ http://www.johann-glaser.at/ ____

Reply by email

Michael Van Canneyt
to Johann Glaser
Johann Glaser wrote 19 lines
Hi! I'm going to implement a data logger and a GUI frontend in FreePascal. One (daemon) program gets data from a device connected via USB and stores it to a file. A second program, the GUI frontend, connects to the daemon and can retrieve the measured data and other stuff. Additionally it can send commands to change the measurement settings. All this is quite a typical application for RPC, so I plan to use the Web Service Toolkit with SOAP. Usually the frontend does a remote procedure call to the backend. There is one important problem I'm facing now. I want the backend (service provider) to notify the frontend (service consumer) as soon as a new measurement value has arrived. So this is the reverse direction of communication. Is this possible? Can you please point me to information how to accomplish this?

This is not possible in SOAP, unless you do continuous polling.

I believe there are some Microsoft extensions which allow asynchronous notifications, but they are not implemented in SOAP and also not in WST.

Michael.

Reply by email

Johann Glaser
to Michael Van Canneyt

Hi!

Show quoted text 10 lines
> Usually the frontend does a remote procedure call to the backend. There > is one important problem I'm facing now. I want the backend (service > provider) to notify the frontend (service consumer) as soon as a new > measurement value has arrived. So this is the reverse direction of > communication. > > Is this possible? Can you please point me to information how to > accomplish this? This is not possible in SOAP, unless you do continuous polling.

Is it possible to delay a SOAP call a few seconds at the service provider (until new data is available)? Hmm, this reveals the question what are the timeouts for TCP/IP connection and for the web services?

Bye
Hansi

Johann Glaser Vienna University of Technology Electrical Engineering ____ http://www.johann-glaser.at/ ____

Reply by email

Michael Van Canneyt
to Johann Glaser
Johann Glaser wrote 16 lines
Hi! > > Usually the frontend does a remote procedure call to the backend. There > > is one important problem I'm facing now. I want the backend (service > > provider) to notify the frontend (service consumer) as soon as a new > > measurement value has arrived. So this is the reverse direction of > > communication. > > > > Is this possible? Can you please point me to information how to > > accomplish this? > > This is not possible in SOAP, unless you do continuous polling. Is it possible to delay a SOAP call a few seconds at the service provider (until new data is available)? Hmm, this reveals the question what are the timeouts for TCP/IP connection and for the web services?

I think a few seconds are possible, a timeout is usually longer than that. The webservices do not specify any values for timeouts. I'm not sure whether the HTTP protocol has such definitions, but I would be surprised if it had.

Michael.

Reply by email

John Coppens
to Michael Van Canneyt
Show quoted text 8 lines
> Is it possible to delay a SOAP call a few seconds at the service > provider (until new data is available)? Hmm, this reveals the question > what are the timeouts for TCP/IP connection and for the web services? I think a few seconds are possible, a timeout is usually longer than that. The webservices do not specify any values for timeouts. I'm not sure whether the HTTP protocol has such definitions, but I would be surprised if it had.

If using the HTTP protocol, it's possible to define a refresh time of x seconds using a meta-tag:

<META HTTP-EQUIV="refresh"
CONTENT="3;URL='http://www.homepage.com/spot3.html'">

This is quite popular with webcams and such. But this is of course not the definition of a timeout value, you would have to know when the next value is due.

John

Reply by email

Johann Glaser
to Michael Van Canneyt: I think a few seconds are possible, a timeout is usually longer than that. The…

Hi!

Show quoted text 8 lines
> Is it possible to delay a SOAP call a few seconds at the service > provider (until new data is available)? Hmm, this reveals the question > what are the timeouts for TCP/IP connection and for the web services? I think a few seconds are possible, a timeout is usually longer than that. The webservices do not specify any values for timeouts. I'm not sure whether the HTTP protocol has such definitions, but I would be surprised if it had.

Thanks. I'll try it this way.

Bye
Hansi

Reply by email

Michael Van Canneyt
to John Coppens: On Sun, 3 Jun 2007 16:55:23 +0200 (CEST) If using the HTTP protocol, it's possible to…
John Coppens wrote 21 lines
On Sun, 3 Jun 2007 16:55:23 +0200 (CEST) Michael Van Canneyt wrote: > > Is it possible to delay a SOAP call a few seconds at the service > > provider (until new data is available)? Hmm, this reveals the question > > what are the timeouts for TCP/IP connection and for the web services? > > I think a few seconds are possible, a timeout is usually longer than > that. The webservices do not specify any values for timeouts. I'm not > sure whether the HTTP protocol has such definitions, but I would be > surprised if it had. If using the HTTP protocol, it's possible to define a refresh time of x seconds using a meta-tag: <META HTTP-EQUIV="refresh" CONTENT="3;URL='http://www.homepage.com/spot3.html'"> This is quite popular with webcams and such. But this is of course not the definition of a timeout value, you would have to know when the next value is due.

Yes, but:

1. This is HTML, not HTTP. SOAP doesn't use HTML, it uses XML.
2. Even so, it's up to the client to actually implement the refresh. A browser will do this, but a simple RPC mechanism usually will not. (especially since it doesn't understand HTML)

Michael.

Reply by email