用于Zope2的JSON-RPC服务器

Products.jsonserver的Python项目详细描述


提供来自zope2的json-rpc请求。

文件

该产品会对发布服务器进行修补,以满足zope2中的json/rpc请求。 它基于:

  • original product for earlier versions of Zope2 by Balazs Ree
  • jsonserver for zope3 by Jim Washington jwashin@vt.edu and Contributors
  • ZPublisher/xmlrpc.py

json是javascript对象表示法。JSON-RPC执行相同的服务 作为xml-rpc,除了格式是javascript脚本对象而不是 xml,内容类型为“application/json rpc”,而不是“text/xml”。

这个项目重写一些基本的zope2代码来提供 正确监听和响应类型请求的功能 “应用程序/json”。

使用Zope 2.10和Zope 2.13对产品进行测试

安装:

把这个鸡蛋加到你的Zope/Plone积木里。

用法:

类似于xmlrpc用法。

jsonserver查找内容类型“application/json”,并处理 请求为json-rpc。其他http请求不受影响,并将 想必工作如期。

对于web浏览器(javascript)以外的通信,simplejson 或者其他json实现具有读写功能 json对象。

json-rpc请求的文本如下:

{'id':jsonid,''method':remotemethod,'params':methodparams}

其中:

o jsonid is a string or number that may identify this specific request

o remotemethod is the method to call on the server

o methodparams is a list(javascript Array) of parameters to the method

json-rpc响应的文本如下:

{'id':jsonid,''result':returnedresult,'error':returnederr}

其中:

o jsonid is the same jsonid as sent in the request

o returnedresult is a javascript representation of the result or null

o returnederr is a javascript representation of an error state

returnedresult或returnederr将是javascript空值。

使用urllib的实际实现作为 读者提示:使用minjson.write(对象)和minjson.read(字符串) 传输前后的转换方法。

五个扩展

“json”命名空间(http://namespaces.zope.org/json)定义 pagepages指令。json:pagebrowser:page中的用法,但是 允许在json请求中调用,但将 对于普通请求不可见。

browser:pagebrowser:page声明将 可用于普通请求和json请求。

json:page可以从代码和 它们的宏将从其他模板中可见。

<json:page
    name="myjsonrpcview"
    for="*"
    class=".jsonrpc.MyJsonRpcView"
    permission="zope2.ViewManagementScreens"
    />

代码:

产品代码可在以下位置找到: https://bitbucket.org/tomgross/products.jsonserver

更改历史记录

1.2B6(2013-06-17)

  • plone 4.3兼容性 [rristow]

1.2B5(2012-03-21)

  • 在manifest.in中包括zcml文件 [汤姆•格罗斯]

1.2B4(2012-03-21)

  • 另一个清单.in fix [汤姆•格罗斯]

1.2b3(2012-03-21)

  • 添加了manifest.in并修复了破碎的鸡蛋 [汤姆•格罗斯]

1.2b2(2012-03-20)

  • 使用simplejson/json而不是minjson实现 [汤姆•格罗斯]
  • 仅允许UTF-8作为输入编码 [汤姆•格罗斯]
  • Zope 2.13兼容性 [汤姆•格罗斯]
  • 修复了与重氮一起使用时出现的问题 [汤姆•格罗斯]

1.2b1(2011-10-07)

  • 带字符集的固定内容类型 [汤姆·格罗斯,谢谢史蒂夫·斯皮克米尔]
  • 已更改has_keywith uuu contains_uu呼叫 [汤姆•格罗斯]
  • 固定发送未授权状态 [汤姆•格罗斯]
  • 根据JSON-RPC规范返回错误对象 http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#ErrorObject [汤姆·格罗斯,谢谢史蒂夫·斯皮克米尔]

1.2A1(2010-07-15)

贡献者

  • Tom Gross,作者
  • 平衡树
  • 罗德里戈·里斯托

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java返回入for循环或外循环   Android是由java引起的。安全cert.CertPathValidatorException:找不到证书路径的信任锚点   PHP和Java之间有什么区别?   java我想将gridview更改为recyclerview   java获取分页的行数   试图在Java类中计算CKJM时发生类错误   java如何在BIRT报告中集成谷歌地图   java我可以在enum上使用Spring的@Component吗?   在Android Java的硬件键盘上设置CAPS_LOCK和NUM_LOCK   XSD 1.1断言中基于java XSD attributevalue的regexvalidation   java从命令行设置spring属性文件位置   Ogg格式的java语音录制?   java我能找到Groovy代码块中可能抛出的所有(已检查的)异常吗?   java为什么这会导致ClassCastException?   java在安卓 studio中的活动之间传递数据   java Intellij:如何从现有进程更新运行配置环境?   java我们如何创建Dagger 2的依赖关系图?   java如何从JSP页面到servlet获取数据   Java https连接证书不受信任+javax。网ssl。SSLException:PKIX路径生成失败