<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5506586982735816293</id><updated>2011-11-02T15:48:31.477+01:00</updated><category term='Flash CS3'/><category term='RPC'/><category term='Web Service'/><category term='Flash 9'/><category term='AS3'/><title type='text'>Man Machine Tech</title><subtitle type='html'>Thoughts, ideas and solutions of, about, for and in Flash, Flex, AIR, AS2, AS3 and other matters of vital importance to mankind and the universe as we know it.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://manmachine-tech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5506586982735816293/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://manmachine-tech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Johan Öbrink</name><uri>http://www.blogger.com/profile/03410692619243882540</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5506586982735816293.post-2345508866336241443</id><published>2007-11-16T10:48:00.000+01:00</published><updated>2007-11-19T09:47:28.803+01:00</updated><title type='text'>Web Services in Flash 9 - AS3: part 2</title><content type='html'>Re: &lt;a href="http://labs.alducente.com" target="_blank"&gt;Carlo Alducente&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks for the blessing :) This is my first attempt at publicing code as well as blogging so I'm  a bit uncertain about the etiquette, does and don'ts.&lt;br /&gt;&lt;br /&gt;Anyway... When trying to create an example of the error handling, I discovered two things:&lt;br /&gt;&lt;br /&gt;1. A bug in the call queue. I goofed but now it's corrected.&lt;br /&gt;2. The service allways returned the full response xml. For the moment, I just stripped it so that the content of the Response is returned. The goal is of course to analyse the wsdl and return properly converted data types (strings as strings, ints as ints and complex types as Objects or complex types when the type is registered with a Class alias). This is a project for the future :)&lt;br /&gt;&lt;br /&gt;So &lt;a href="http://tech.manmachine.se/se.manmachine.rpc.zip"&gt;download the new zip&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;...and &lt;a href="http://tech.manmachine.se/RPCExample.zip"&gt;here is the example&lt;/a&gt;:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Service creation:&lt;br /&gt;================================&lt;br /&gt;protected function createService():void {&lt;br /&gt;service = new WebService();&lt;br /&gt;service.addEventListener(LoadEvent.LOAD, onWsdlLoad);&lt;br /&gt;service.addEventListener(FaultEvent.FAULT, onWsdlLoadError);&lt;br /&gt;service.loadWsdl("http://tech.manmachine.se/WebService.asmx?wsdl");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected function onWsdlLoad(event:LoadEvent):void {&lt;br /&gt;trace("wsdl loaded");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected function onWsdlLoadError(event:FaultEvent):void {&lt;br /&gt;trace("wsdl load error: " + event.fault);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Service call:&lt;br /&gt;================================&lt;br /&gt;protected function callService():void {&lt;br /&gt;/*&lt;br /&gt; Method 1&lt;br /&gt; Assign IResponder to the AsyncToken&lt;br /&gt; This class implements IResponder&lt;br /&gt; Result is sent to result function and fault is sent to fault function&lt;br /&gt;*/&lt;br /&gt;var token1:AsyncToken = service.Hello("World");&lt;br /&gt;token1.addResponder(this);&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; Method 2&lt;br /&gt; Listen to events on the AsyncToken&lt;br /&gt;*/&lt;br /&gt;var token2:AsyncToken = service.HelloObject("World");&lt;br /&gt;token2.addEventListener(ResultEvent.RESULT, onResult);&lt;br /&gt;token2.addEventListener(FaultEvent.FAULT, onFault);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function result(data:*):void {&lt;br /&gt;trace("result: " + data);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function fault(info:*):void {&lt;br /&gt;var f:Fault = info as Fault;&lt;br /&gt;trace("fault: " + f);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function onResult(event:ResultEvent):void {&lt;br /&gt;trace("onResult: " + event.result);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function onFault(event:FaultEvent):void {&lt;br /&gt;trace("onFault: " + event.fault);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5506586982735816293-2345508866336241443?l=manmachine-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://manmachine-tech.blogspot.com/feeds/2345508866336241443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5506586982735816293&amp;postID=2345508866336241443' title='30 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5506586982735816293/posts/default/2345508866336241443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5506586982735816293/posts/default/2345508866336241443'/><link rel='alternate' type='text/html' href='http://manmachine-tech.blogspot.com/2007/11/web-services-in-flash-9-as3-part-2.html' title='Web Services in Flash 9 - AS3: part 2'/><author><name>Johan Öbrink</name><uri>http://www.blogger.com/profile/03410692619243882540</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>30</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5506586982735816293.post-7075771549365648836</id><published>2007-11-15T13:34:00.000+01:00</published><updated>2007-11-16T10:48:45.310+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RPC'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash 9'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Service'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash CS3'/><title type='text'>Web Services in Flash 9 - AS3</title><content type='html'>While the push from AS2 to AS3 was completely brilliant and Flex2 and Flex3 are absolute heaven for an OOP programmer, Flash CS3 in AS3 is turning out to be a major dissapointment. All the enhancements and improvements in Flex are met by equal and opposite cuts in Flash functionality.&lt;br /&gt;&lt;br /&gt;WebServices: Gone&lt;br /&gt;Remoting: Gone&lt;br /&gt;Binding: Gone (well... Binding was introduced in CS3... but only in AS2)&lt;br /&gt;&lt;br /&gt;The upside though is that the developer community is strong enough to compensate these blemmishes on the otherwise beutiful face of Flash.&lt;br /&gt;&lt;br /&gt;While looking for a WebService package, I stumbled upon Carlo Alducente's brilliant WSDL parser and service wrapper (&lt;a href="http://labs.alducente.com/?p=7" target="_blank"&gt;http://labs.alducente.com/?p=7&lt;/a&gt;). The only problem is the error handling... and in order to handle errors nicely, what you really want is an AsyncToken... and a Fault class... and a FaultEvent... And a ResultEvent...etc.&lt;br /&gt;&lt;br /&gt;So I rewrote the service package. Although it is packaged as se.manmachine.rpc, all the WSDL parsing and WebService method registering is the work of Carlo. I still haven't recieved his permisson to use his code in this way. Hopefully I will. Kudos Carlo!&lt;br /&gt;&lt;br /&gt;The future plans is to extend the package to incorporate RemotingService (RS and WS both extending AbstractService), and using the Proxy class for registering dynamic methods... And then of course adding events for Invoking and headers, wrapping the headers... well... pretty much implementing the whole mx.rpc package for Flash. The future, however, lies in the future.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tech.manmachine.se/se.manmachine.rpc.zip"&gt;Download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5506586982735816293-7075771549365648836?l=manmachine-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://manmachine-tech.blogspot.com/feeds/7075771549365648836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5506586982735816293&amp;postID=7075771549365648836' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5506586982735816293/posts/default/7075771549365648836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5506586982735816293/posts/default/7075771549365648836'/><link rel='alternate' type='text/html' href='http://manmachine-tech.blogspot.com/2007/11/web-services-in-flash-9-as3.html' title='Web Services in Flash 9 - AS3'/><author><name>Johan Öbrink</name><uri>http://www.blogger.com/profile/03410692619243882540</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry></feed>
