Exchange 2007 Webservice GetItem错误 [英] Exchange 2007 webservice GetItem error

查看:53
本文介绍了Exchange 2007 Webservice GetItem错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个月以来运行的Exchange Server 2007并且从来没有遇到过问题,但是我来到这个mornnig我得到了这个错误。我有一个用户订阅,可以收到新邮件的通知。之后,我有一个系统可以在一定的时间间隔内收到消息。



因为我们正在测试我有开发一个小应用程序,每分钟发送一个邮件来测试系统负载,这是一周以来运行,从来没有遇到过问题。我没有更新,没有任何变化,但现在我无法使用网络服务......



这很奇怪,有人得到了这个错误或者有什么可能导致这个错误的线索。我还把代码放在电子邮件底部的项目中。



非常感谢。



未处理的异常:System.InvalidOperationException:XML
文档中存在错误(23,-517) )。 ---> System.Xml.XmlException:'→',十六进制值0x1A,
是无效字符。第23行,位置-517。
System.Xml.XmlTextReaderImpl.Throw(Exception e)
System.Xml.XmlTextReaderImpl.Throw(String res,String [] args)
在System.Xml。 System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(Int32 startPos,Boo
lean expand,BufferBuilder internalSubsetBuilder,Int32& charCount,EntityType&
entityType)中的XmlTextReaderImpl.ThrowInvalidChar(Int32 pos,Char invChar)
System.Xml.XmlTextReaderImpl.ParseCharRefInline(Int32 startPos,Int32& cha
rCount,EntityType& entityType)

System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos,Int32& endPos,Int
32& outOrChars )
System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader。在Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializa的System.Xml.XmlReader.ReadStartElement()
中读取()
tionReaderExchan
geServiceBinding.Read78_BodyType(Boolean isNullable,Boolean checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read155_MessageType(Boolean isNullable,Boolean checkType)
at Microsoft.Xml.Serialization。 GeneratedAssembly.XmlSerializationReaderExchan





















br> at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read273_ArrayOfResponseMessagesType(Boolean isNullable,Boolean
checkType)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read293_GetItemResponseType(Boolean isNullable ,布尔检查



Micro在System.Xml.Serialization上的Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer65.De
serialize(XmlSerializationReader reader)中的soft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read355_GetItemResponse()
。 XmlSerializer.Deserialize(XmlReader xmlReader,St
ring encodingStyle,XmlDeserializationEvents事件)
---内部异常堆栈跟踪结束---
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,St
ring encodingStyle,XmlDeserializationEvents events)

System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader,St
ring encodingStyle)

System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie)
ntMessage消息,WebResponse响应,Stream responseStream,Boolean asyncCal
l)

System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame,Object []参数)
在MailAgen t.Exchange.ExchangeServer.ExchangeServiceBinding.GetItem(GetItemTy














位于C:\ Projets \ MailAge中的MailAgent.Exchange.ExchServer.GetItem(String itemId)
nt \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


这是代码:





代码块

解决方案

有趣。看起来返回的正文类型枚举值中的某些内容会导致xml序列化程序在您的客户端上死亡。有趣的是,嗅探网络流量以查看返回的消息是什么样的,尤其是Body元素上的BodyType属性值。



另一个选择是只请求IdOnly的基本形状,因为您已经获得了消息的MimeContent。或者,您可以尝试在GetItem请求的响应形状中明确请求HTML或Text BodyType。


Hello,

 

I have Exchange Server 2007 running since a month and never got a problem, but wHen I came in this mornnig I get this error. I have a user subscription that receive notification for new mails. After that I have a system that get the message on a certain interval.

 

because we are in test I have developp a little app that send a mail every minute to test the system load, this is running since a week and never got a problem. I've done no update, nothing has change, but now I can't use the webservice...

 

This is strange, did someone got this error or has a clue on what could cause that. I've also put the code to get the item at the bottom of the email.

 

thanks a lot.

 

Unhandled Exception: System.InvalidOperationException: There is an error in XML
document (23, -517). ---> System.Xml.XmlException: '→', hexadecimal value 0x1A,
is an invalid character. Line 23, position -517.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)
   at System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(Int32 startPos, Boo
lean expand, BufferBuilder internalSubsetBuilder, Int32& charCount, EntityType&
entityType)
   at System.Xml.XmlTextReaderImpl.ParseCharRefInline(Int32 startPos, Int32& cha
rCount, EntityType& entityType)
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int
32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.ReadStartElement()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read78_BodyType(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read155_MessageType(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read259_ArrayOfRealItemsType(Boolean isNullable, Boolean checkT
ype)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read270_ItemInfoResponseMessageType(Boolean isNullable, Boolean
 checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read273_ArrayOfResponseMessagesType(Boolean isNullable, Boolean
 checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read293_GetItemResponseType(Boolean isNullable, Boolean checkTy
pe)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderExchan
geServiceBinding.Read355_GetItemResponse()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer65.De
serialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, St
ring encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, St
ring encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, St
ring encodingStyle)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie
ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCal
l)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame, Object[] parameters)
   at MailAgent.Exchange.ExchangeServer.ExchangeServiceBinding.GetItem(GetItemTy
pe GetItem1) in C:\Projets\MailAgent.Exchange\Web References\ExchangeServer\Refe
rence.cs:line 833
   at MailAgent.Exchange.ExchServer.GetItem(String itemId) in C:\Projets\MailAge
nt\trunk\src\Exchange\ExchServer.cs:line 246


Here's the code :

Code Block

解决方案

Interesting.  Looks like something in the returned body type enumeration value is causing the xml serializer to die on your client.  It would be interesting to sniff the network traffic to see what the returned message looks like, especially the BodyType attribute value on the Body element.

 

Another option is to just request a base shape of IdOnly since you are already getting the MimeContent of the message.  Or, you could try explicitly requesting the HTML or Text BodyType in the response shape of your GetItem request.


这篇关于Exchange 2007 Webservice GetItem错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆