Author: lou
Date: 2008-03-19 08:47:45 -0700 (Wed, 19 Mar 2008)
New Revision: 8319
Modified:
openlaszlo/trunk/lps/components/rpc/rpc.lzx
Log:
Change 20080319-lou-4 by [EMAIL PROTECTED] on 2008-03-19 11:42:58 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: add introductory paragraphs and code example from revision 3.4
Bugs Fixed: LPP-5621
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Tests: visual verify
Modified: openlaszlo/trunk/lps/components/rpc/rpc.lzx
===================================================================
--- openlaszlo/trunk/lps/components/rpc/rpc.lzx 2008-03-19 15:46:28 UTC (rev
8318)
+++ openlaszlo/trunk/lps/components/rpc/rpc.lzx 2008-03-19 15:47:45 UTC (rev
8319)
@@ -164,7 +164,70 @@
return true;
]]>
</method>
-
+ <doc>
+ <tag name="shortdesc"><text>remote procedure call</text></tag>
+ <text>
+ <p>The <tag><rpc></tag> tag is the abstract base class
for RPC classes. Subclasses
+ must implement the <method>load()</method> method, which
is responsible for creating
+ the proxy object. The proxy object contains a set of
function stubs
+ that invoke a remote function (or procedure) over the
network. It's
+ up to the caller of the stub function to know what
parameters need to
+ be passed in by looking at what the backend remote
function expects.
+ If calling a JavaRemoting (<javarpc>) function,
looking at the associated
+ Java API will be necessary. If calling a SOAP
(<soap>) function, the
+ developer will need to look at the corresponding operation
in a WSDL file.</p>
+ <p>The implementation of this class can be found in
lps/components/rpc/rpc.lzx. For details, see the
+ <a href="../developers/rpc.html">RPC</a> chapter of the
Developer's Guide.</p>
+ <p>Objects derived from rpc use function stubs in the proxy
object to invoke a remote function.
+ Each function stub expects an array of arguments and a
delegate to deal with the return value,
+ respectively. Both the array and the delegate are
required. If a function has no arguments,
+ rpc passes in an empty array.</p>
+
+ <example title="Invoking remote function using proxy function
stub">
+ <canvas debug="true" height="280">
+
+ <debug x="10" y="40" width="470" height="230" />
+
+ <soap name="temperature" autoload="false"
+
wsdl="http://developerdays.com/cgi-bin/tempconverter.exe/wsdl/ITempConverter">
+
+ <method name="init">
+ super.init();
+ Debug.write('soap service loading...');
+ this.load();
+ </method>
+
+ <handler name="onload">
+ Debug.write('temperature service loaded!');
+ Debug.write('---');
+
+ // don't allow others to call RPC object until proxy is loaded.
+ canvas.convert.setVisible(true);
+ </handler>
+
+ </soap>
+
+ <button name="convert" text="convert" x="10" y="10"
visible="false">
+
+ <attribute name="myDel"
+ value="$once{new LzDelegate(this, 'myhandler')}" />
+
+ <handler name="onclick">
+ var f = 100;
+ canvas.temperature.proxy.FtoC([ f ], this.myDel)
+ Debug.write('Invoking FtoC...');
+ </handler>
+
+ <method name="myhandler" args="data">
+ Debug.write('got data:', data);
+ </method>
+
+ </button>
+
+ </canvas>
+ </example>
+ </text>
+ </doc>
</class>
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins