尝试使用 EWS CreateItem 操作转发电子邮件时出现架构验证错误
Schema validation error when trying to forward email using EWS CreateItem operation
当我尝试使用 EWS 创建操作转发电子邮件时出现以下错误。
The request failed schema validation: The element 'ForwardItem' in
namespace 'http://schemas.microsoft.com/exchange/services/2006/types'
has invalid child element 'Subject' in namespace
'http://schemas.microsoft.com/exchange/services/2006/types'. List of
possible elements expected: 'CcRecipients, BccRecipients,
IsReadReceiptRequested, IsDeliveryReceiptRequested, From,
ReferenceItemId, NewBodyContent' in namespace
'http://schemas.microsoft.com/exchange/services/2006/types'
根据此 link 'Subject' 是 'ForwardItem' 下的有效元素。我正在使用 Exchange2013。对我做错了什么有什么想法吗?同样的请求适用于 O365。
SOAP 请求
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<m:CreateItem MessageDisposition="SendAndSaveCopy">
<m:Items>
<t:ForwardItem>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>admin@test.onmicrosoft.com</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
<t:Subject>Email Submitted</t:Subject>
<t:ReferenceItemId Id="AQMkADJmMTI3Njk1LWZjOWItNDM2Os.."
ChangeKey="CQAAABYAAAAmV1x/D6z5Q7lUEv1+KENlAAAAAACV"/>
<t:NewBodyContent BodyType="Text"></t:NewBodyContent>
</t:ForwardItem>
</m:Items>
</m:CreateItem>
</soap:Body>
</soap:Envelope>
ForwardItem
要求元素按照它们在模式中定义的顺序排列 -
ForwardItem
尝试将 Subject
移到 ToRecipients
上方:
<t:ForwardItem>
<t:Subject>Email Submitted</t:Subject>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>admin@test.onmicrosoft.com</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
<t:ReferenceItemId Id="AQMkADJmMTI3Njk1LWZjOWItNDM2Os.."
ChangeKey="CQAAABYAAAAmV1x/D6z5Q7lUEv1+KENlAAAAAACV"/>
<t:NewBodyContent BodyType="Text"></t:NewBodyContent>
当我尝试使用 EWS 创建操作转发电子邮件时出现以下错误。
The request failed schema validation: The element 'ForwardItem' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types' has invalid child element 'Subject' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types'. List of possible elements expected: 'CcRecipients, BccRecipients, IsReadReceiptRequested, IsDeliveryReceiptRequested, From, ReferenceItemId, NewBodyContent' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types'
根据此 link 'Subject' 是 'ForwardItem' 下的有效元素。我正在使用 Exchange2013。对我做错了什么有什么想法吗?同样的请求适用于 O365。
SOAP 请求
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<m:CreateItem MessageDisposition="SendAndSaveCopy">
<m:Items>
<t:ForwardItem>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>admin@test.onmicrosoft.com</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
<t:Subject>Email Submitted</t:Subject>
<t:ReferenceItemId Id="AQMkADJmMTI3Njk1LWZjOWItNDM2Os.."
ChangeKey="CQAAABYAAAAmV1x/D6z5Q7lUEv1+KENlAAAAAACV"/>
<t:NewBodyContent BodyType="Text"></t:NewBodyContent>
</t:ForwardItem>
</m:Items>
</m:CreateItem>
</soap:Body>
</soap:Envelope>
ForwardItem
要求元素按照它们在模式中定义的顺序排列 -
ForwardItem
尝试将 Subject
移到 ToRecipients
上方:
<t:ForwardItem>
<t:Subject>Email Submitted</t:Subject>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>admin@test.onmicrosoft.com</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
<t:ReferenceItemId Id="AQMkADJmMTI3Njk1LWZjOWItNDM2Os.."
ChangeKey="CQAAABYAAAAmV1x/D6z5Q7lUEv1+KENlAAAAAACV"/>
<t:NewBodyContent BodyType="Text"></t:NewBodyContent>