You are not logged in Log in Join
You are here: Home » Members » ike » Flash and Zope communications » Flash-Zope-DiscussionWiki » FlashXMLRPC

Log in
Name

Password

 
 

History for FlashXMLRPC

??changed:
-
<h2>Flash --> XML-RPC --> Zope</h2>

**Why XML-RPC ?**

    Flash can natively do a lot of amazing stuff loading simple "XML data":http://webopedia.com/TERM/X/XML.html , and while loading XML from various Zope Datasources is great, but put simply, wrtiing programatic XML parsers can be a lot of work- both for python, or actionscript.
More than being an art in itself, writing an XML parser can be a prohibitive amount of work when all you want to do is pass a few data objects between flash and zope for a simple app.

    Enter "XML-RPC":http://xmlrpc.com/ .  XML-RPC is a very simple xml "specification":http://xmlrpc.com/spec for making "remote procedure calls":http://www.webopedia.com/TERM/R/RPC.html over "http":http://www.webopedia.com/TERM/H/HTTP.html and "https":http://www.webopedia.com/TERM/S/SSL.html , respectively.  There have been implimentations of xmlrpc written in "almost every Known programming language and enviornment":http://www.xmlrpc.com/directory/1568/implementations .

  - "Zope natively speaks XML-RPC for any zope object!":http://www.zope.org/Members/Amos/XML-RPC

  - Python has several available libraries, but the "xmlrpclib":http://web.pydoc.org/2.2/xmlrpclib.html module is availible natively, as of Python 2.2- and has classes for implimenting both a client and server application using xmlrpc.
  
  - Check out "Why Use XMLRPC with Flash":http://zope.org/Members/logik/WhyUseXMLRPC

**Flash, has 2 xmlrpc client libraries that I know of:**

  -XML-RPC Flash Client Library for !ActionScript 2.0 distributed on Sourceforge http://sourceforge.net/projects/xmlrpcflash/

  -and this different library: http://members.netmadeira.com/killer/xmlrpc written by Pedro Ornealias.

** If you are using Flash 5 or earlier please consider the following problem:**

  Both of these Libraries suffer from one critical illness- Flash messes up the *Content-Type* in it's http request headers.  This has been an intermittent problem with Flash 4 and 5.  Macromedia's "official documentation states":http://www.macromedia.com/support/flash/ts/documents/xml_content_type.htm that there is a *contentType* directive for use with actionscript *sendAndLoad* and *xmlSendAndLoad* objects, but anyone who has worked with it knows that it does not work with **any** degree of consistency.

If you are required to use Flash 4 or 5 then "Flash Remoting":http://www.macromedia.com/support/flash/flashremoting/ is the only method for passing complex data objects between a client and server over http...  Remoting requires a ColdFusion or JRun backend.

**Except, now there is an open solution!!**

Using Apache 2, one is able to simply inject a packet header which can force the proper content-type into a request:
http://www.zope.org/Members/ike/Flash-Zope/FLASH_xmlrpc_zope/index_html