为操作'poinfoquery '反序列化回复消息正文时出错.- c# web服务

本文关键字:出错 web 服务 回复 poinfoquery 操作 反序列化 消息 正文 | 更新日期: 2023-09-27 18:07:23

当我尝试在web服务(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

为操作'poinfoquery '反序列化回复消息正文时出错.- c# web服务

试着去这里date = DateTime有问题

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