problem in runnig the tests...

Oct 27, 2010 at 10:06 AM
Edited Oct 27, 2010 at 10:52 AM

i successfully complete all the steps which mention in the project documentation. now my project is Eclipse.

i am facing problem while test themodule "PlainLiveSSOSampleTest"

following exception is through while i perform unit test on class PlainLiveSSOSampleTest

 -- - - -  - - - - - -- -  - - - - - - - - - - - - - - - - - - -- - - - - - - -  -- -  --Excption- - - - - - - - - -- - - - - - - - - -  - -- - -  -- - - - - - - - - - - - - -- - - - - - - ----- - - - - -- -

log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.HttpClient).
log4j:WARN Please initialize the log4j system properly.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><WSSecurityHeader xmlns="http://schemas.microsoft.com/Passport/SoapServices/CredentialServiceAPI/V1"><version>eshHeader25</version><ppSoapHeader25>&lt;s:ppSoapHeader xmlns:s="http://schemas.microsoft.com/Passport/SoapServices/SoapHeader" version="1.0"&gt;&lt;s:lcid&gt;1033&lt;/s:lcid&gt;&lt;s:sitetoken&gt;&lt;t:siteheader xmlns:t="http://schemas.microsoft.com/Passport/SiteToken" id="275434" /&gt;&lt;/s:sitetoken&gt;&lt;/s:ppSoapHeader&gt;</ppSoapHeader25></WSSecurityHeader></soap:Header><soap:Body><GetSLT xmlns="http://schemas.microsoft.com/Passport/SoapServices/CredentialServiceAPI/V1"><PassIDIn><pit>PASSID_SIGNINNAME</pit><bstrID>admin@mylincoln.edu</bstrID></PassIDIn><LoginSeconds>5</LoginSeconds></GetSLT></soap:Body></soap:Envelope>
Method failed: HTTP/1.1 500 Internal Server Error
Exception in thread "main" junit.framework.AssertionFailedError
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.assertTrue(Assert.java:20)
    at junit.framework.Assert.assertTrue(Assert.java:27)
    at com.microsoft.windowslive.sso.PlainLiveSSOSampleTest.testShortLivedTokenFetch(PlainLiveSSOSampleTest.java:65)
    at com.microsoft.windowslive.sso.PlainLiveSSOSampleTest.main(PlainLiveSSOSampleTest.java:109)
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><SOAP:Fault><faultcode>SOAP:Server</faultcode><faultstring>SOAP Server Application Faulted</faultstring><detail><psf:error xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault"><psf:value>0x80048101</psf:value><psf:description><psf:lcid>1033</psf:lcid><psf:text>The header in the soap request is invalid
</psf:text></psf:description><psf:internalerror><psf:code>0x80044024</psf:code><psf:text>The client certificate is invalid. The calling site cannot be authenticated.
</psf:text></psf:internalerror><psf:serverInfo>BAYIDSPRTI1D12 2010.10.12.12.58.02</psf:serverInfo></psf:error></detail></SOAP:Fault></SOAP:Body></SOAP:Envelope>

 -- - - -  - - - - - -- -  - - - - - - - - - - - - - - - - - - -- - - - - - - -  -- - Excption end- - - - - - - - - -- - - - - - - - - -  - -- - -  -- - - - - - - - - - - - - -- - - - - - - ----- - - - - -- -

it seem to be there is some problem in authentication "The client certificate is invalid. The calling site cannot be authenticated."

while i fully install the certificate which i receive from Windows Live and use cacerts-win32.jks which come alog the project.

please kindly can u tell me whats going wrong with my code

 

Oct 27, 2010 at 11:26 AM
Edited Oct 27, 2010 at 1:29 PM

after little bit searching i configure it properly and getting the GetSLTResponse..

  well really thank for the code  ...

Jan 14, 2011 at 2:11 PM

Hi, Noman.

I got exactly the same error in the test "The client certificate is invalid. The calling site cannot be authenticated."

How did you resolve that issue? What was the changes you've made?

Thanks.

Jan 14, 2011 at 2:21 PM

    String response = "";
        // Create and register the SSL Protocol Factory.
        Protocol sslProtocol = new Protocol("https",
                EmailConfiguration.SSL_PROTOCOL_FACTORY, 443);
        Protocol.registerProtocol("https", sslProtocol);

        // Create an instance of HttpClient.
        HttpClient client = new HttpClient();
        client.getHostConfiguration().setHost(
                EmailConfiguration.PASSPORT_SERVICE_HOST, 443, sslProtocol);
        client.getHostConfiguration().setProxy("192.168.100.16", 8080);

 

use this for the communication if you are behind the firewall in class

public class LiveSSOService {
   public String testShortLivedTokenFetch() throws Exception {

..................................

 

 

hope it  solve your issue

TC

 

 

 

Jan 14, 2011 at 2:48 PM

Hi, Noman.

 

Thanks for fast reply.

Actually, I've resolved my issue - problem was that I used original PFX file for creation of keystore.

When I did importing to Windows Certification store and then exported it back to PFX with all certificates in chain - I got SLT response from server.