In which I make an open source project.

Published April 09, 2010
Advertisement
I needed some RPC, and I didn't like how fat most implementations were (client or server or both), so I made a skinny one. And I made it open source. And it's here.

http://code.google.com/p/as-rpcmin/

If you're curious as to what a complete XML-RPC client in 200 lines of code looks like, it's here.

http://code.google.com/p/as-rpcmin/source/browse/trunk/com/RPCmin/RPCmin_XML.as

As for what it's about, here's the summary

This is a tiny, yet complete, XML-RPC client object in ActionScript 3.

I always liked XML-RPC because it's a pretty commonsense way to pass information back and forth between client and server. Also it's dirt-simple to implement in PHP, and anything that minimizes the amount of server work I need to do is fine in my book.

Only problem is that the XML-RPC mechanisms I found for AS were either Flex-only, weren't for AS3, were abandoned very early on, or were overly complicated. Given that E4X raises (or lowers) XML to the status of a primitive data-type in AS3, and AS has had http communication since the beginning, it made no sense that RPC mechanisms should be complicated. So I wrote a small one that fits in a single 200-line AS3 file, consisting of one object which contains one public function to do the call and set the receive the response.

I'm calling the project "rpcmin" because I'd like to see other implementations following this simple RPC.call('name', params, completeFN, faultFN) method so people can just "drop in" whatever RPC object fits the available client. AM3 would be fairly simple. JSON could certainly be done too, although JSON encoding and decoding would take a little more code.

As for the license, I chose BSD because "Public Domain" wasn't an option. It took me a day to write, so there's no need to credit me. If you fix any bugs, by all means contact me or join the project. It can certainly use a little more testing, especially regarding nested and/or complex objects.

As it stands, it seems to work.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement