I'm sending SOAP requests to an external web service. There are several fields that make up the request and one of them is defined as a s:time type.
I would like to set this time field to a value but c# only accepts a datetime type and not just time.
...
soapClient soapService = new soapClient();
sendTime soapRequest = new sendTime();
soapRequest.TimeOfArrival = Convert.ToDateTime("09:00:00");
...
So I have to do the convert because the TimeOfArrival field is set to s:time and for some reason c# requires a s:time to be in the format datetime.
If I just do the following:
soapRequest.TimeOfArrival = "09:00:00";
I get the error 'Cannot implicitly convert type 'string' to 'System.DateTime'
So how can I set the field to just a time?