Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using http package to receive one-way soap/xml message

73 views
Skip to first unread message

anj patnaik

unread,
Feb 9, 2012, 6:01:55 PM2/9/12
to
Hello all,

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?

For request/response, my client does this:

# Send request

set token [ ::http::geturl $Proxy \
-type "text/xml" \
-query $Form -timeout $TMOUT ]

# get response in xml
http::data $token

Thanks a lot!

Gerald W. Lester

unread,
Feb 9, 2012, 7:32:38 PM2/9/12
to
On 2/9/12 5:01 PM, anj patnaik wrote:
> Hello all,
>
> 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? ...

No.

--
+------------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+------------------------------------------------------------------------+

tomas

unread,
Feb 12, 2012, 5:18:03 AM2/12/12
to
"Gerald W. Lester" <Gerald...@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:

Tclhttpd <http://wiki.tcl.tk/2085>
AOLServer <http://wiki.tcl.tk/2078>
NaviServer <http://wiki.tcl.tk/2090>

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.

Hope that helps
-- tomás

Gerald W. Lester

unread,
Feb 13, 2012, 11:23:03 AM2/13/12
to
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.

anj patnaik

unread,
Feb 13, 2012, 1:14:42 PM2/13/12
to
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:

tomas

unread,
Feb 13, 2012, 4:10:37 PM2/13/12
to
"Gerald W. Lester" <Gerald...@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

Regards
-- tomás

tomas

unread,
Feb 13, 2012, 4:22:54 PM2/13/12
to
anj patnaik <pat...@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.

Regards
-- tomás

Gerald W. Lester

unread,
Feb 13, 2012, 7:07:15 PM2/13/12
to
On 2/13/12 3:10 PM, tomas wrote:
> "Gerald W. Lester"<Gerald...@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?

http://core.tcl.tk/tclws

tomas

unread,
Feb 16, 2012, 1:09:20 PM2/16/12
to
Thanks!
0 new messages