home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activetcltk / ActiveTcl8.3.4.1-8.win32-ix86.exe / ActiveTcl8.3.4.1-win32-ix86 / demos / TclSOAP / webservice.tcl < prev    next >
Encoding:
Text File  |  2001-10-22  |  2.0 KB  |  62 lines

  1. # webservice.tcl - Copyright (C) 2001 Pat Thoyts <Pat.Thoyts@bigfoot.com>
  2. #
  3. # Client side to the TclSOAP public webservice SOAP interface.
  4. #
  5. # Usage: register a SOAPAction (equates to a namespace and file)
  6. #        upload a tclscript using 'save' to provide the implementation for you
  7. #        SOAPaction.
  8. #        Call your methods via cgi-bin/webservices.  The action registed will
  9. #        define what file is sourced into the Tcl interpreter to satisfy your
  10. #        requests.
  11. #        If you need to recover the Tcl script, use 'read'
  12. #        If you have had enough, use 'unregister' (when I write it!)
  13. #
  14. # -------------------------------------------------------------------------
  15. # This software is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  17. # or FITNESS FOR A PARTICULAR PURPOSE.  See the accompanying file `LICENSE'
  18. # for more details.
  19. # -------------------------------------------------------------------------
  20. #
  21. # @(#)$Id: webservice.tcl,v 1.2 2001/08/03 21:46:33 patthoyts Exp $
  22.  
  23. package require SOAP
  24.  
  25. namespace eval webservices {
  26.  
  27.     variable uri    urn:tclsoap:webservices
  28.     variable action urn:tclsoap:webservices
  29.     #variable proxy  http://tclsoap.sourceforge.net/cgi-bin/rpc
  30.     variable proxy  http://localhost/cgi-bin/rpc
  31.  
  32.     SOAP::create register \
  33.         -uri $uri \
  34.         -proxy $proxy \
  35.         -action $action \
  36.         -params {email string passwd string action string}
  37.     
  38.     SOAP::create save \
  39.         -uri $uri \
  40.         -proxy $proxy \
  41.         -action $action \
  42.         -params {email string passwd string action string filedata string}
  43.  
  44.     SOAP::create read \
  45.         -uri $uri \
  46.         -proxy $proxy \
  47.         -action $action \
  48.         -params {email string passwd string action string}
  49.  
  50.     SOAP::create unregister \
  51.         -uri $uri \
  52.         -proxy $proxy \
  53.         -action $action \
  54.         -params {email string passwd string action}
  55. }
  56.  
  57. # -------------------------------------------------------------------------
  58. #
  59. # Local variables:
  60. # mode: tcl
  61. # End:
  62.