Differences From Artifact [357659fc60]:
- File
docs/Creating a Tcl Web Service.html
— part of check-in
[12835ca719]
at
2008-01-04 23:30:25
on branch proposed-main
—
git-svn-id: http://tclws.googlecode.com/svn/trunk@2 4eab59b1-ed42-0410-973d-ab9b78d4c8bc (user: gerald.lester@4eab59b1-ed42-0410-973d-ab9b78d4c8bc size: 6970)
To Artifact [ea50e12e79]:
- File
docs/Creating a Tcl Web Service.html
— part of check-in
[c64b7f832c]
at
2009-09-30 18:42:38
on branch proposed-main
— 2009 commit
git-svn-id: http://tclws.googlecode.com/svn/trunk@55 4eab59b1-ed42-0410-973d-ab9b78d4c8bc (user: gerald.lester@4eab59b1-ed42-0410-973d-ab9b78d4c8bc size: 8159)
1 2 | <HTML lang=en dir=ltr xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <HEAD> | | | 1 2 3 4 5 6 7 8 9 10 | <HTML lang=en dir=ltr xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <HEAD> <TITLE>Creating a Tcl Web Service</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <META content="Creating a Tcl Web Service" name=KEYWORDS> </HEAD> <BODY> <H1>Creating a Tcl Web Service</H1> <TABLE class=toc id=toc> |
| ︙ | ︙ | |||
25 26 27 28 29 30 31 |
<LI class=toclevel-1><A href="#Declaring_Complex_Types"><SPAN
class=tocnumber>4</SPAN> <SPAN class=toctext>Declaring Complex
Types</SPAN></A> </LI></UL></TD></TR></TBODY></TABLE>
<A name=Loading_the_Webservices_Server_Package></A>
<H2>Loading the Webservices Server Package </H2>
| < < < < < < > > > > > > > > > > > > > > > > > > > > > | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<LI class=toclevel-1><A href="#Declaring_Complex_Types"><SPAN
class=tocnumber>4</SPAN> <SPAN class=toctext>Declaring Complex
Types</SPAN></A> </LI></UL></TD></TR></TBODY></TABLE>
<A name=Loading_the_Webservices_Server_Package></A>
<H2>Loading the Webservices Server Package </H2>
<P>To load the webservices server package, do: </P><PRE> package require WS::Server
</PRE>
<P>This command will only load the server the first time it is used, so it
causes no ill effects to put this in each file declaring a service or service
procedure. </P>
<h3>Using as part of TclHttpd</h3>
<P>
The Web Services package, WS::Server, is not a standalone application, but rather is designed
be a "module" of TclHttpd.
The following command is normally placed in httpdthread.tcl:
</P>
<h3>Embedding in a Standalone Application</h3>
<P>
To embed a Web Service into an application, the application needs to be event
driven and you also need to use the <B>WS::Embeded</b> package. You also must
define the service with the <i>-mode=embedded</i> option.
</P>
<P>
See also
<A HREF="Embedded Web Service.html">Embeding a Web Service into an application</A>.
</P>
<HR>
<A name=Defining_a_Service></A>
<H2>Defining a Service </H2>
<P>
The code that defines a service is normally placed in one or more files in the custom directory.
</P>
<P><B>Procedure Name : <I>::WS::Server::Service</I></B> </P>
<P><B>Description</B> : Declare a Web Service, the following URLs will
exist </P><PRE> /service/<ServiceName>
Displays an HTML page describing the service
/service/<ServiceName>/wsdl
Returns a WSDL describing the service
/service/<ServiceName>/op
Invoke an operation
|
| ︙ | ︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
The signature of the command must be:
cmd \
service \
operation \
caller_ipaddr \
http_header_list \
soap_header_list
</PRE>
<P><B>Returns</B> : Nothing </P>
<P><B>Side-Effects</B> : None </P>
<P><B>Exception Conditions</B> : </P><PRE> <I>MISSREQARG</I> -- Missing required arguements
</PRE>
<P><B>Pre-requisite Conditions</B> : None </P>
<HR>
| > > > > > > > > > > | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
The signature of the command must be:
cmd \
service \
operation \
caller_ipaddr \
http_header_list \
soap_header_list
-mode - Mode that service is running in. Must be one of:
tclhhtpd -- running inside of tclhttpd or an
evironment that supplies a
compatilbe Url_PrefixInstall
and Httpd_ReturnData commands
embedded -- using the ::WS::Embedded package
-ports - List of ports for embedded mode. Default: 80
NOTE -- a call should be to
::WS::Embedded::Listen for each port
in this list prior to this call
</PRE>
<P><B>Returns</B> : Nothing </P>
<P><B>Side-Effects</B> : None </P>
<P><B>Exception Conditions</B> : </P><PRE> <I>MISSREQARG</I> -- Missing required arguements
</PRE>
<P><B>Pre-requisite Conditions</B> : None </P>
<HR>
|
| ︙ | ︙ |