[Seaside] Seaside URL and FLEX HTTPService

Thierry Thelliez thierry.thelliez.tech at gmail.com
Sun Sep 28 18:45:29 UTC 2008


I would not claim much knowledge about FLEX. There might be a better
way to do it...

I am just trying to prototype a web page with part of its content
displayed through FLEX. Seaside would generate the HTML page contening
a call to the SWF file (generated from compiling the FLEX code). The
FLEX component would then call back Seaside to get some XML formatted
data and display that in a DataGrid.

FLEX can call a web service in one call. For example
(from http://www.adobe.com/devnet/flex/quickstart/httpservice/)

   <mx:HTTPService
        id="photoService"
        url="http://api.flickr.com/services/feeds/photos_public.gne"
        resultFormat="e4x"
        result="photoResultHandler(event);"
        fault="photoFaultHandler(event);"
    />

The first problem is that you cannot pass the URL parameters in the URL field.

You could not send:
   <mx:HTTPService
        id="photoService"
        url="http://myServer/seaside/myApp?_s=68pqfS&_k=SW7A&1"
        resultFormat="e4x"
        result="photoResultHandler(event);"
        fault="photoFaultHandler(event);"
    />

They have an XML formatting option using mx:request as described in:
http://www.bpurcell.org/blog/index.cfm?entry=1040&mode=entry

<mx:HTTPService url="{myURL}" id="myHTTPData" method="GET"
resultFormat="object">
  <mx:request>
  <mode>{mode}</mode>
  <mode2>{mode2}</mode2>
  <catid>{catid}</catid>
 </mx:request>


But translated to Seaside does not work (assuming that sField and
kField are filled with the right values):
<mx:HTTPService url="http://myServer/seaside/myApp" id="myHTTPData"
method="GET" resultFormat="object">
  <mx:request>
  <_s>{sField}</_s>
  <_k>{kField}</_k>
  <1></1>
 </mx:request>
</mx:HTTPService>

The <1> is not allowed in XML and the <_s> becomes a %5Fs.

I tried other options but none are friendly to the usage of
underscores and/or the value-less parameters (the last '&1' in the
url).

Has anyone done it? How?
Thanks,
Thierry


More information about the seaside mailing list