I am using http package to send soap xml requests and receive xml
responses. This is synchronous and works well. I am using http package
on the client side and the web service is running remotely and is
implemented in a different programming language.
Now, I have a scenario where the web server sends me a one-way
notification xml message. Does tcl http package have a way for me to
receive data asynchronously? If so, can you point me to any examples?
> I am using http package to send soap xml requests and receive xml
> responses. This is synchronous and works well. I am using http package
> on the client side and the web service is running remotely and is
> implemented in a different programming language.
> Now, I have a scenario where the web server sends me a one-way
> notification xml message. Does tcl http package have a way for me to
> receive data asynchronously? ...
"Gerald W. Lester" <Gerald.Les...@KnG-Consulting.net> writes:
> On 2/9/12 5:01 PM, anj patnaik wrote:
>> Hello all,
>> I am using http package to send soap xml requests [...]
>> Now, I have a scenario where the web server sends me a one-way
>> notification xml message. Does tcl http package have a way for me to
>> receive data asynchronously? ...
> No.
Hm. How does "the web server send a notification message"? Surely it's
acting as a client here?
Note that http isgeared towards building a client. It has all the
machinery to work asynchronously (and does a fine job at that), and it
has the necessary machinery to construct and parse HTTP (if you squint a
bit, client and server messages (i.e. "requests" and "responses") are
more or less the same, except the first line).
So it wouldn't be hard to implement a minimal HTTP server re-using
http's "infrastructure".
Before embarking in that I'd recommend looking into the HTTP servers
implemented in Tcl (of which there are some with much tradition). Off
the top of my cache:
As far as I understand, the first choice is a minimalist approach and
AOLServer and NaviServer are both incarnations of more or less the same
thing: full-fledged and with all bells and whistles. But I'll leave to
others (much more knowledgeable than me) to fill-in more details.
> "Gerald W. Lester"<Gerald.Les...@KnG-Consulting.net> writes:
>> On 2/9/12 5:01 PM, anj patnaik wrote:
>>> Hello all,
>>> I am using http package to send soap xml requests [...]
>>> Now, I have a scenario where the web server sends me a one-way
>>> notification xml message. Does tcl http package have a way for me to
>>> receive data asynchronously? ...
>> No.
> Hm. How does "the web server send a notification message"? Surely it's
> acting as a client here?
> Note that http isgeared towards building a client. It has all the
> machinery to work asynchronously (and does a fine job at that), and it
> has the necessary machinery to construct and parse HTTP (if you squint a
> bit, client and server messages (i.e. "requests" and "responses") are
> more or less the same, except the first line).
> So it wouldn't be hard to implement a minimal HTTP server re-using
> http's "infrastructure".
> Before embarking in that I'd recommend looking into the HTTP servers
> implemented in Tcl (of which there are some with much tradition). Off
> the top of my cache:
> As far as I understand, the first choice is a minimalist approach and
> AOLServer and NaviServer are both incarnations of more or less the same
> thing: full-fledged and with all bells and whistles. But I'll leave to
> others (much more knowledgeable than me) to fill-in more details.
Tomas, on a side communication I pointed him at TclWs' Embedded and gave him some guidance -- but the work to be done will require understanding and diving into some of the lower levels.
Thanks for the ideas! I have never used the httpd server that is tcl
based, but I have a tiny bit of experience with sockets.
is the httpd server a better solution than having a socket server that
just reads off the data ?
Unfortunately, the server is down so I am not able to get data. But I
was wondering if XML POST over HTTP is strings that can be read off
socket...
All I need is the ability to receive XML data over HTTP at the URL and
then parse the XML and display it as an array or list. So, I am not
sure if httpd is overkill.
Thanks.
On Feb 12, 5:18 am, tomas <to...@axelspringer.de> wrote:
> "Gerald W. Lester" <Gerald.Les...@KnG-Consulting.net> writes:
> > On 2/9/12 5:01 PM, anj patnaik wrote:
> >> Hello all,
> >> I am using http package to send soap xml requests [...]
> >> Now, I have a scenario where the web server sends me a one-way
> >> notification xml message. Does tcl http package have a way for me to
> >> receive data asynchronously? ...
> > No.
> Hm. How does "the web server send a notification message"? Surely it's
> acting as a client here?
> Note that http isgeared towards building a client. It has all the
> machinery to work asynchronously (and does a fine job at that), and it
> has the necessary machinery to construct and parse HTTP (if you squint a
> bit, client and server messages (i.e. "requests" and "responses") are
> more or less the same, except the first line).
> So it wouldn't be hard to implement a minimal HTTP server re-using
> http's "infrastructure".
> Before embarking in that I'd recommend looking into the HTTP servers
> implemented in Tcl (of which there are some with much tradition). Off
> the top of my cache:
> As far as I understand, the first choice is a minimalist approach and
> AOLServer and NaviServer are both incarnations of more or less the same
> thing: full-fledged and with all bells and whistles. But I'll leave to
> others (much more knowledgeable than me) to fill-in more details.
"Gerald W. Lester" <Gerald.Les...@KnG-Consulting.net> writes:
> Tomas, on a side communication I pointed him at TclWs' Embedded and
> gave him some guidance -- but the work to be done will require
> understanding and diving into some of the lower levels.
Thanks. I did't know about TclW -- care to share a link? (my google-fu
(rather my ixquick-fu, but nevermind ;-) doesn't "cut" it
anj patnaik <patn...@gmail.com> writes:
> Thanks for the ideas! I have never used the httpd server that is tcl
> based, but I have a tiny bit of experience with sockets.
> is the httpd server a better solution than having a socket server that
> just reads off the data ?
You'd have to do the http dance yourself. That'd mean sending the right
headers to keep aour client from sending gzipped and/or chunked stuff,
maybe forcing the client to do HTTP 1.0 (or coping with 1.1
complexities). Not exactly rocket science, but a bit tedious and
debugging-prone.
Definitely doable.
> Unfortunately, the server is down so I am not able to get data. But I
> was wondering if XML POST over HTTP is strings that can be read off
> socket...
The xml "layer" is comparatively simple. SOAP likes to send things in
the headers as well, so beware.
> All I need is the ability to receive XML data over HTTP at the URL and
> then parse the XML and display it as an array or list. So, I am not
> sure if httpd is overkill.
See above. If you want to get the HTTP layer done for you, go for a
HTTP server. Otherwise you might "steal" inspiration/code there or from
http.
> "Gerald W. Lester"<Gerald.Les...@KnG-Consulting.net> writes:
>> Tomas, on a side communication I pointed him at TclWs' Embedded and
>> gave him some guidance -- but the work to be done will require
>> understanding and diving into some of the lower levels.
> Thanks. I did't know about TclW -- care to share a link?