Hi Sumit,<div><br></div><div>That&#39;s great that you figured that out.That part is handle by jabsorb on ParaViewWeb server side but you might not be able to do anything about the way it handle &quot;[]&quot; compare to [].</div>
<div>The jabsorb library automatically try to map some Java class/method to the given json rpc request that it get.</div><div>So it might be easier to just fix the request on the client side the way you did.</div><div><br>
</div><div>Seb</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 1, 2012 at 9:36 PM, Purohit, Sumit <span dir="ltr">&lt;<a href="mailto:Sumit.Purohit@pnnl.gov" target="_blank">Sumit.Purohit@pnnl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Seb,<br>
<br>
I think there is  an  issue with the  way Prototyp library construct JSON Vs how PraviewWeb uses it??.<br>
As for some reason when I call  JSON.stringify() in the paraview.js::executeRemote() method, it returns  json object with double quotes around it.<br>
It is a valid JSON structure but paraviewInstance.jsonRpcClient.VisualizationsManager does not support it.<br>
<br>
I tried using browser&#39;s native toJSON mathod and it worked.<br>
for that in paraview.js  i added :<br>
if(window.Prototype) {<br>
    delete Array.prototype.toJSON;<br>
}<br>
<br>
before code :<br>
var reply_string =<br>
        paraviewInstance.jsonRpcClient.VisualizationsManager.invoke(<br>
            paraviewInstance.sessionId,<br>
            JSON.stringify(JsonRpcObjectBuilder(methodName, methodArguments)));<br>
<br>
<br>
in function executeRemote( paraviewInstance, methodName, methodArguments ) {..............<br>
<br>
and it worked. got clue from here : <a href="http://stackoverflow.com/questions/710586/json-stringify-bizarreness" target="_blank">http://stackoverflow.com/questions/710586/json-stringify-bizarreness</a><br>
<br>
<br>
Ideally          \&quot;params\&quot;:\&quot;[]\&quot;     should work as it is Valid JSON.<br>
where can i find code for  VisualizationsManager.invoke() method so that i can see how is it using input parameters ?<br>
<div class="im"><br>
Thanks<br>
Sumit Purohit<br>
<br>
________________________________________<br>
From: Sebastien Jourdain [<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>]<br>
</div>Sent: Monday, October 29, 2012 6:27 AM<br>
<div class="HOEnZb"><div class="h5">To: Purohit, Sumit<br>
Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
Subject: Re: [Paraview] No rendering in ParaviewWeb with javascript<br>
<br>
Hi Sumit,<br>
<br>
the bug seems to be related to the content of that method<br>
<br>
/*<br>
 * Helper method used to simplify the construction of JsonRPC objects<br>
 */<br>
function JsonRpcObjectBuilder( methodName, methodArguments ) {<br>
    var args = [];<br>
    if(typeof(methodArguments) != &quot;undefined&quot;) {<br>
        if(typeof(methodArguments) != &quot;object&quot;) {<br>
            args = [ methodArguments ];<br>
        } else {<br>
            args = methodArguments;<br>
        }<br>
    }<br>
    return {<br>
        id      : 1,<br>
        method  : methodName,<br>
        params  : args<br>
    };<br>
}<br>
<br>
inside the file WebServer/PWService/web/js/dev/paraview.js which you<br>
can point to in your testing process instead of its parent compressed<br>
one ParaViewWeb.js. Although, don&#39;t forget to add /dev/json2.js and<br>
/dev/jsonrpc.js too when you are using the development version of the<br>
js.<br>
<br>
Once you figured out, what need to be done to prevent those extra &quot;<br>
around [] then you can either send me the full paraview.js or just the<br>
diff so I can patch and update the ParaViewWeb repository.<br>
<br>
Thanks for your help,<br>
<br>
Seb<br>
<br>
On Fri, Oct 26, 2012 at 2:05 PM, Purohit, Sumit &lt;<a href="mailto:Sumit.Purohit@pnnl.gov">Sumit.Purohit@pnnl.gov</a>&gt; wrote:<br>
&gt; Thank Seb for the reply,<br>
&gt;<br>
&gt; 1. Yes, i am using exactly the same javascript in both the contexts.<br>
&gt; 2.  I tried your suggestion of using iframe and I AM ABLE TO EMBEDDED  the functional html page into my  non-functional page and visualize it.<br>
&gt;<br>
&gt; Can you suggest me where/what to make a patch in ParaViewWeb javascript as using iframe is not a &quot;solution&quot; for me. I want to dynamically create this visualization.<br>
&gt;<br>
&gt;<br>
&gt; Thanks<br>
&gt; Sumit<br>
&gt;<br>
&gt; ________________________________________<br>
&gt; From: Sebastien Jourdain [<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>]<br>
&gt; Sent: Friday, October 26, 2012 3:48 AM<br>
&gt; To: Purohit, Sumit<br>
&gt; Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
&gt; Subject: Re: [Paraview] No rendering in ParaviewWeb with javascript<br>
&gt;<br>
&gt; Hum...<br>
&gt;<br>
&gt; I guess it is exactly the same JavaScript code that you execute in both context.<br>
&gt; To me it seems to be a bug in the way the ParaViewWeb javascript is behaving.<br>
&gt;<br>
&gt; But in the mean time, do you try to embed the 3D renderer in an iFrame<br>
&gt; or do you properly embed it into the current HTML document ? Because,<br>
&gt; if you were planing to use some iFrame, the ParaViewWeb javascript<br>
&gt; part could be done in that iFrame page and that might work as is...<br>
&gt; (At least as a first step)<br>
&gt;<br>
&gt; A third solution, could also be to patch ParaViewWeb javascript so it<br>
&gt; could properly work in your context or depending on how complex your<br>
&gt; web application is going to be, create an ad-hoc JavaScript library<br>
&gt; that will make only the call you need and the way you want.<br>
&gt;<br>
&gt; Hope my comments helped you,<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Seb<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Oct 25, 2012 at 4:48 PM, Purohit, Sumit &lt;<a href="mailto:Sumit.Purohit@pnnl.gov">Sumit.Purohit@pnnl.gov</a>&gt; wrote:<br>
&gt;&gt; Thanks Seb,<br>
&gt;&gt;<br>
&gt;&gt; I realized that i was running my html page  under Apache but it was not properly configured to talk to paraviweWeb which is under. tomcat. I Fixed that and i worked fine. Thanks<br>
&gt;&gt;<br>
&gt;&gt; My goal is to add  this code under a Mediawiki Page and run it on a button click BUT when i do that i get &quot;uncaught exception: get_module() takes no arguments (2 given). Paraview.js line 231&quot;<br>
&gt;&gt;<br>
&gt;&gt; I see one deference in the way internal paraviewWeb POST calls are made.<br>
&gt;&gt;<br>
&gt;&gt; 1. When running outside Mediawiki (This Works) :<br>
&gt;&gt;   {id:3,method:&quot;VisualizationsManager.invoke&quot;,params:[&quot;87095ed9081c5fc32c76f43105d74c32-28&quot;, &quot;{\&quot;id\&quot;:1,\&quot;method\&quot;:\&quot;get_module\&quot;,\&quot;params\&quot;:[]}&quot;]}<br>

&gt;&gt;<br>
&gt;&gt; 2. Within MW ( This gives above exception)<br>
&gt;&gt; {id:3,method:&quot;VisualizationsManager.invoke&quot;,params:[&quot;87095ed9081c5fc32c76f43105d74c32-27&quot;, &quot;{\&quot;id\&quot;:1,\&quot;method\&quot;:\&quot;get_module\&quot;,\&quot;params\&quot;:\&quot;[]\&quot;}&quot;]}<br>

&gt;&gt;<br>
&gt;&gt; the difference is  how empty param are specified in both the POST requests.   [] Vs. \&quot;[]\&quot;<br>
&gt;&gt;<br>
&gt;&gt; Both are made internally by ParaViewWeb, so do you think i can control this in my javascript ( actually jQuery) code ?? OR on ParaviewWeb code/config side ??<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt; Sumit Purohit<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ________________________________________<br>
&gt;&gt; From: Sebastien Jourdain [<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>]<br>
&gt;&gt; Sent: Wednesday, October 24, 2012 4:33 AM<br>
&gt;&gt; To: Purohit, Sumit<br>
&gt;&gt; Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
&gt;&gt; Subject: Re: [Paraview] No rendering  in ParaviewWeb with javascript<br>
&gt;&gt;<br>
&gt;&gt; Try to move the script section between &lt;/table&gt; and &lt;/body&gt; . Moreover does the other applications let you properly see 3d content?<br>
&gt;&gt;<br>
&gt;&gt; Seb<br>
&gt;&gt;<br>
&gt;&gt; On Oct 23, 2012, at 4:08 PM, &quot;Purohit, Sumit&quot; &lt;<a href="mailto:Sumit.Purohit@pnnl.gov">Sumit.Purohit@pnnl.gov</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi Everyone,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I am a newbie (and this is a cliche ) in paraview and trying to run ParaViewWeb using javascript rendering.<br>
&gt;&gt;&gt; I installed the Paraview Web and i can access various webapps Ex :<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="http://localhost:8180/PWApp/index.jsp" target="_blank">http://localhost:8180/PWApp/index.jsp</a><br>
&gt;&gt;&gt; <a href="http://localhost:8180/PWService/" target="_blank">http://localhost:8180/PWService/</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; [ i installed ParaviewWeb on port 8180]<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; As a next step i am tried to use its javascript rendering but could not see any thing on the page.<br>
&gt;&gt;&gt; JavaScript console shows &quot;Error: Connection failed&quot; in line 116 ParaviewWeb.js<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Here is my complete HTML<br>
&gt;&gt;&gt; &lt;html&gt;<br>
&gt;&gt;&gt;     &lt;head&gt;<br>
&gt;&gt;&gt;         &lt;script type=&quot;text/javascript&quot; src=&quot;<a href="http://localhost:8180/PWService/js/ParaViewWeb.js" target="_blank">http://localhost:8180/PWService/js/ParaViewWeb.js</a>&quot;&gt;&lt;/script&gt;<br>

&gt;&gt;&gt;     &lt;/head&gt;<br>
&gt;&gt;&gt;     &lt;body&gt;<br>
&gt;&gt;&gt;       &lt;table width=&#39;100%&#39;&gt;<br>
&gt;&gt;&gt;        &lt;tr&gt;<br>
&gt;&gt;&gt;           &lt;td&gt;Viewport title&lt;/td&gt;<br>
&gt;&gt;&gt;        &lt;/tr&gt;<br>
&gt;&gt;&gt;        &lt;tr&gt;<br>
&gt;&gt;&gt;           &lt;td id=&#39;renderer-container-id&#39;&gt;<br>
&gt;&gt;&gt;               &lt;!-- The renderer will be inserted here --&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;    &lt;script type=&quot;text/javascript&quot;&gt;<br>
&gt;&gt;&gt;         // Set the web service base URL<br>
&gt;&gt;&gt;         var serverUrl = &quot;<a href="http://localhost:8180/PWService" target="_blank">http://localhost:8180/PWService</a>&quot;;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         //<br>
&gt;&gt;&gt;         // Create a paraview proxy<br>
&gt;&gt;&gt;         //<br>
&gt;&gt;&gt;         var paraview = new Paraview(serverUrl);<br>
&gt;&gt;&gt;         paraview.createSession(&quot;Session name&quot;, &quot;Session comment&quot;, &quot;default&quot;);<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         var activeView = paraview.CreateIfNeededRenderView();<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         // Create and bind renderer<br>
&gt;&gt;&gt;         var renderer = new JavaScriptRenderer(&quot;rendererName&quot;, serverUrl);<br>
&gt;&gt;&gt;         renderer.init(paraview.sessionId, activeView.__selfid__);<br>
&gt;&gt;&gt;         renderer.setSize(&#39;200&#39;,&#39;200&#39;);<br>
&gt;&gt;&gt;         renderer.bindToElementId(&quot;renderer-container-id&quot;);<br>
&gt;&gt;&gt;         renderer.start();<br>
&gt;&gt;&gt;      &lt;/script&gt;<br>
&gt;&gt;&gt;           &lt;/td&gt;<br>
&gt;&gt;&gt;        &lt;/tr&gt;<br>
&gt;&gt;&gt;        &lt;/table&gt;<br>
&gt;&gt;&gt;     &lt;/body&gt;<br>
&gt;&gt;&gt; &lt;/html&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thank you for the help.<br>
&gt;&gt;&gt; Sumit Purohit<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br></div>