当我尝试在 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