关于Bugzilla WebService接口
参考: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
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调用。
参数
除了标准的参数类型如int
, string等外,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则代表是临时性错误。
关于Bugzilla WebService接口的更多相关文章
- java调用CXF WebService接口的两种方式
通过http://localhost:7002/card/services/HelloWorld?wsdl访问到xml如下,说明接口写对了. 2.静态调用 // 创建WebService客户端代理工厂 ...
- 从xfire谈WebService接口化编程
前段时间有博友在看我的博文<WebService入门案例>后,发邮件问我关于WebService 接口在java中的开发,以及在实际生产环境中的应用.想想自己入职也有一段时间了,似乎也该总 ...
- java获取https网站证书,附带调用https:webservice接口
一.java 获取https网站证书: 1.创建一个java工程,新建InstallCert类,将以下代码复制进去 package com; import java.io.BufferedReader ...
- php中调用WebService接口
一.背景 调用第三方短信提供商的WebService接口. 二.介绍 1.WebService三要素: SOAP(Simple Object Access Protocol) 用来描述传递信息的格式 ...
- cxf设置代理访问webservice接口
由于业务上的需要,需要访问第三方提供的webservice接口,但由于公司做了对外访问的限制,不设置代理是不能外网的,如果使用http设置代理访问外网还是比较容易的,但使用cxf有点不知道从哪里入手. ...
- 通过iTop Webservice接口丰富OQL的功能
通过Python调用iTop的Webservice接口: #!/usr/bin/env python #coding: utf-8 import requests import json itopur ...
- ab post 测试 http 和 webservice 接口方法及用例
1.ab测试简单http请求 ab -n30000 -c1000 "http://10.1.1.21:8080/" 2.ab 测试 http 接口 (POST) ab -n400 ...
- 常用的Webservice接口
常用的Webservice接口 . 查询手机:http://www.yodao.com/smartresult-xml/search.s?type=mobile&q=手机号码 . 查询IP:h ...
- Java调用webservice接口方法
java调用webservice接口 webservice的 发布一般都是使用WSDL(web service descriptive langu ...
随机推荐
- 看svn用户组管理功能的产品设计
我负责公司的svn配置.用了近一年了,今天饶有兴致,分享一下svn的用户组管理功能,这个产品设计值得借鉴,简单易用. svn用户组管理的功能描述:新建用户组,并给组分配成员用户:编辑用户组,包括修改组 ...
- PSR规范
背景 Framework Interoperability Group(框架可互用性小组),简称 FIG,成立于 2009 年.FIG 最初由几位知名 PHP 框架开发者发起,在吸纳了许多优秀的大脑和 ...
- Memcache分布式部署方案
基础环境 其实基于PHP扩展的Memcache客户端实际上早已经实现,而且非常稳定.先解释一些名词,Memcache是danga.com的一个开源项目,可以类比于MySQL这样的服务,而PHP扩展的M ...
- iOS-数据持久化-属性列表
属性列表 属性列表文件是一种XML文件,Foundation框架中的数组和字典等都可以于属性列表文件相互转换. NSArray类常用读写属性列表文件的方法: +arrayWithContentsOfF ...
- html5视频全频播放
html5视频全频播放 旋转90度 对video进行缩放 修正position 效果还凑合 代码 $(media).rotate({ // angle: 90, duration: 100, anim ...
- SQL将JSON转成列
好久不写东西,这个也没什么技术含量,放上来玩玩,也许有人用的着. /** * create procedure for get all fields from json * * Mark * * 20 ...
- 关于json序列化和反序列的问题,没事写个案例,希望能帮到那些需要帮忙的朋友!
现在关于json的读写问题,有许许多多的解决方法,因人而异,根据实际问题去选择自己想要的最容易方法.我觉得自带的Newtonsoft.Json是个不错的选择,随便写两个例子吧! 一:关于简单的json ...
- 对于资源上MissingScript的清理方案讨论
Unity工程随着复杂度的提升,常会有Prefab上的脚本丢失的情况,如下图所示: 首先失去关联的脚本,是没有线索找到原来是什么文件的,那么有没有办法批处理将这些MissingScript进行一下清理 ...
- 深入理解javascript作用域系列第四篇——块作用域
× 目录 [1]let [2]const [3]try 前面的话 尽管函数作用域是最常见的作用域单元,也是现行大多数javascript最普遍的设计方法,但其他类型的作用域单元也是存在的,并且通过使用 ...
- 深入理解CSS定位中的偏移
× 目录 [1]定位 [2]包含块 [3]偏移属性[4]绝对定位[5]格式化 [6]auto 前面的话 CSS有三种基本的定位机制:普通流.浮动和绝对定位.利用定位,可以准确地定义元素框相对于其正常位 ...