[Zope] vcXMLRPC with Zope?
S Babu
vattekkat.babu@verizon.net
Thu, 05 Dec 2002 12:01:44 -0500
Brad,
My py script is just one line
return "ret" + s
I had to setup vcXMLRPC to send data NOT embedded in CDATA sections as
mentioned by Jim Washington. However, the final application is for
tidying html source - so I need to use CDATA :-)
S Babu
http://vsbabu.org
Brad Clements wrote:
>>I've a python script that works nicely from python xmlrpclib client. I'd
>>like to use it to work from the browser, preferably using vcXMLRPC library
>>( www.vcdn.org/Public/XMLRPC/).
>>
>>
>
>You should have also posted your python script.
>
>I don't use the the getService method in vcXMLRPC, my javascript code is below..
>
>Zope's xmlrpc needs an exact argument count match to call a PythonScript.
>
>So, all of my Python Scripts take two arguments:
>
>rqType="", rqDict={}
>
>where rqType is a string, and rqDict is a variable argument list.
>
>
>Here's some javascript code:
>
>
> oStruct = {
> orgid:currentOrgID,
> profiletype:profiletype,
> profile:selectedValue,
> instanceDict:handler.getInstanceDict()
> }
> updateButtonObject.disabled = true;
> try {
> result = XMLRPC.call(OrgBaseURL,OrgBaseProcessRequest,"SelectProfile",oStruct);
> if(result != "true")
> alert(result);
> else {
> loadProfilesForOrg(currentOrgID);
> }
> }
> catch(err) {
> if(err instanceof Error)
> alert("Unexpected Error Org UpdateProfile:"+err.message);
> else
> alert("Unexpected Error Org UpdateProfile:"+err);
> }
>
>
>oStruct ends up in rqDict in the Pythonscript, and rqType == 'SelectProfile'
>
>OrgBaseURL and stuff is set like this:
>
>var OrgBaseURL='<dtml-var "Orgs.absolute_url()">';
>var OrgBaseProcessRequest = "Orgs.XMLRPCRequest_py";
>
>Note that my javascript file is a DTML method.
>
>XMLRPCRequest_py is the PythonScript id
>
>
>
>
>
>Brad Clements, bkc@murkworks.com (315)268-1000
>http://www.murkworks.com (315)268-9812 Fax
>AOL-IM: BKClements
>
>
>_______________________________________________
>Zope maillist - Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>** No cross posts or HTML encoding! **
>(Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>