FluorineFx.NET

Quick Start

First of all only services classes marked with FluorineFx.RemotingServiceAttribute are supported and only methods decorated with FluorineFx.Json.JsonRpcMethod attribute are callable using the standard JSON-RPC protocol

namespace ServiceLibrary
{
 [RemotingService()]
 public class MyService
 {
   public MyService()
   {
   }
  
   [FluorineFx.Json.JsonRpcMethod]
   public string Echo(string txt)
   {
     return txt;
   }
 }
}

The gateway dynamically generates JavaScript code for the client-side proxy. This code will contain a class that you can instantiate and use to call the server methods either synchronously and asynchronously. In an HTML/ASPX page, you can import the proxy by using the JsonGateway.aspx URL as the script source and using ?proxy as the query string.

The destination and source parameters are used to select the remoting service. Source is required only when the remoting destination has asterisk(*) as source.

<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript" src="jsongateway.aspx?proxy&destination=fluorine&source=ServiceLibrary.MyService"></script>
<script type="text/javascript">
/* <![CDATA[ */
window.onload = function() 
{
  var s = new MyService();
  alert("sync:" + s.Echo("some text"));
  s.Echo("some text", function(response) { alert("async:" + response.result) });
}
/* ]]> */
</script>