Xebra XML RPC

Revision as of 11:58, 1 July 2009 by Sandrod (Talk | contribs) (g_demo_servlet.e)

How it works

The file demo.xrpc is translated into g_demo_servlet.e.

See tutorials for a guide about how to create a xml-rpc servlet.


demo.xrpc

<xrpc:api class="MY_XMLRPC_API" namespace="math">
  <xrpc:method name="sum" />
  <xrpc:method name="product" />
</xrpc:api>

g_demo_servlet.e

class
	G_DEMO_XRPC_SERVLET
 
inherit
	XWA_XRPC_SERVLET [MY_XRPC_API]
		redefine
			namespace
		 end
 
create
	make
 
feature -- Access
 
	namespace: IMMUTABLE_STRING_8
			-- <Precursor>
		once
			Result := "math"
		end
 
feature {NONE} -- Factory
 
	new_method_agents: HASH_TABLE [ROUTINE [ANY, TUPLE], READABLE_STRING_8]
			-- <Precursor>
		do
			create Result.make (2)
			Result.put (agent api.sum, "sum")
			Result.put (agent api.product, "product")
		end
 
end