Search This Blog

November 26, 2014

Fixed the X.509 Certificate issue in WCF Test Client -The client certificate is not provided. Specify a client certificate in ClientCredentials

In our current project, we implemented X.509 Certificates. In order to test WCF methods, we needed to install X.509 certificates in our laptop. But when using SOAtest to run the tests or using WCF test client to invoke all methods, the following error message appeared:

The client certificate is not provided. Specify a client certificate in ClientCredentials.

How do we fix this issue in WCF Test Client? I assume you have the console app with the X.509 Cert configuration in app.config and the unit tests are working. 

Here are the steps to configure the WCF test client.

  1. Open WCF Test Client.
  2. Go to C:\Users\ray\AppData\Local\Temp\Test Client Projects\12.0.
  3. Open Client.dll.config.
  4. Copy all the contents of app.config into Client.dll.config and click save.
  5. WCF test client will be refreshed and make sure you don’t see any error in Client.dll.config (Modify Contract name if required).
  6. All WCF methods appear.
Input the parameters to invoke one WCF method and it is working without any certificate issue.

Fixed the vsmdi issue : Root element is missing in Visual Studio 2013

Today I used my .vsmdi in Visual Studio 2013 to run unit tests, and I got the following error.

Error loading C:\TestProject\Test\Test.vsmdi: Root element is missing.

After looking into this issue, for some reason, it was empty in the .vsmdi file.

After adding the following elements in vsmdi and running the tests again, the error was going away.

November 24, 2014

Fixed the WCF issue: When the third digit of Milliseconds is 0, it doesn’t appear In WCF response format

Today one test failed in SOAtest. After looking into this interesting issue, we noticed that it was related to Milliseconds with 2 or 3 digits in WCF response format.



In DB, when using the SQL query of RTRIM(CONVERT(char(25),FieldName,127)), I could see Milliseconds with 3 digits all the time:



It means in WCF response format, when the third digit is 0, it is ignored and does not appear. It makes our verification test failed.

The quick workaround to fix this issue is to use Case When in SQL query.

After adding this condition in SQL query, all tests in SOAtest pass without any issue.

(CASE WHEN (CONVERT(char(25),FieldName,127) LIKE '%0')  
      THEN RTRIM(CONVERT(char(22), FieldName,127))
      ELSE RTRIM(CONVERT(char(25), FieldName,127))
 ENDAS RequestDate

November 3, 2014

Fixed the battery issue: 0% available (plugged in, not charging)

Last night I noticed that my personal laptop had the battery issue. It showed 0% available (plugged in, not charging). When it was plugged out, it shut down immediately.

After looking into this interesting issue, here are my ways to fix it.

Go to Device Manager-> Uninstall Microsoft ACPI-Compliant Control Method Battery.

Shut down the laptop. Take out the battery about 10-20 seconds. Put the battery back.

Turn on the laptop, go to Device Manager and in Action tab, click Scan for hardware changes and you are all set.