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.
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.
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)
Bruce