Well, i think i have to rephrase the question:
What could be the cause for failing to connect to our PTC Integrity Server with our direct access through the API?
This behaviour also leads to two other questions:
Does PTC Server require any specific configuration?
Is a specific Port for the SSL Connection required? If so, which port is it?
The code we used for testing:
public static void main(String[] args) {
IntegrationPointFactory.enableAPILogging(new File(LOG_FILE));
IntegrationPointFactory ipf = IntegrationPointFactory.getInstance();
IntegrationPoint ip = null;
Session session = null;
CmdRunner cmdRunner = null;
try {
String sessionId = "session0815";
/*
* secure integration point to server
*/
ip = ipf.createIntegrationPoint(
HOST, PORT, true, APIVersion.API_4_16);
session = ip.createNamedSession(
sessionId, APIVersion.API_4_16, USER, PASSWORD);
cmdRunner = session.createCmdRunner();
cmdRunner.setDefaultHostname(HOST);
cmdRunner.setDefaultPort(PORT);
cmdRunner.setDefaultUsername(USER);
cmdRunner.setDefaultPassword(PASSWORD);
Command cmd = new Command("im", "issues");
cmd.addOption(new Option("query", QUERY));
cmd.addOption(new Option("fields", "id,state,type,project,summary,assigned user"));
Response response = cmdRunner.execute(cmd);
Result result = response.getResult();
WorkItemIterator wii = response.getWorkItems();
WorkItem workItem;
int id;
Item stateItem;
Item typeItem;
Item projectItem;
while(wii.hasNext()) {
workItem = wii.next();
id = workItem.getField("id").getInteger();
stateItem = workItem.getField("state").getItem();
typeItem = workItem.getField("type").getItem();
projectItem = workItem.getField("project").getItem();
Project p = new Project (id, stateItem.getId(),
typeItem.getId(), projectItem.getId());
System.out.println(p.toString());
}
cmdRunner.release();
session.release();
ip.release();
} catch (APIException apie) {
apie.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
cmdRunner.release();
session.release();
ip.release();
} catch (Exception e) {
e.printStackTrace();
}
}
You can find error logs from both hosts attached in this reply. It might help to find a solution.
Thank you in advance!