<<

# bz_webservice_demo.pl

- NAME
- SYNOPSIS
- OPTIONS
- DESCRIPTION
  - Initialization
  - Checking Bugzilla's version
  - Logging In and Out
    - Using Bugzilla's Environment Authentication
    - Using Bugzilla's CGI Variable Authentication
  - Retrieving Bug Information
  - Retrieving Product Information
- NOTES
  - Character Set Encoding
- SEE ALSO

# NAME

bz_webservice_demo.pl - Show how to talk to Bugzilla via XMLRPC

# SYNOPSIS

`bz_webservice_demo.pl [options]`

`bz_webservice_demo.pl --help` for detailed help

# OPTIONS

--help, -h, -?

  Print a short help message and exit.

--uri

  URI to Bugzilla's `xmlrpc.cgi` script, along the lines of `http://your.bugzilla.installation/path/to/bugzilla/xmlrpc.cgi`.

--login

  Bugzilla login name. Specify this together with --password in order to log in.

  Specify this without a value in order to log out.

--password

  Bugzilla password. Specify this together with --login in order to log in.

--rememberlogin

  Gives access to Bugzilla's â€œBugzilla_rememberâ€ option. Specify this option while logging in to do the same thing as ticking the `Bugzilla_remember` box on Bugilla's log in form. Don't specify this option to do the same thing as unchecking the box.

  See Bugzilla's rememberlogin parameter for details.

--bug_id

  Pass a bug ID to have `bz_webservice_demo.pl` do some bug-related test calls.

--product_name

  Pass a product name to have `bz_webservice_demo.pl` do some product-related test calls.

# DESCRIPTION

## Initialization

Using the XMLRPC::Lite class, you set up a proxy, as shown in this script. Bugzilla's XMLRPC URI ends in `xmlrpc.cgi`, so your URI looks along the lines of `http://your.bugzilla.installation/path/to/bugzilla/xmlrpc.cgi`.

## Checking Bugzilla's version

To make sure the Bugzilla you're connecting to supports the methods you wish to call, you may want to compare the result of `Bugzilla.version` to the minimum required version your application needs.

## Logging In and Out

### Using Bugzilla's Environment Authentication

Use a `http://login:password@your.bugzilla.installation/path/to/bugzilla/xmlrpc.cgi` style URI. You don't log out if you're using this kind of authentication.

### Using Bugzilla's CGI Variable Authentication

Use the `User.login` and `User.logout` calls to log in and out, as shown in this script.

The `Bugzilla_remember` parameter is optional. If omitted, Bugzilla's defaults apply (as specified by its `rememberlogin` parameter).

Bugzilla hands back cookies you'll need to pass along during your work calls.

## Retrieving Bug Information

Call `Bug.get_bug` with the ID of the bug you want to know more of. The call will return a `Bugzilla::Bug` object.

## Retrieving Product Information

Call `Product.get_product` with the name of the product you want to know more of. The call will return a `Bugzilla::Product` object.

# NOTES

## Character Set Encoding

Make sure that your application either uses the same character set encoding as Bugzilla does, or that it converts correspondingly when using the web service API. By default, Bugzilla uses UTF-8 as its character set encoding.

# SEE ALSO

There are code comments in `bz_webservice_demo.pl` which might be of further help to you.

<<