参考:http://www.bugzilla.org/docs/3.2/en/html/api/Bugzilla/WebService.html

http://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService.html

刚翻译完就发现找到是老的api。。。

新版中支持json格式返回、并多了很多接口:

Server Types

Bugzilla::WebService::Server::XMLRPC
Bugzilla::WebService::Server::JSONRPC

WebService Modules

Bugzilla::WebService::Bug
Bugzilla::WebService::Bugzilla
Bugzilla::WebService::Classification
Bugzilla::WebService::Group
Bugzilla::WebService::Product
Bugzilla::WebService::User

API名称

Bugzilla::WebService - Bugzilla的Web Service接口

描述

这是外部程序想与Bugzilla发生交互的标准API,它提供了各模块的各种方式。当前访问该API的唯一方式是通过XML-RPC,相关标准可参看: http://www.xmlrpc.com/spec

Bugzilla WebServices的访问入口是Bugzilla安装目录中 xmlrpc.cgi 脚本文件。比如,如果你的 Bugzilla 位于 bugzilla.yourdomain.com,那么你的 XML-RPC 客户端就要访问 API : http://bugzilla.yourdomain.com/xmlrpc.cgi

方法调用

Bugzilla当前没有实现标准XML-RPC方法调用的扩展特性。方法以常规XML-RPC方式调用。方法以“packages”的形式进行分组,如Bug对应 Bugzilla::WebService::Bug。所以如果是 "get" in Bugzilla::WebService::Bug,在XML-RPC中应该是用Bug.get调用。

参数

除了标准的参数类型如intstring等外,XML-RPC还有两种数据结构 <struct> 及 <array>。

Structs

XML-RPC:

 <struct><member><name>fruit</name><value><string>oranges</string></value></member><member><name>vegetable</name><value><string>lettuce</string></value></member></struct>

API文档里:

 { fruit => 'oranges', vegetable => 'lettuce' }

Arrays

以下示例代码中,[ 和 ] 用来代表数组的起止界定。

比如,XML-RPC中的数组

 <array><data><value><i4>1</i4></value><value><i4>2</i4></value><value><i4>3</i4></value></data></array>

在API文档里,会写成:

 [1, 2, 3]

Bugzilla WebService方法如何接收参数

所有的Bugzilla WebServices 函数以<struct>的形式接收参数。换句话说,所有函数都只接收单个参数,所有的参数都包含在这个参数中。API文档中列出的对应名称的参数意味着放在struct数据结构中。

帐号登陆

你可以使用 "login" in Bugzilla::WebService::User 接口来登陆 Bugzilla 账户。这会产生标准的HTTP cookies,在将来的调用中必须用到这个数据,所以你的XML-RPC客户端必须要能接收与发送cookies的处理能力。

Bugzilla_login and Bugzilla_password

Added in Bugzilla 3.6

You can specify Bugzilla_login and Bugzilla_password as arguments to any WebService method, and you will be logged in as that user if your credentials are correct. Here are the arguments you can specify to any WebService method to perform a login:

Bugzilla_login (string) - A user's login name.
Bugzilla_password (string) - That user's password.
Bugzilla_restrictlogin (boolean) - Optional. If true, then your login will only be valid for your IP address.

The Bugzilla_restrictlogin option is only used when you have also specified Bugzilla_login and Bugzilla_password.

Bugzilla_token

Added in Bugzilla 5.0 and backported to 4.4.3

You can specify Bugzilla_token as argument to any WebService method, and you will be logged in as that user if the token is correct. This is the token returned when calling User.login mentioned above.

Support for using login cookies for authentication has been dropped for security reasons.

方法稳定的、实验性的及不稳定的状态

Methods are marked STABLE if you can expect their parameters and return values not to change between versions of Bugzilla. You are best off always using methods markedSTABLE. We may add parameters and additional items to the return values, but your old code will always continue to work with any new changes we make. If we ever break aSTABLE interface, we'll post a big notice in the Release Notes, and it will only happen during a major new release.

Methods (or parts of methods) are marked EXPERIMENTAL if we believe they will be stable, but there's a slight chance that small parts will change in the future.

Certain parts of a method's description may be marked as UNSTABLE, in which case those parts are not guaranteed to stay the same between Bugzilla versions.

错误

如果某个webservice调用失败,它会抛出一个标准的XML-RPC错误。包括一个数字格式的错误代码,以及相应的描述文字。这些错误代码是固定的,不会因Bugzilla的版本变化而改变。

各种抛出的错误由那些函数的相应文档进行声明。如果你的代码中需要知道会抛出什么错误,用数字代码而不要去分析那些描述文字,因为各版本可能会有变化。

临时错误与重大错误

如果错误代码是大于0的数字,该错误就可以叫做临时错误,意味着是由于用户的输入引起的错误,而不是系统本身。

如果错误代码小于0,则该错误是致命性的,意味着是系统错误,可能需要联系管理员解决。

负数与正数错误不是对称的,比如有一个代号是302的错误,但不一定就对应有-302的错误。

未知错误

有时函数可能抛出具体含义的错误代码,这种情况下-32000代表系统重大错误,32000则代表是临时性错误。

转载于:https://www.cnblogs.com/x3d/p/4187914.html

关于Bugzilla WebService接口相关推荐

  1. 利用MyEclipse开发一个调用webservice接口的程序

    上一篇文章我们已经学习了如何使用Java 工具MyEclipse开发一个webservice接口,那么接口开发好了如何调用?接下来我们就来解决这个问题. 1:首先随便创建一个Java project选 ...

  2. 如何访问webService接口

    在上篇的文章中我们接触到如何来编写webService接口,这篇文章我们将讲述的是如何来访问webService接口 首先比如这样的一个接口:http://127.0.0.1:11111/weathe ...

  3. 如何编写webService接口

    WebService接口代码的编写 如何编写一个webService接口,大家都知道webservice接口的好处可以跨平台来使用,在不同的编程语言之间可以实现,可以更容易的交互. 首先编写一个接口i ...

  4. 调用webservice接口,数据不回滚问题

    调用webservice接口,数据不回滚问题 使用cxf+spring框架开发webservice接口,在开发一个具有保存数据的接口功能时,如果数据发生了异常,对service层无论使用了xml配置声 ...

  5. android调用web接口,Android调用webservice 接口

    以查询手机号码归属地的Web service为例,它的wsdl为 1 在Android项目中导入??Ksoap2-android jar第三方jar包?? 2 Activity代码 public cl ...

  6. jmeter测试webservice接口

    webservice怎样使用jmeter测试呢? 测试样例url=http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx ...

  7. webservice接口与HTTP接口学习笔记

    一.webservice 的概念 Web 是使应用程序可以与平台和编程语言无关的方式进行相互通信的一项技术.Web 服务是一个软件接口,它描述了一组可以在网络上通过标准化的 XML 消息传递访问的操作 ...

  8. mysql webservice接口_WebService接口在PHP中的使用

    Web服务是一种外部使用的服务,PHP调用它实际上非常简单.可以说如果想要对web的知识点有所提升,webService也是每个学习编程人员的基础使用.本篇要带来的是WebService在php中的运 ...

  9. 给一份Webservice接口通用实现!!

    看到许多中小项目的webservice接口的源代码,不禁有个吐槽的冲动.除了会用CXF,Axis2等神级框架,其他的懒得动了,都是Ctrl+V,Ctrl+C,把其他模块的Request,Respons ...

最新文章

  1. asp.net 创建文件夹时出错:未找到路径“D:\”的一部分。(asp.net 使用 FSO)
  2. 线性递推式+求第N项,用矩阵快速幂 如何构造初始矩阵
  3. bash: _upvars: `-a2‘: invalid number specifier bash: /dev/null: 权限不够 bas
  4. 代码单元测试:gtest
  5. 作者:崔代锐(1985-),男,百度外卖研发中心技术总监。
  6. HALCON: HALCON 20.11.0.0 Progress主要新特性
  7. Ubuntu16.04下安装opencv-3.3.0
  8. C语言 - setjmp与longjmp
  9. 厦门大学847信号与系统考研参考书目
  10. 坑爹的工行Chrome网银插件
  11. java进销存管理系统设计_java进销存管理系统的设计与实现-springboot源码
  12. HDU4556_欧拉函数求解法拉数列
  13. 贴片晶振为智能手环带来了哪些功能?
  14. 七七计算机论文,七七计算机外文文献 七七计算机参考文献怎么写
  15. 流量+安全 平安WiFi卡位入口战略
  16. 不想用win11了怎么办?一分钟教你win11退回到win10系统
  17. ”周期天王”20大预言,针针见血,看完整个人通透多了
  18. JavaScript---网络编程(9-1)--DHTML技术演示(2-1)-表格创建的几种方式
  19. mysql 黑名单_51ak带你看MYSQL5.7源码4:实现SQL黑名单功能
  20. Varnish——CDN推送平台管理(web界面批量清除缓存)

热门文章

  1. 环形队列的输出_循环队列的基本操作详细讲解
  2. java 解析xml字符串的_java 解析xml字符串
  3. 计算机硬件能够直接识别的语言是英语,计算机硬件能直接识别、执行的语言是()...
  4. 一个小小Css3动画的案例
  5. python制作简单动画_用Tkinter Python制作简单动画
  6. excel2010设置列宽为像素_职场新手都能学会的Excel技巧:快速调整行高、列宽
  7. python中的ls是什么意思_Python学习之旅:使用Python实现Linux中的ls命令
  8. java list树 广度_java树的广度优先遍历思路
  9. mysql录入图片数据_mysql插入图片数据
  10. linux一切皆是文件_LINUX一切皆文件