• dmorse
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,

My application should allow to SFDC user to be connected directly. So I need to check if it is a valid SFDC user. I do not want test and know his login and password. Test the SFDC session id of the user seem to be a good test. If the user has a session valid, he is connected, so he can access to my application.

But, I met a SSL exception when I tried to run the code Invalid connection from web intergation link. Cannot verify sessionId is correct: ; nested exception is:
 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

After searching in the sforce community, I found this solution :  upgrade to the latest JRE solved the problem. I have uninstalled my previous java version and reinstalled the latest J2SDK.
And now, I am using the J2RE, Standard Edition <build 1.4.2_05-b04> but I already have the error.
 
Remark: Previously I have succeeded to run the pre-compiled sample in the Java Getting Started Package (sforce 4.0)
 1. Login Only
 2. Create Account
 3. Create Contact
 4. Create Task
 5. Run Query
 6. Run Retrieve
 ...
 
Hope I have been clearer. Appreciate your help.
 
Thanks,
Laurent
 
Note : This is the code :
 
VerifySessionId(String sfdcSessionId) {
 
//Initialize the binding stub
SoapBindingStub binding = null;
try
{
 binding = (SoapBindingStub)new SforceServiceLocator().getSoap();
}
catch(Exception e)
{
 System.out.println(e.getMessage());
}
 
//Create a new session header object and add the session id
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(sfdcSessionId);
//Set the session header for subsequent call authentication
binding.setHeader("SforceService", "SessionHeader", sh);
 
//Now try to actually do something with the API
try
{
 //Retrieve the current system timestamp from the sforce Web service
 GetServerTimestampResult now = binding.getServerTimestamp();
 if(now == null)
  System.out.println("Cannot determine sforce server timestamp. User may be invalid");
 else
  System.out.println("Valid sessionId connection from web integration link at "+now.getTimestamp().getTime  ());
}
catch(Exception e)
{
 System.out.println("Invalid connection from web intergation link. Cannot verify sessionId is correct:  "+e.getMessage());
}
}
Hi,

My application should allow to SFDC user to be connected directly. So I need to check if it is a valid SFDC user. I do not want test and know his login and password. Test the SFDC session id of the user seem to be a good test. If the user has a session valid, he is connected, so he can access to my application.

But, I met a SSL exception when I tried to run the code Invalid connection from web intergation link. Cannot verify sessionId is correct: ; nested exception is:
 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

After searching in the sforce community, I found this solution :  upgrade to the latest JRE solved the problem. I have uninstalled my previous java version and reinstalled the latest J2SDK.
And now, I am using the J2RE, Standard Edition <build 1.4.2_05-b04> but I already have the error.
 
Remark: Previously I have succeeded to run the pre-compiled sample in the Java Getting Started Package (sforce 4.0)
 1. Login Only
 2. Create Account
 3. Create Contact
 4. Create Task
 5. Run Query
 6. Run Retrieve
 ...
 
Hope I have been clearer. Appreciate your help.
 
Thanks,
Laurent
 
Note : This is the code :
 
VerifySessionId(String sfdcSessionId) {
 
//Initialize the binding stub
SoapBindingStub binding = null;
try
{
 binding = (SoapBindingStub)new SforceServiceLocator().getSoap();
}
catch(Exception e)
{
 System.out.println(e.getMessage());
}
 
//Create a new session header object and add the session id
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(sfdcSessionId);
//Set the session header for subsequent call authentication
binding.setHeader("SforceService", "SessionHeader", sh);
 
//Now try to actually do something with the API
try
{
 //Retrieve the current system timestamp from the sforce Web service
 GetServerTimestampResult now = binding.getServerTimestamp();
 if(now == null)
  System.out.println("Cannot determine sforce server timestamp. User may be invalid");
 else
  System.out.println("Valid sessionId connection from web integration link at "+now.getTimestamp().getTime  ());
}
catch(Exception e)
{
 System.out.println("Invalid connection from web intergation link. Cannot verify sessionId is correct:  "+e.getMessage());
}
}