0

当我尝试在 webservices (C# - WSDL) 中调用 poInfoInquiry 方法时,我在反序列化操作“poInfoInquiry”的回复消息正文时遇到错误。我将日期作为 DateTime 类型传递。

我发现的例外情况如下:

System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'poInfoInquiry'. --->
System.InvalidOperationException: There is an error in XML document (12, 13). --->
System.FormatException: The string '' is not a valid AllXsd value. at System.Xml.Schema.XsdDateTime..ctor(String text, XsdDateTimeFlags kinds) at 
System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode dateTimeOption) at
System.Xml.Serialization.XmlCustomFormatter.ToDateTime(String value) at
System.Xml.Serialization.XmlSerializationReader.ToDateTime(String value) at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIFH2HRemittanceIn.Read9_PaymentDetail(Boolean isNullable, Boolean checkType) at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIFH2HRemittanceIn.Read10_PaymentInfo(Boolean isNullable, Boolean checkType) at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIFH2HRemittanceIn.Read11_poInfoInquiryResponse(Boolean isNullable, Boolean checkType) at 
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIFH2HRemittanceIn.Read18_Item() at 
Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer2.Deserialize(XmlSerializationReader reader) at 
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception
4

1 回答 1

1

尝试到这里 你的日期有问题 = DateTime

http://www.infopathdev.com/blogs/hilary/archive/2010/08/27/looks-can-be-deceiving-dates-date-times-and-quot-t-quot.aspx

于 2013-04-04T04:40:15.973 回答