SOAP-dust example: querying jira codehaus

First: put this in a file named


import soapdust.Client;
import soapdust.ComposedValue;
import soapdust.FaultResponseException;
import soapdust.MalformedResponseException;
import soapdust.MalformedWsdlException;

public class QueryJiraWithSoapdust {

    public static void main(String[] args) 
    throws IOException, MalformedWsdlException, FaultResponseException, MalformedResponseException {
       Client client = new Client();
       String authKey = null;
       try {
       	   ComposedValue authentication = new ComposedValue();
       	   //see to create an account if you dare.
       	   authentication.put("in0", "your login"); //put your login here
       	   authentication.put("in1", "your password"); //put your password here
       	   ComposedValue login ="login", authentication);
       	   authKey = login.getComposedValue("loginResponse").getStringValue("loginReturn");
       } catch (FaultResponseException e) {
          if (e.fault.getComposedValue("detail").getChildrenKeys()
              .contains("com.atlassian.jira.rpc.exception.RemoteAuthenticationException")) {
       	      System.err.println("wrong login or password !");
	  } else {
            throw e;
       ComposedValue query = new ComposedValue();
       query.put("in0", authKey);
       query.put("in1", "10093");
       ComposedValue result ="getIssuesFromFilter", query);
       System.out.println(result); //this will show you issues matching jira filter 10093

Second: download the last version of SOAP-dust

SOAP-dust is currently released under version 0.1.129 and is available here.

Third: Compile your client

  $> javac -cp soap-dust-0.1.129.jar

Fourth: Run your client

$> java -cp soap-dust-0.1.129.jar:. QueryJiraWithSoapdust
wrong login or password !

That's it !

OK... it would display a nicer output with a valid login/password. Do you really want to open an account on ?

And remember: your application depends of only a single jar. Useless but so fun: compare with the cxf dependency graph.