调用Web服务的实例验证错误

时间:2011-02-18 21:51:49

标签: asp.net web-services

我在用于调用Web服务的代理类中遇到实例验证错误。此代理类由XSD2Code自动生成。对我来说,错误与它指向的代码不匹配。

异常详细信息:

  

System.InvalidOperationException:   实例验证错误:   'LessThanOrEqualTo'无效   ComparisonOperatorType的值。

来源错误:

Line 12866:    cswgetCapabilitiesResponse csw.cswgetCapabilities(cswgetCapabilitiesRequest request)
Line 12867:    {
Line 12868:        return base.Channel.cswgetCapabilities(request);
Line 12869:    }
Line 12870: 

源文件:

  

d:\ web应用\ App_Code文件\ ogc.csw.proxy.cs   行:12868

堆栈追踪:

[InvalidOperationException: Instance validation error: 'LessThanOrEqualTo' is not a valid value for ComparisonOperatorType.]
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read156_ComparisonOperatorType(String s) +582
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read157_ComparisonOperatorsType(Boolean isNullable, Boolean checkType) +742
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read162_Scalar_CapabilitiesType(Boolean isNullable, Boolean checkType) +746
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read165_Filter_Capabilities(Boolean isNullable, Boolean checkType) +746
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read166_CapabilitiesType(Boolean isNullable, Boolean checkType) +1430
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadercsw.Read280_Item() +281
   Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer11.Deserialize(XmlSerializationReader reader) +43
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +579

[InvalidOperationException: There is an error in XML document (284, 13).]
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +1375
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) +163
   System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest) +606

[CommunicationException: Error in deserializing body of reply message for operation 'cswgetCapabilities'.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4767763
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
   csw.cswgetCapabilities(cswgetCapabilitiesRequest request) +0
   cswClient.csw.cswgetCapabilities(cswgetCapabilitiesRequest request) in d:\webapp\App_Code\ogc.csw.proxy.cs:12868
   cswClient.cswgetCapabilities(GetCapabilitiesType1 GetCapabilities) in d:\webapp\App_Code\ogc.csw.proxy.cs:12875
   tests_csw.Unnamed1_Click(Object sender, EventArgs e) in d:\webapp\tests\csw.aspx.cs:22
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691

1 个答案:

答案 0 :(得分:1)

“LessThanOrEqualTo”是否有效?我想这条消息说它试图将“LessThanOrEqualTo”反序列化为ComparisonOperatorType元素(或属性)的值,但字符串“LessThanOrEqualTo”对元素的类型无效。