Exchange服务器无法正确处理带中文内容的EWS soap请求(EWS soap request with Chinese content cannot be handled correctly

编程入门 行业动态 更新时间:2024-10-26 19:38:13
Exchange服务器无法正确处理带中文内容的EWS soap请求(EWS soap request with Chinese content cannot be handled correctly by Exchange server)

所有:

我想使用EWS发送创建日历项操作请求,并且我的一些内容(例如Subject)可能会包含中文字符。 这是我的请求肥皂的样子

<?xml version="1.0" encoding="utf-8"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> <RequestServerVersion xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2007_SP1"/> </Header> <Body> <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" SendMeetingInvitations="SendToNone"> <SavedItemFolderId> <DistinguishedFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Id="calendar"/> </SavedItemFolderId> <Items> <CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types"> <Subject>新建日程</Subject> <ReminderIsSet>true</ReminderIsSet> <ReminderMinutesBeforeStart>15</ReminderMinutesBeforeStart> <Start>2016-06-22T09:00:00</Start> <End>2016-06-22T10:00:00</End> </CalendarItem> </Items> </CreateItem> </Body> </Envelope>

我用utf-8编码这个xml,并将它发送到我的测试交换服务器,过了一段时间后,它显示在该服务器上,但在主题属性中使用问号而不是“新建日程”。 所有其他属性都正确显示。

所以我想知道我错在哪里,中文内容无法正确显示。 有什么建议么?

all:

I want to send creating calendar item operation request using EWS, and some of my content, for instance, Subject, may content Chinese characters. Here is what my request soap looks like

<?xml version="1.0" encoding="utf-8"?> <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header> <RequestServerVersion xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2007_SP1"/> </Header> <Body> <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" SendMeetingInvitations="SendToNone"> <SavedItemFolderId> <DistinguishedFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Id="calendar"/> </SavedItemFolderId> <Items> <CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types"> <Subject>新建日程</Subject> <ReminderIsSet>true</ReminderIsSet> <ReminderMinutesBeforeStart>15</ReminderMinutesBeforeStart> <Start>2016-06-22T09:00:00</Start> <End>2016-06-22T10:00:00</End> </CalendarItem> </Items> </CreateItem> </Body> </Envelope>

I encode this xml with utf-8 and send it to my testing exchange server, and after a while, it displayed on that server, but with question mark in Subject property instead of '新建日程'. All other properties are displayed correctly.

So I wonder where I did wrong that the Chinese content can not be displayed correctly. Any suggestions?

最满意答案

最后,我找出了什么是错的。 它在请求标题中。 我发现头文件忘记将charset设置为utf-8。 多么简单但愚蠢的错误.....

Finally, I figure out what's wrong. It's in the request header. I found that the header forgot to set charset as utf-8. What a simple but stupid mistake.....

更多推荐

本文发布于:2023-08-07 23:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466453.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中文   正确处理   服务器   内容   EWS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!