Per
11-10-2004, 04:11 PM
First I'd like to say that lps is very cool, and easy to understand :)
I downloaded Lps DE yesterday, my goal was to test if I could use it as a front-end to my C# window service appl. I felt that running IIS just to get xml-rpc or soap was a overkill. Luckily, Lloyd Dupont has written a stand-alone xml-rpc server in C# (http://www.csharphelp.com/archives2/archive433.html) (less than 50 lines!).
Demo/proof-of-concept:
Start the C# server in CS-J-Sample.zip (http://www.csharphelp.com/archives2/files/archive433/CS-J-Sample.zip) and run the following from Lps
<canvas debug="true" height="400">
<debug x="200" y="40" width="250" height="350" />
<xmlrpc name="dotNET" service="http://localhost:1971/myApp/anURI">
<method event="onload">
Debug.write('dotNET XML-RPC service loaded');
Debug.write('proxy:');
Debug.inspect(this.proxy);
</method>
<method event="ondata" args="data">
Debug.write('got data:', data);
</method>
<method event="onerror" args="error">
Debug.write('onerror:', error);
</method>
<remotecall name="greeting" funcname="hello.getGreeting">
<param>
<method name="getValue">
return hello.getValue();
</method>
</param>
<method event="ondata" args="value">
Debug.write('hello.getGreeting ondata:', value);
output.setText(output.getText() + value + '\n');
</method>
</remotecall>
</xmlrpc>
<edittext id="hello" x="10" y="10" text="Navn"/>
<button text="Send" x="140" y="10">
<method event="onclick">
Debug.write('getting response...');
dotNET.greeting.invoke()
</method>
</button>
<window x="10" y="40" width="300" height="200"
title="xml-rpc server says:" resizable="false" closeable="false">
<text id="output" multiline="true"/>
</window>
</canvas>
.. mission accomplished :)
I'm now working on my Lps front-end
I downloaded Lps DE yesterday, my goal was to test if I could use it as a front-end to my C# window service appl. I felt that running IIS just to get xml-rpc or soap was a overkill. Luckily, Lloyd Dupont has written a stand-alone xml-rpc server in C# (http://www.csharphelp.com/archives2/archive433.html) (less than 50 lines!).
Demo/proof-of-concept:
Start the C# server in CS-J-Sample.zip (http://www.csharphelp.com/archives2/files/archive433/CS-J-Sample.zip) and run the following from Lps
<canvas debug="true" height="400">
<debug x="200" y="40" width="250" height="350" />
<xmlrpc name="dotNET" service="http://localhost:1971/myApp/anURI">
<method event="onload">
Debug.write('dotNET XML-RPC service loaded');
Debug.write('proxy:');
Debug.inspect(this.proxy);
</method>
<method event="ondata" args="data">
Debug.write('got data:', data);
</method>
<method event="onerror" args="error">
Debug.write('onerror:', error);
</method>
<remotecall name="greeting" funcname="hello.getGreeting">
<param>
<method name="getValue">
return hello.getValue();
</method>
</param>
<method event="ondata" args="value">
Debug.write('hello.getGreeting ondata:', value);
output.setText(output.getText() + value + '\n');
</method>
</remotecall>
</xmlrpc>
<edittext id="hello" x="10" y="10" text="Navn"/>
<button text="Send" x="140" y="10">
<method event="onclick">
Debug.write('getting response...');
dotNET.greeting.invoke()
</method>
</button>
<window x="10" y="40" width="300" height="200"
title="xml-rpc server says:" resizable="false" closeable="false">
<text id="output" multiline="true"/>
</window>
</canvas>
.. mission accomplished :)
I'm now working on my Lps front-end