AS3 Jayrock wrapper
We've been using ASP.NET Webservices for over 3 years now at Proximity BBDO (thank god it has been that long ago since we abandoned good 'ol sendAndLoad!). The rise of AJAX enabled projects becomes more and more real and we have been on the lookout for more appropriate technologies when using AJAX: JSON. JSON is the de-facto standard when developing and deploying AJAX websites these days so we obviously followed that trend. So, we have Webservices on the one side, and JSON on the other side, both use ASP.NET in most of our projects. In order to simplify JSON - .NET communication in our AJAX sites, Bert Vermeire introduced Jayrock. (He has a wonderful post about JayRock)
Jayrock is a modest and an open source (LGPL) implementation of JSON and JSON-RPC for the Microsoft .NET Framework, including ASP.NET. What can you do with Jayrock? In a few words, Jayrock allows clients, typically JavaScript in web pages, to be able to call into server-side methods using JSON as the wire format and JSON-RPC as the procedure invocation protocol. The methods can be called synchronously or asynchronously.You can see, it is written for ... JavaScript. But it is perfectly usable in Actionscript as well. Adobe itself has a very simple JSON library that allows for JSON serialization and deserialization in AS3. At Google Code I have released a AS3 Jayrock wrapper for easy integration in AS3. [as]import be.wellconsidered.jayrock.events.JayrockEvent; import be.wellconsidered.jayrock.Jayrock; var jrSearch:JayRock = new Jayrock("http://XXX/XXX/wsSearch.ashx"); jrSearch.addEventListener(JayrockEvent.COMPLETE, onResult, false, 0, true); jrSearch.addEventListener(JayrockEvent.ERROR, onError, false, 0, true); jrSearch.searchit({"TAG": "XXX"}); private function onResult(e:JayrockEvent):void{ trace(e.data); } private function onError(e:JayrockEvent):void{ trace(e.data); }[/as]