Last post Mar 16, 2015 02:30 AM by vahid bakkhi
Mar 13, 2015 07:13 PM|esr124|LINK
I'm having an issue when calling a 3rd party web service. Everything is setup and I am able to connect to the web service and a response is being generated. The problem seems to occur with properties of type DateTime. I know most of the DateTime fields
are empty. But the resulting class that is provided has all of the date/time properties as DateTime? not DateTime.
The same web service call was tested using SoapUI and worked fine.
Has anyone else encountered something similar to this? Any help would be appreciated. Thanks.
Below is a screenshot of the exception from Visual Studio:
Mar 16, 2015 02:01 AM|Shawn - MSFT|LINK
For this scenario, about the error message, “when converting a string to datetime parse the string to take the date before putting each variable into the datetime object”, you could refer to:
Mar 16, 2015 02:30 AM|vahid bakkhi|LINK
please try below code :
var dt = DateTime.ParseExact(time, "yyMMddHHmm", CultureInfo.InvariantCulture);