Writing a Java XML-RPC client
We have already seen how to create a REST client or SOAP client and use it to connect to JIRA from an external third-party application. In this recipe, we will see how to invoke an XML-RPC method from a client application written in Java.
The Javadocs for the XML-RPC client can be found at http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/xmlrpc/XmlRpcService.html.
Getting ready
Make sure the Accept remote API Calls option is turned ON in JIRA under Administration | System | General Configuration.
How to do it...
Let's try to retrieve the list of projects using the XML-RPC service deployed within JIRA. The following are the steps:
Create a Maven 2 project and add the dependency for
Apache2 xml-rpc
libraries.<dependency> <groupId>xmlrpc</groupId> <artifactId>xmlrpc</artifactId> <version>2.0</version> </dependency>
Note that the version of the
xml-rpc
libraries we have...