I suspect that the Java installation on the machine that you are running the code on has certification issues with your Windchill Server's SSL configuration. You may need to import the SSL certificate (if self signed) for the server or the CA (if a proper SSL cert) into the Java Installation's keystore.
Something along these lines:
C:\ptc\java\bin\keytool -import -alias <server name> -file c:\temp\Windchill.cer -trustcacerts -keystore c:\ptc\java\jre\lib\security\cacerts