更新事件不适用于EWS访问被拒绝
问题描述:
我从使用EWS的应用程序创建会议。肥皂请求更新事件不适用于EWS访问被拒绝
{
"body":{
"m:CreateItem":{
"attributes":[
{
"SendMeetingInvitations":"SendToAllAndSaveCopy"
}
],
"m:Items":[
{
"t:CalendarItem":{
"t:Subject":"Booked from application",
"t:Body":{
"attributes":[
{
"BodyType":"Text"
}
],
"value":"Meeting body"
},
"t:Start":"2016-03-02T13:11:59+00:00",
"t:End":"2016-03-02T13:45:00+00:00",
"t:Location":"room1",
"t:RequiredAttendees":[
{
"t:Attendee":{
"t:Mailbox":{
"t:EmailAddress":"[email protected]"
}
}
}
]
}
}
]
}
},
"headers":{
"Authorization":"Basic somestringsdafsdfsdfsdfsdfsf"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:ExchangeImpersonation":{
"t:ConnectingSID":{
"t:PrincipalName":"[email protected]"
}
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
我也试图通过应用程序编辑会议持续时间,它也可以正常工作。使用SOAP请求:
{
"body":{
"m:UpdateItem":{
"attributes":[
{
"SendMeetingInvitationsOrCancellations":"SendToAllAndSaveCopy"
},
{
"MessageDisposition":"SaveOnly"
},
{
"ConflictResolution":"AlwaysOverwrite"
}
],
"m:ItemChanges":{
"t:ItemChange":{
"t:ItemId":{
"attributes":[
{
"Id":"AAApAHJvb20xQGNlcnR1c2ludGVybmF0aW9uYWwub25taWNyb3NvZnQuY29tAEYAAAAAAMWslF/s3JlHvuBz+Grw4nkHAMq37IYLqfhKh5oHo2fodacAAAAAAQ0AAMq37IYLqfhKh5oHo2fodacAAFweeHQAAA=="
},
{
"ChangeKey":"DwAAABYAAADKt+yGC6n4SoeaB6Nn6HWnAABcIvBS"
}
]
},
"t:Updates":{
"t:SetItemField":{
"t:FieldURI":{
"attributes":[
{
"FieldURI":"calendar:End"
}
]
},
"t:CalendarItem":{
"t:End":"2016-03-02T15:00:00+00:00"
}
}
}
}
}
}
},
"headers":{
"Authorization":"Basic somestringssdasasfasfasfasfaf"
},
"additionalNamespaces":[
"xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"",
"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\""
],
"soapHeader":{
"t:ExchangeImpersonation":{
"t:ConnectingSID":{
"t:PrincipalName":"[email protected]"
}
}
},
"method":"POST",
"url":"https://outlook.office365.com/EWS/Exchange.asmx"
}
问题出现时,我使用Exchange Web界面从outlook.office.com创建会议。我收到错误消息:
访问被拒绝。检查凭据并重试。无法从 的名称获取ID。
SOAP请求除了更改密钥外都是一样的。我已阅读过一些类似的问题,可能是由于日历上的权利。我对此并不十分清楚。
您能否就这个问题提出建议。
编辑:
{
"t:ExchangeImpersonation":{
"t:ConnectingSID":{
"t:PrimarySmtpAddress":"[email protected]"
}
}
}
答
它,也许你的模拟头是test007邮箱您试图访问或使用您刚才的服务帐户?
我建议你使用PrimarySMTPAddress,以确保您指定的邮箱访问而不是用户如
"t:ExchangeImpersonation":{
"t:ConnectingSID":{
"t:PrimarySmtpAddress":"[email protected]"
}
此外,当你说
在哪里的问题开始是,当我使用Exchange Web界面从outlook.office.com创建会议时。我得到消息错误
你的意思是你在Outlook Web App或在你的代码得到的错误?
干杯 格伦
的问题是在我的应用程序,试图更新通过Outlook中创建会议时。在我的应用程序中创建的会议可以更新为出错。谢谢。 – eomeroff
这听起来像你试图更新约会比你的代码不是所有者为什么使用PrimarySMTP是一个更好的主意,在共享邮箱的情况下,你可能需要看看约会的组织者,然后模拟具体的组织者。 –
请检查我的编辑。它报告与您建议的更改相同的错误。谢谢。 – eomeroff