Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Java Error:


I am new user to Test Rail, i am trying to integrate with SOAP UI.
I have referred your site and created a package com.gurock.testrail and added the APIClient & APIException to that package in Eclipse IDE.
And a new class i have created and working and using your code as below
public static void main(String[] args) throws Exception
APIClient client = new APIClient(“”);
//System.out.println(“Login Successful”);
JSONObject c = (JSONObject) client.sendGet(“get_cases/:project_id”);

When i run this i ma getting the following error: (When we launch in browser for this URL, it is working fine from eclipse unable to hit)
Exception in thread “main”
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at com.gurock.testrail.APIClient.sendRequest(
at com.gurock.testrail.APIClient.sendGet(
at sample.Program.main(



The address you specified is wrong. You need to specify just the base address, without including index.php etc.


Please refer to our examples here:


I tried with both the URL still i am getting the same error like ( & And also i tried with HTTP / S as well.

But the same URL if we provide in browser and able to connect. From eclipse i am trying connect unable establish the connection.

Any other solution to mitigate from this issue.


This looks like a DNS issue with your Java environment. Or you might have a proxy configured in your browser which results in the site access working in your browser but not from other processes on your machine. So this looks like a problem unrelated to TestRail; have you tried looking up the address for other host names from your Java code, e.g. or similar?



Thanks for the reply, i will check it how to solve proxy / DNS issue.

I have one more query, i have to integrate Test Rail with SOAP UI.
SOAP UI will support Groovy & Java Script and also java can be called in SOAP UI using .Jar file, and SOAP UI will not recognize .Java or .Class file, Test Rail providing json-simple-1.1.1.jar & APIClient.Java, APIException.Java, in this case if i want to integrate how to use the (APIClient.Java, APIException.Java) java files, do we need to convert into one more .Jar (APIClient.Java, APIException.Java) or simply we can use json-simple-1.1.1.jar alone.


The .java files are just the source files (the Java source code). The .jar files are just compiled Java packages. The JSON library is just a library our example bindings use. Do you have a colleague who is familiar with Java who can assist?



Thanks for the reply
I have added the Json .Jar into SOAP UI/bin/ext folder.
And i am trying with the code as mentioned in your site. but i am unable to proceed.
import java.util.HashMap;
import org.json.simple.JSONObject;

public class Program {

public static void main(String[] args) throws Exception
	test client = new test("");
	//System.out.println("Login Successful");
	JSONObject c = (JSONObject) client.sendGet("get_cases/:project_id");


Can you please assist me like a process, how i can proceed with SOAP UI to Integrate the TestRail.



Thanks for the feedback! There are various issues with your code such as not importing the correct namespace, not using the correct class and you are also not using the correct URL (it should be HTTPS). Do you have a person on your team familiar with Java who can assist with your code? Also you don’t necessarily have to use our basic API binding. You can also just call the API directly via simple HTTP requests so you don’t need to use our example binding:


Hi there,

I am running into the same issue. Any further investigation on this?



Hello Pratik,

Can you let me know the exact error you see? If you also see the UnknownHostException, then this is likely a configuration issue (e.g. incorrect TestRail address), or a network issue when you try to access the API.