[Zope] vcXMLRPC with Zope?
Jim Washington
jwashin@vt.edu
Thu, 05 Dec 2002 11:25:21 -0500
Hi
I had the same problem last week. vcXMLRPC puts strings into a CDATA
section, which seems to be a problem. I modified their
String.Prototype to look like this:
String.prototype.toXMLRPC = function(){
//<![CDATA[***your text here***]]>
return "<string>" + this.replace(/</g, "<").replace(/&/g,
"&")+ "</string>"; //.replace(/</g, "<").replace(/&/g, "&")
}
and it seems to work OK with strings now. They had the bit
commented-out, so I presume that some implementations prefer the CDATA
syntax.
-- Jim Washington
S Babu wrote:
> Hello,
>
> 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/).
>
> py script is called "str" and is in http://localhost:8080/services .
> It takes one parameter s and has one line "return 'ret' + s
>
> All I get in the browser is None as the return value from the service.
> Any idea?
>
> --- html --
>
> <script src="vcXMLRPC.js" type="text/javascript"></script>
> <script language="JavaScript" type="text/javascript">
> <!--
> var strService;
> strService = XMLRPC.getService("http://localhost:8080/");
> strService.add("services.str","str")
> XMLRPC.onerror = function(e){
> alert(e.message);
> return true;
> }
> var done = false;
> function getIt(inStr){
> alert(inStr);
> outStr = strService.str(inStr);
> alert(outStr);
> return (outStr);
> }
> //-->
> </script>
>
> TIA
> S Babu
>
>
> _______________________________________________
> 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 )