Search This Blog

August 28, 2014

Fixed the issue in SQL Server 2008- Conversion failed when converting date and/or time from character string.

Today when I executed one SQL query, sometimes it worked, but sometimes it didn’t. It showed the following error:

Conversion failed when converting date and/or time from character string.

After looking into this interesting issue, I found the SQL query used


In SQL Server 2008, it is better to use CAST and Datetime2 Type. After using the following way, the error disappeared.

CAST(FieldDateName as Datetime2)

August 27, 2014

WCF: Skip Take Sort in SQL Server 2008

In WCF method, we have an interesting feature called Skip Take Sort.

If we input one member ID, skip=30, take= 40, sort by one Field name and then consume the WCF , the data for that member returned will skip first 30 rows and take the next 40 rows after a sort. 

How can I do it in SQL query? Here is the simple example : Skip 1 and Take 3 after a sort.. It is working perfectly.

August 23, 2014

Fixed the issue: iTunes could not back up iPhone because the backup was corrupt or not compatible with the iPhone

This morning my wife spoke to me that our 2 iPhones are quailed for “iPhone 5 Battery Replacement Program” and told me to back up my iPhone 5 into my laptop via iTunes.

Therefore, I connected my iPhone 5 to Windows 7 laptop, opened iTunes and clicked “Back up now “ button. But  I got the following error message.

iTunes could not back up iPhone because the backup was corrupt or not compatible with the iPhone.

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

Close iTunes , disconnect and reconnect iPhone 5 to laptop

Delete the files below the Backup folder

C:\Users\ray\AppData\Roaming\Apple Computer\MobileSync\Backup

Copy the files of video and photos from iPhone 5 to D drive 

Delete all video and photos

Open iTunes , do the backup again and you are all set.

August 19, 2014

WCF Test: Fixed the issue of Zulu Time in Parasoft SOAtest

 If I declare DATE and DATETIME variables, they will display the following date format in SQL Server.  


MyLowDt: 2004-02-11
MyHighDt: 2004-02-11 00:00:00.000

In SOAtest, if I get (MyLowDt) DATE variable from SQL query and use it in WCF method, the interesting part is that SOAtest uses Zulu time as an input and never returns the rows I want to see.

MyLowDt: 2004-02-11T08:00:00.000Z  (Zulu Time)

If I get (MyHighDt) DATETIME variable from SQL query and use it in WCF method, SOAtest uses Timestamp with T as an input and can return the rows I want to see.

MyHighDt: 2014-02-11T00:00:00.0

In SQL Server, If I use Zulu time to query the data, I can still get the data back.

Open WCF test Client , input Zulu time and I can get the data back.

But in SOAtest, input Zulu time and I can’t get the data back.

Parasoft  SOAtest, you should make testing life easier. 

August 18, 2014

WCF Test Date Range: Parasoft SOAtest doesn’t return the correct rows in Response Element

Today I found out an interesting issue in Parasoft SOAtest.

Scenario:  Input 2 date fields and one parameter to see if the rows returned from WCF method are correct.

Here is the basic SQL query to get the data where the condition is using 2 different dates. It returns 9 rows and also includes the MinDate.

Field1_name >=’MinDate’ and Field2_name <=’MaxDate’

Open WCF test client, do the same Scenario ,  invoke the WCF method and I get the same result: 9 rows.

What happens to Parasoft SOAtest 9.7?  In SOAtest, double click Traffic View-Traffic Viewer-> Click Request: I see 3 input parameters.

Click Response - >Click Element: I only see 7 rows which do not include the MinDate.

I have the confidence to say my configuration is correct in SOAtest. 

After modifying the following SQL query, all tests in SOAtests pass.

Field1_name >’MinDate’ and Field2_name <=’MaxDate’

Parasoft SOAtest : Fixed the error message- the maximum message size quota for incoming messages (65536) has been exceeded.

Our team is using Parasoft SOAtest to test WCF method. After executing all tests, the following error appears.

Message: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

In C# , I know it is easy to adjust MaxReceivedMessageSize in app.config and the issue will be going away.

But in Parasoft SOAtest, how to fix this issue? 

If we change the Default to Custom and uncheck Constrain request to WSDL, the issue is going away.

August 17, 2014

Lessons Learned in Parasoft SOAtest

I have used C# to do the test automation for many years. Currently I am working on the new project. The interest part is that the team uses Parasoft SOAtest to develop automation to test WCF methods. Here are some lessons I learned:

SQL query:

If we put SQL query in txt file, please don’t put any comment (- -) .  At the end of every line, please add more space. Otherwise, SQL query will not work.

Check out:

SOAtest doesn’t integrate with TFS very well. It has the merge issue. Only 1 person can check out one tst file. If 2 persons are working on the same tst file, once A checks in, B will lose his work. Therefore, one tst file is only for one WCF method.

Refresh Issue

If I duplicate set-up test and modify the data source column name in ‘Extraction”, sometimes this column doesn’t appear immediately in SOAP Client. Clicking “refresh” is not working either. I need to close SOATest and reopen it.

Global Variables:

Put the values in the Test Suite instead of putting them in local test scenario. If you put the values in test scenario and when executing all the tests, some variables will get confused and some tests will fail.

When I use this tool to develop test automation, I see so many issues in this product. My colleagues said Parasoft SOAtest costs 1 million dollars and adding one user needs to pay the license fee. 

It is not worth 1 million dollars because Parasoft SOAtest is not the high-quality product after using it.