cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
352
Views
0
Helpful
1
Replies

Java fragment works in CCX 10.6, but not 9.0.2

I have a java fragment that makes an AXL query to a call manager that works properly on UCCX 10.6. I am trying to use the same script (validated script in 9.0 editor) querying the same CM 9.1 cluster in CCX 9.0.2, and it fails. I have looked at the certificate store on both clusters since it is making the connection via HTTPS, but they both have the proper certificates in there. I suspect it has to be something simple, but I have not been able to isolate it. Please let me know if you see it. The block below returns a NULL. I was trying to use some StringWriter functions to dump the stack trace, but that doesn't appear to be available. I would certainly be open to ideas there as well. Again, this works perfectly on CCX 10.6.

{
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
String content = SOAPRequest;
String base64auth = BasicAuthEncoded;
int readTimeout = 2000;
try {
     java.net.URL url = new java.net.URL(AXLQueryURL);
     javax.net.ssl.HttpsURLConnection urlCon = (javax.net.ssl.HttpsURLConnection) url.openConnection();
  urlCon.setFixedLengthStreamingMode(content.length());
     urlCon.setReadTimeout(readTimeout);
     urlCon.setDoInput (true);
     urlCon.setDoOutput (true);
     urlCon.setUseCaches (false);
     urlCon.setRequestMethod("POST");
    urlCon.setRequestProperty("Authorization","Basic " + base64auth);
    urlCon.setRequestProperty("Accept","text/*");
     urlCon.setRequestProperty("Content-Type","text/xml");
     urlCon.setRequestProperty("SOAPAction","CUCM:DB ver=8.5 executeSQLQuery");
     java.io.DataOutputStream output = new java.io.DataOutputStream(urlCon.getOutputStream());
     output.writeBytes(content);
     output.flush();
     output.close();
     java.io.DataInputStream input = new java.io.DataInputStream(urlCon.getInputStream());
     int bufSize = 4096; // buffer size, bytes
     byte[] bytesRead = new byte[bufSize];
     int bytesReadLength = 0;
     while(( bytesReadLength = input.read( bytesRead )) > 0 ) {
         baos.write(bytesRead,0,bytesReadLength);
     } //while block ends here
     input.close();
     baos.close();
} catch (Exception e) {
    e.printStackTrace();
    return null;
} // try..catch block ends here
return new String(baos.toByteArray());
} // closure ends here

1 Reply 1

The problem is that Java engine CCX 10.X uses the platform certificate store. CCX 9.X Java engine uses its own certificate store, so it doesn't trust the certificates in the platform store. Still trying to get TAC to help me import the certificates I need into the Java trust store.