我使用 SoapUI 来模拟 WCF 服务。有一个对象。
CallBeginTime = {2/22/2013 8:22:54 AM}
Date: {2/22/2013 12:00:00 AM}
Day: 22
DayOfWeek: Friday
DayOfYear: 53
Hour: 8
Kind: Unspecified
Millisecond: 0
Minute: 22
Month: 2
Second: 54
Ticks: 634971181740000000
TimeOfDay: {08:22:54}
Year: 2013
我通过它作为
<nsb:CallBeginTime>{2/22/2013 8:22:54 AM}</nsb:CallBeginTime>
我有一个例外
<InnerException>
<HelpLink i:nil="true"/>
<InnerException i:nil="true"/>
<Message>The string '{2/22/2013 8:22:54 AM}' is not a valid AllXsd value.</Message>
<StackTrace>at System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode dateTimeOption)
at System.Xml.XmlConverter.ToDateTime(String value)</StackTrace>
<Type>System.FormatException</Type>
</InnerException>
谢谢你的建议。