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

tclsoap

1 view
Skip to first unread message

Jubeh

unread,
Apr 6, 2006, 4:25:14 AM4/6/06
to
i am trying to split a program functionality on two PCs , i control
the server and the client , i tried to do that with soap but this is my
first time using this tech.

i will be glade if any one show me how to write a function on the serve
and how to call it from the client, i need simple example like adding
two numbers.

John Seal

unread,
Apr 6, 2006, 7:42:35 AM4/6/06
to
Jubeh wrote:
> i will be glade if any one show me how to write a function on the serve
> and how to call it from the client, i need simple example

Here's a "Hello, world!" example. First the server:

package require SOAP::Domain

namespace eval YourNamespace {

proc iam {name} {
return "Hello, $name!"
}

SOAP::export iam

}

SOAP::Domain::register -prefix /yourPrefix \
-namespace YourNamespace \
-uri YourNamespace

Put the server in the CGI directory of your webserver (tclhttpd works
great if you don't already have one). Now the client:

package require SOAP

SOAP::create iam \
-uri YourNamespace \
-proxy http://localhost:8015/yourPrefix \
-params {name string}

Now invoke the procedure in the client:

(sandbox) 1 % iam busirane
Hello, busirane!

You can find out more by reading the man pages and the wiki. See
http://mini.net/tcl/1753 for starters.

Bruce Hartweg

unread,
Apr 6, 2006, 9:58:59 AM4/6/06
to

If you control both the client and server, then SOAP is a bunch
of unnecessary overhead. (unless this is just for testing and you
eventually need to to allow many clients access, in which case
a standard interface like SOAP is probably a good idea).

But if it is just your two apps talking then a simple socket
connection is easiest, or you can also look into the comm
package.
see for examples,

http://wiki.tcl.tk/1757
http://wiki.tcl.tk/15539 (and follow links at bottom)

http://wiki.tcl.tk/comm

Bruce

0 new messages