The SWF is executed directly by the Flash player, via the loadMovie() call. The flow of control in the rpc implementation <br>for the Flash runtime is this:<br><br>[1] a request is made from the client to the LPS server, as XML text data, using the Flash player &quot;loadMovie()&quot; call,<br>
which expects a swf file to be returned which, when executed, will build&nbsp; the response data values as structures in memory.<br><br>[2] the LPS server passes&nbsp; that XML-RPC request to the apache&nbsp; &quot;axis&quot; RPC library, which sends it to the specified<br>
back-end data server. <br>&nbsp;<br>[3] The XML response from the back-end service is received by the apache axis library. <br><br>[4] The apache library parses the XML response into&nbsp; data types, and there are hooks to<br>call the LPS SWF &quot;data-compiler&quot;, to convert the data&nbsp; into&nbsp; a sequence of SWF instructions, packaged as a SWF format file.<br>
<br>[5] The SWF &quot;movie&quot; is returned  to the flash player, which executes it as part of the loadMovie() call.<br><br>So it is the Flash player which executes the swf data &quot;movie&quot;, not any OpenLaszlo code. The place where you can add instrumentation to<br>
the LPS server would be where it calls the apache axis library, and where the data which is returned from apache axis calls the OpenLaszlo &quot;DataCompiler&quot; library. At that point you could see what data it is encoding. <br>
<br><br><br><br><br><div class="gmail_quote">On Wed, Mar 26, 2008 at 12:04 AM, Gilad Parann-Nissany &lt;<a href="mailto:gilad.parann.nissany@g.ho.st">gilad.parann.nissany@g.ho.st</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><p>Hi</p>
<p>Does&nbsp;anyone have a piece of javascript (or Java) that will actually do this decoding? I mean turn the SWF binary format back into the original data - in our case an xml string ?</p>
<p>Let me explain our use case:</p>
<ul>
<li>we are creating a JMeter test, we make requests and record the responses</li>
<li>we need to look into the response for various reasons (check them for validity, extract IDs and keys used later in the test)</li>
<li>JMeter has built-in facilities for understanding strings and XML, but not SWF</li>
<li>However JMeter also has a <u>general</u> facility to run javascript on the response (its a &quot;BeanShell&quot;)</li>
<li>Essentially we can do a getBytes or getResponseAsString and feed that into whatever javascript you give us</li></ul>
<p>We need a js code snippet that will take the SWF bytes and turn them back to XML string, in the JMeter BeanShell.</p>
<p>I am sure OL has this code somewhere because OL is decoding this format already today. Question is - can you give us a clean code snippet that will do it in the JMeter BeanShell ?</p>
<p>(or any other ideas on how to achieve this goal in JMeter)</p>
<p>Thanks</p>
<p>Gilad</p><font color="#888888">
</font><p></p><div class="Ih2E3d"><br><br>Gilad&nbsp;Parann-Nissany<br><br>----- Original Message -----<br>From: &quot;Henry Minsky&quot; &lt;<a href="mailto:henry.minsky@gmail.com" target="_blank">henry.minsky@gmail.com</a>&gt;<br>
To: &quot;Gilad Parann-Nissany&quot; &lt;<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>&gt;<br>Cc: &quot;laszlo-user&quot; &lt;<a href="mailto:laszlo-user@openlaszlo.org" target="_blank">laszlo-user@openlaszlo.org</a>&gt;, &quot;Yazan Ghandour&quot; &lt;<a href="mailto:Yazan.Ghandour@corp.g.ho.st" target="_blank">Yazan.Ghandour@corp.g.ho.st</a>&gt;, &quot;Rami Khalayleh&quot; &lt;<a href="mailto:Rami.Khalayleh@corp.g.ho.st" target="_blank">Rami.Khalayleh@corp.g.ho.st</a>&gt;, &quot;Anas Jadallah&quot; &lt;<a href="mailto:Anas.Jadallah@corp.g.ho.st" target="_blank">Anas.Jadallah@corp.g.ho.st</a>&gt;, &quot;Elias Khalil&quot; &lt;<a href="mailto:Elias.Khalil@corp.g.ho.st" target="_blank">Elias.Khalil@corp.g.ho.st</a>&gt;<br>
</div><div><div></div><div class="Wj3C7c">Sent: Tuesday, March 25, 2008 4:27:52 PM (GMT+0200) Auto-Detected<br>Subject: Re: [Laszlo-user] XML RPC requests return a &quot;application/x-shockwave-flash&quot; data type<br><br>
Yes, the javascript data is compiled down to swf byte codes which, when executed, recreate that data.<br><br>For example, a list of numbers [1,2,3] compiles to something like<br><br>push 1<br>push 2<br>push 3<br>push 3 <br>
new Array<br><br><br>or whatever the equivalent is in the SWF instruction set<br><br><br><br></div></div><div><div></div><div class="Wj3C7c">
<div class="gmail_quote">On Tue, Mar 25, 2008 at 10:23 AM, Gilad Parann-Nissany &lt;<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>&gt; wrote:<br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p>Hi</p>
<p>In our case it can be pretty big, we do need the performance.</p>
<p>So the actual response format is truly binary (SWF) and not XML at all? in that case the content-type is correct I guess.</p>
<p>or is it text wtih just the encoding set to SWF? in that case I guess we could figure a workaround?</p>
<p>Thank you!</p>
<p>Gilad</p>
<p><br><font color="#888888"><br>Gilad&nbsp;Parann-Nissany</font></p>
<div>
<div></div>
<div><br><br>----- Original Message -----<br>From: &quot;Henry Minsky&quot; &lt;<a href="mailto:henry.minsky@gmail.com" target="_blank">henry.minsky@gmail.com</a>&gt;<br>To: &quot;Gilad Parann-Nissany&quot; &lt;<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>&gt;<br>
Cc: &quot;laszlo-user&quot; &lt;<a href="mailto:laszlo-user@openlaszlo.org" target="_blank">laszlo-user@openlaszlo.org</a>&gt;, &quot;Yazan Ghandour&quot; &lt;<a href="mailto:Yazan.Ghandour@corp.g.ho.st" target="_blank">Yazan.Ghandour@corp.g.ho.st</a>&gt;, &quot;Rami Khalayleh&quot; &lt;<a href="mailto:Rami.Khalayleh@corp.g.ho.st" target="_blank">Rami.Khalayleh@corp.g.ho.st</a>&gt;, &quot;Anas Jadallah&quot; &lt;<a href="mailto:Anas.Jadallah@corp.g.ho.st" target="_blank">Anas.Jadallah@corp.g.ho.st</a>&gt;, &quot;Elias Khalil&quot; &lt;<a href="mailto:Elias.Khalil@corp.g.ho.st" target="_blank">Elias.Khalil@corp.g.ho.st</a>&gt;<br>
Sent: Tuesday, March 25, 2008 3:53:16 PM (GMT+0200) Auto-Detected<br>Subject: Re: [Laszlo-user] XML RPC requests return a &quot;application/x-shockwave-flash&quot; data type<br><br>The issue is that the implementation in swf was written to compile the return data as a Flash swf binary file. The implementation for DHTML uses a JSON encoding. The fix for this would need to be to switch to using the JSON encoding with the swf runtime. We do have a JSON parser for SWF7/8, it would be somewhat slower than the direct-to-swf transport being used now, but that might be acceptable if the amount of data you are sending in each request is not very large. <br>
<br><br></div></div>
<div>
<div></div>
<div>
<div class="gmail_quote">On Tue, Mar 25, 2008 at 9:33 AM, Gilad Parann-Nissany &lt;<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p>Hi all</p>
<p>We have an app using Laszlo XML RPC rather heaviliy, our version is 4.0.8.</p>
<p>Looking at the logs one sees that the REQUESTS produced by our client for XML-RPC are of type &quot;application/x-www-form-urlencoded&quot;</p>
<p>(which makes sense - it is the correct content-type for a POST request).</p>
<p>However the RESPONSEs are of type &quot;application/x-shockwave-flash&quot; which is strange.</p>
<p>We would expect the reponse type to be text/xml or something like that. This is creating a real-world problem for us on various consumers e.g. JMeter - which expect the text/xml to function correctly.</p>
<p>Do you have any experience with this issue?&nbsp;Suggestions or workarounds?</p>
<p>Detailed info from the logs is below.</p>
<p>Thanks </p>
<p>Gilad</p>
<p>P.S. For example: something like the following response headers</p>
<p>----------------</p>
<p>HTTP/1.1 200 OK<br>Expires: Fri, 05 Oct 2001 00:00:00 GMT<br>Date: Tue, 25 Mar 2008 11:51:13 GMT<br>Server: Apache-Coyote/1.1<br>Cache-Control: no-store<br>Content-Type: application/x-shockwave-flash<br>Content-Length: 437<br>
Server: Apache-Coyote/1.1</p>
<p>----------------</p>
<p>is returned from the following request:</p>
<p>----------------</p>
<p>POST <a href="http://localhost/lps/workspace/VC/client/welcomei.lzx?__lzbc__=1205615513625" target="_blank">http://localhost/lps/workspace/VC/client/welcomei.lzx?__lzbc__=1205615513625</a></p>
<p>POST data:<br>fpv=9%2E115&amp;lzr=swf8&amp;proxied=true&amp;lzpostbody=%3C%3Fxml+version%3D%221%2E0%22%3F%3E%0A%3CmethodCall%3E%0A%3CmethodName%3EClientInfo%2EgetGhostInitInfo%3C%2FmethodName%3E%0A%3Cparams%3E%0A%3Cparam%3E%0A%3Cvalue%3E%3Cstring%3E%3C%2Fstring%3E%3C%2Fvalue%3E%0A%3C%2Fparam%3E%0A%3C%2Fparams%3E%0A%3C%2FmethodCall%3E&amp;headers=Content%2DType%3A+text%2Fxml&amp;url=xmlrpc%3A%2F%2Flocalhost%2Fvcweb%2FGhostXmlrpc&amp;reqtype=POST&amp;lzt=data&amp;ccache=false&amp;cache=false&amp;sendheaders=false</p>

<p>Cookie Data:<br>JSESSIONID=2FEEB2B9C6B91302795CD62AD3D274A6</p>
<p>Request Headers:<br>User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)<br>Host: localhost<br>Accept-Encoding: gzip, deflate<br>Accept-Language: he-IL<br>Pragma: no-cache<br>
Content-Type: application/x-www-form-urlencoded<br>UA-CPU: x86<br>Accept: */*<br>Content-Length: 462<br>Connection: keep-alive<br>Referer: <a href="http://localhost/lps/workspace/VC/client/welcomei.lzx?lzt=swf&amp;lzr=swf8" target="_blank">http://localhost/lps/workspace/VC/client/welcomei.lzx?lzt=swf&amp;lzr=swf8</a><br>
x-flash-version: 9,0,115,0<br><font color="#888888"><br><br>Gilad&nbsp;Parann-Nissany<br></font></p></div></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com" target="_blank">hminsky@laszlosystems.com</a><br>
<br></div></div></div></blockquote><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com" target="_blank">hminsky@laszlosystems.com</a><br><br></div></div></div></blockquote>
</div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>