Looking to implement in following into Mulesoft HTTP request
curl "https://somedomain.com/1/1/1/search"
-X POST
-H "Authorization: Bearer token"
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<flow name="MyRequestFlow" doc:id="04948f48-2508-4f1c-83fe-ea899886a61c" >
<http:request method="POST" doc:name="Request" doc:id="bd921beb-2142-4c24-be1d-c174e994c982" url="https://somedomain.com/1/1/1/search">
<http:headers ><![CDATA[#[output application/java
---
{
"Authorization" : "Bearer token"
}]]]></http:headers>
</http:request>
</flow>
</mule>
Related
Looks like there is hardly any activity on EWS here but maybe...
I am in the process of supporting Oauth in my EWS app but i'm stuck on getting events from a pullsubscription.
There's no issue for mailbox folders, only public folders.
The only change in the code is that the exchange service now has Oauthcredentials and impersonates an email address that has owner permissions on the public folder .
When using basic authentication the exchange service credentials are that of a "service account" email address and it does not use impersonation to get a pullsubscribtion on the public folder.
I'm not getting errors when setting the pullsubscription, and I can check that it has an ID, so it is there. However when I issue the getevents method (after adding some items to the folder) nothing fires.
this is the trace of the getevents (i made sure there were events in the folder)
26-8-2022 17:56:31 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-08-26 15:56:31Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent:
ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#domainname.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#domainname.onmicrosoft.com
X-PreferServerAffinity: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tNDJjYy04ODU2LTE3YWUzYjBiMmY0MiIsInV0aSI6Ik5oY3hiMHIxeUVpbGlIR2hWRFU0QUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdfQ.GeDfpt7ABAp5WpL9su265dV9UvilX6lxt5eCj7FWrBqGLhSNOL6fRfGGH-98nOKbqONmpEiXe0M61cOagKnrlNoyNgnvsC6bE1v6Nt_Uk44MPHfAs4MW1GDn9RtGbL9EEIDTZFg4qwrfRToOkyliFIcsfpXnXKmBiVSN0XFXtyHdvJpCjrb7Jj4o-qzGKKF1BREAVHrpIHBMz1r8u3UVihMQBEnI8X-a_qOF7MmgeyKBCLabZ5oFXOVsVPCI9re89W0q9jx04d0gnBLSAsjSHh94aG0P7ffpjupu3GSpZAm6Y9AkWv629EDO_C1wOshdI8--F9yyqhJ44Oh90Ha9xw
</Trace>
26-8-2022 17:56:31 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-08-26 15:56:31Z" Version="15.00.0913.015">
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>account#domainname.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetEvents>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAS114Ai9w+UayiTSZLtc6DY6SxEJ7h9oIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHaecAgsrAAAAAAA=</m:Watermark>
</m:GetEvents>
</soap:Body>
</soap:Envelope>
</Trace>
26-8-2022 17:56:31 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-08-26 15:56:31Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
request-id: de8811fe-8069-c2ff-15a7-5ac62e39d3f5
Alt-Svc: h3=":443",h3-29=":443"
X-CalculatedFETarget: AM6PR01CU002.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: GetEvents
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM0PR02CA0136.EURPRD02.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AM6PR01CA0042,AM0PR02CA0136
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Fri, 26 Aug 2022 15:56:28 GMT
Set-Cookie: exchangecookie=52d38d4eb5c14276b165655c6cd18691; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
26-8-2022 17:56:31 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-08-26 15:56:31Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5588" MinorBuildNumber="3" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</s:Header>
<s:Body>
<m:GetEventsResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetEventsResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Notification>
<t:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAS114Ai9w+UayiTSZLtc6DY6SxEJ7h9oIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</t:SubscriptionId>
<t:PreviousWatermark>AQAAABTg+YC4KZFNttW01ElEHaecAgsrAAAAAAA=</t:PreviousWatermark>
<t:MoreEvents>false</t:MoreEvents>
<t:StatusEvent>
<t:Watermark>AQAAABTg+YC4KZFNttW01ElEHaf4BQsrAAAAAAE=</t:Watermark>
</t:StatusEvent>
</m:Notification>
</m:GetEventsResponseMessage>
</m:ResponseMessages>
</m:GetEventsResponse>
</s:Body>
</s:Envelope>
</Trace>
What could be the issue? Any suggestions are much appreciated!
Are there more the one Public Mailbox Folder doing the hosting, from what you describing it sounds like you create the subscription on the mailbox/cas that is hosting the hierarchy but the content is hosted on another public folder mailbox. A few thing to be aware of are
With Push and Pull notification they are hosted on a particular CAS server https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/getevents-operation
The SubscriptionID of the request is confirmed to be a valid subscription that is hosted on the Client Access server. If it is not, the GetEvents call fails.
So the first thing that might be happening is that routing of the request if failing. One thing you might want to do is compare the headers
X-CalculatedFETarget: AM6PR01CU002.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget:
From when you using Basic and it working to when you using the oAuth
The SMTP address of the authenticated user for the request is compared to the SMTP address of the user who created the subscription. If they do not match, the GetEvents request fails.
This is the other reason I could see it failing when using the client credentials flow. Impersonation from a Service Principal vs a User Principal maybe happening different on the back-end (could be bug). Probably the way to confirm that is test it using a Delegate that has a Mailbox and EWS Impersonation rights and use ROPC (or ever auth code flow) and see if the same thing happens.
These later thing should give different errors however.
Thanks for your help Glen.
I have one public folder mailbox with one public folder in it. (It's on office365 ofcourse.)
I am including the full trace of subscription and response at the bottom.
The subscription ID is the same in both the subscription as the getevents.
I am not getting an error that the subscription was not found. So I would think that the problem is not routing?
The headers are these for resp subscribing and polling:
CalculatedFETarget: AM6P193CU004.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
CalculatedFETarget: AS8PR04CU007.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
The CalculatedFETarget is different. Is this the hiarchy? Do you think this could be an issue?
This "Probably the way to confirm that is test it using a Delegate that has a Mailbox and EWS Impersonation rights and use ROPC (or ever auth code flow) and see if the same thing happens." is over my head.
In the current code, the account that is impersonated by the oAuth authenticated ExchangeService has application impersonation permissions and is listed as owner of the public folder.
I would like to emphasize that everything works fine for mailbox folders. In that case the owner/email address of the mailbox is impersonated by the oAuth authenticated ExchangeService.
"Impersonation from a Service Principal vs a User Principal maybe happening different on the back-end (could be bug)."
It could indeed be a bug. Do you know how a single person like me can still get access to Microsoft for this. One used to be able to raise a (paid) incident but now you need a prem. support contract to reach them.
========== subscription ==========
1-9-2022 12:57:13 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-09-01 10:57:13Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PreferServerAffinity: true
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UtNDJjYy04ODU2LTE3YWUzYjBiMmY0MiIsInV0aSI6InZtR2ZDS0ZSWTBPS2R2OTVaU0Z1QUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjA5OTdhMWQwLTBkMWQtNGFjYi1iNDA4LWQ1Y2E3MzEyMWU5MCJdfQ.IlPfIOgl6H7Kenn999w6GPrHjPKyT_T_JLxSQc2w1Pjs8W_W4_brehe_wVX8YdqQPLEOo4fYX9l3gHHZeXtuOkgir1hM9w6TomM_FP6vBTeuGjVe7xLL0fSPvAd63pwvQicCj7SbX-RQBpvKeAapf5zA70UOYfo_NKic_ErJSWoYkSvDDX67LipjQrZ68X8XQQe3z_U7PfbwKABY91twQftzI4WXbQoRcEv8AgCQ9dxhFTIJgdzeV6slf-vnPHQ2Ic2bSnHpIJRGW-TV3o7zb6eRkTib1xs6SDBd3PIWAZoEz-uQbJ1MXwUEETfcDLNGkGYk25WqgI0tIGbqQoG_oQ
</Trace>
1-9-2022 12:57:13 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-09-01 10:57:13Z" Version="15.00.0913.015">
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>UserAccount#Domain.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:Subscribe>
<m:PullSubscriptionRequest>
<t:FolderIds>
<t:FolderId Id="AQEuAAADTfhLNwPj+06PL1ijINAF1AEACMU9HL7QIUqU8ZZs9tXeAQAAAxYAAAA=" />
</t:FolderIds>
<t:EventTypes>
<t:EventType>CreatedEvent</t:EventType>
<t:EventType>CopiedEvent</t:EventType>
<t:EventType>DeletedEvent</t:EventType>
<t:EventType>ModifiedEvent</t:EventType>
<t:EventType>MovedEvent</t:EventType>
</t:EventTypes>
<t:Timeout>90</t:Timeout>
</m:PullSubscriptionRequest>
</m:Subscribe>
</soap:Body>
</soap:Envelope>
</Trace>
1-9-2022 12:57:13 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-09-01 10:57:13Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
request-id: 020ba111-367c-5403-10d0-edb4d8408dc5
X-CalculatedFETarget: AM6P193CU004.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: Subscribe
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM3PR05CA0132.EURPRD05.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AM6P193CA0116,AM3PR05CA0132
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Thu, 01 Sep 2022 10:57:10 GMT
Set-Cookie: exchangecookie=fae0cd80fcd944e9b2e3ac0e021b8dc8; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
1-9-2022 12:57:13 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-09-01 10:57:13Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5612" MinorBuildNumber="5" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</s:Header>
<s:Body>
<m:SubscribeResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:SubscribeResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</m:Watermark>
</m:SubscribeResponseMessage>
</m:ResponseMessages>
</m:SubscribeResponse>
</s:Body>
</s:Envelope>
</Trace>
============= get events ==============
1-9-2022 13:00:23 : EwsRequestHttpHeaders --- <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2022-09-01 11:00:23Z">
POST /EWS/Exchange.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Accept: text/xml
User-Agent: ExchangeServicesClient/15.00.0913.015
Accept-Encoding: gzip,deflate
X-AnchorMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PublicFolderMailbox: publicfolderstore_bac380fe#MyDomain.onmicrosoft.com
X-PreferServerAffinity: True
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI6InA5eWx3dnE4RW9zQzJMdjNCeklmYzZxTlh1bjVmQzl3QXAyWENGbG1QOVkiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJa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l6H7Kenn999w6GPrHjPKyT_T_JLxSQc2w1Pjs8W_W4_brehe_wVX8YdqQPLEOo4fYX9l3gHHZeXtuOkgir1hM9w6TomM_FP6vBTeuGjVe7xLL0fSPvAd63pwvQicCj7SbX-RQBpvKeAapf5zA70UOYfo_NKic_ErJSWoYkSvDDX67LipjQrZ68X8XQQe3z_U7PfbwKABY91twQftzI4WXbQoRcEv8AgCQ9dxhFTIJgdzeV6slf-vnPHQ2Ic2bSnHpIJRGW-TV3o7zb6eRkTib1xs6SDBd3PIWAZoEz-uQbJ1MXwUEETfcDLNGkGYk25WqgI0tIGbqQoG_oQ
</Trace>
1-9-2022 13:00:23 : EwsRequest --- <Trace Tag="EwsRequest" Tid="1" Time="2022-09-01 11:00:23Z" Version="15.00.0913.015">
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:SmtpAddress>UserAccount#Domain.com</t:SmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:GetEvents>
<m:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</m:SubscriptionId>
<m:Watermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</m:Watermark>
</m:GetEvents>
</soap:Body>
</soap:Envelope>
</Trace>
1-9-2022 13:00:23 : EwsResponseHttpHeaders --- <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2022-09-01 11:00:23Z">
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding
request-id: 614cb84b-af3f-c278-0910-971429e39c7b
X-CalculatedFETarget: AS8PR04CU007.internal.outlook.com
X-BackEndHttpStatus: 200,200
X-CalculatedBETarget: AS8PR07MB7925.eurprd07.PROD.OUTLOOK.COM
X-RUM-Validated: 1
x-ms-appId: fdea1aff-feaa-4d04-b795-55d873f2283b
Restrict-Access-Confirm: 1
x-EwsHandler: GetEvents
X-BeSku: WCS6
X-DiagInfo: AS8PR07MB7925
X-BEServer: AS8PR07MB7925
X-Proxy-RoutingCorrectness: 1
X-Proxy-BackendServerStatus: 200
X-FEProxyInfo: AM4P190CA0002.EURP190.PROD.OUTLOOK.COM
X-FEEFZInfo: AMS
X-FEServer: AS8PR04CA0209,AM4P190CA0002
X-FirstHopCafeEFZ: AMS
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Date: Thu, 01 Sep 2022 11:00:20 GMT
Set-Cookie: exchangecookie=fae0cd80fcd944e9b2e3ac0e021b8dc8; path=/; secure
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
</Trace>
1-9-2022 13:00:23 : EwsResponse --- <Trace Tag="EwsResponse" Tid="1" Time="2022-09-01 11:00:23Z" Version="15.00.0913.015">
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="5612" MinorBuildNumber="5" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</s:Header>
<s:Body>
<m:GetEventsResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetEventsResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Notification>
<t:SubscriptionId>JwBhczhwcjA3bWI3OTI1LmV1cnByZDA3LnByb2Qub3V0bG9vay5jb20QAAAAcX9pz2c1LEavlEM3OLE6OTYrWLgIjNoIEAAAAAAAAAAAAAAAAAAAAAAAAAA=</t:SubscriptionId>
<t:PreviousWatermark>AQAAABTg+YC4KZFNttW01ElEHadDSGwrAAAAAAA=</t:PreviousWatermark>
<t:MoreEvents>false</t:MoreEvents>
<t:StatusEvent>
<t:Watermark>AQAAABTg+YC4KZFNttW01ElEHafKVmwrAAAAAAE=</t:Watermark>
</t:StatusEvent>
</m:Notification>
</m:GetEventsResponseMessage>
</m:ResponseMessages>
</m:GetEventsResponse>
</s:Body>
</s:Envelope>
</Trace>
Receving error Message : "org.mule.runtime.api.exception.MuleRuntimeException - Could not read from file store, while reading payload as Xml.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<amqp:config name="AMQP_Config" doc:name="AMQP Config" doc:id="e0e4ca51-72e7-4d3b-bf01-705aacee16f0" >
<amqp:connection host="orangutan.rmq.cloudamqp.com" port="5672" virtualHost="xxxx" username="xxxx" password="xxxx" />
</amqp:config>
<flow name="artvanFlow" doc:id="59d15f19-3a12-491a-90a0-b2c980dbb05a" >
<amqp:listener doc:name="Listener" doc:id="ea9cb6d6-ccad-4a7f-8925-5879b561910e" config-ref="AMQP_Config" queueName="PIMQueue" outputMimeType="application/xml"/>
<ee:transform doc:name="Transform Message" doc:id="cddf8b22-91af-46b4-a8d6-c4237de75307" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
{
INVMSTP: {
IMDEL: payload.Root.STG_SKU.Activity_Code default ""
}
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<logger level="INFO" doc:name="Logger" doc:id="a3411653-aff7-4363-8d24-6c10334d816f" message="#[payload]"/>
</flow>
</mule>
Apple to resolve the issue. There is no issue with the mule code. Input XML has
<?xml version="1.0" **encoding="WINDOWS-1251"** standalone="yes"?>
if I change to
<?xml version="1.0" **encoding="utf-8"** standalone="yes"?>
Things are fine.
I was under an impression that I can pass multiple ids in the ConvertId request. If I send the following request with two ids (they happen to be folder and its child message), I only get one id back.
Sure sounds like a bug...
Request:
<?xml version="1.0" encoding="ISO-8859-1"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010"/>
</soap:Header>
<soap:Body>
<m:ConvertId DestinationFormat="EwsId">
<m:SourceIds>
<AlternateId Format="EntryId" Id="AAAAAF6BdU8APhVJsGWfKuqS58IBAMfPIwTHe/ZFheiJLdb/e6wAAAAAAQwAAA==" Mailbox="user#domain.demo"/>
<AlternateId Format="EntryId" Id="AAAAAF6BdU8APhVJsGWfKuqS58IHAMfPIwTHe/ZFheiJLdb/e6wAAAAAAQwAAEp86F7RqydMniCqPL+oKLEAAeNW8FMAAA==" Mailbox="user#domain.demo"/>
</m:SourceIds>
</m:ConvertId>
</soap:Body>
</soap:Envelope>
And the response is
<?xml version="1.0" encoding="ISO-8859-1"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" Version="V2018_01_08" MinorBuildNumber="31" MajorBuildNumber="1228" MinorVersion="20" MajorVersion="15"/>
</s:Header>
<s:Body>
<m:ConvertIdResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:ConvertIdResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:AlternateId Mailbox="user#domain.demo" Id="AQMkAGU2ZWM5ZTQwLTk0MjMtNDY3NS1iZWI5LWQ4NTA0MDhmM2U0OQBGAAADXoF1TwA+FUmwZZ8q6pLnwgcAx88jBMd79kWF6Ikt1v97rAAAAgEMAAAASnzoXtGrJ0yeIKo8v6gosQAB41bwUwAAAA==" Format="EwsId" xsi:type="t:AlternateIdType"/>
</m:ConvertIdResponseMessage>
</m:ResponseMessages>
</m:ConvertIdResponse>
</s:Body>
</s:Envelope>
EDIT:
An example of two ids (two messages) request worling as expected.
Request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010"/>
</soap:Header>
<soap:Body>
<ConvertId xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
DestinationFormat="EwsId">
<SourceIds>
<t:AlternateId Format="EntryId"
Id="AAAAAF6BdU8APhVJsGWfKuqS58IHAMfPIwTHe/ZFheiJLdb/e6wAAAAAAQwAAEp86F7RqydMniCqPL+oKLEAAiLXM0AAAA=="
Mailbox="user#domain.demo"/>
<t:AlternateId Mailbox="user#domain.demo"
Id="AAAAAF6BdU8APhVJsGWfKuqS58IHAMfPIwTHe/ZFheiJLdb/e6wAAAAAAQwAAEp86F7RqydMniCq PL+oKLEAAiC+eEMAAA=="
Format="EntryId"/>
</SourceIds>
</ConvertId>
Response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1273" MinorBuildNumber="26" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header><s:Body><m:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:ConvertIdResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:AlternateId xsi:type="t:AlternateIdType" Format="EwsId" Id="AQMkAGU2ZWM5ZTQwLTk0MjMtNDY3NS1iZWI5LWQ4NTA0MDhmM2U0OQBGAAADXoF1TwA+FUmwZZ8q6pLnwgcAx88jBMd79kWF6Ikt1v97rAAAAgEMAAAASnzoXtGrJ0yeIKo8v6gosQACItczQAAAAA==" Mailbox="user#domain.demo"/>
</m:ConvertIdResponseMessage>
<m:ConvertIdResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:AlternateId xsi:type="t:AlternateIdType" Format="EwsId" Id="AQMkAGU2ZWM5ZTQwLTk0MjMtNDY3NS1iZWI5LWQ4NTA0MDhmM2U0OQBGAAADXoF1TwA+FUmwZZ8q6pLnwgcAx88jBMd79kWF6Ikt1v97rAAAAgEMAAAASnzoXtGrJ0yeIKo8v6gosQACIL54QwAAAA==" Mailbox="user#domain.demo"/>
</m:ConvertIdResponseMessage>
</m:ResponseMessages>
</m:ConvertIdResponse>
</s:Body>
</s:Envelope>
Corrections
So, consolidating our exchange so it can be seen as the answer to date.
As per the sanity testing of this method by myself and Dmitry Streblechenko (the OP). In leveraging this method, multiples are allowed.
For example: only one type (messages) or another (folders) is allowed at the same time.
I cannot create any public folder in case when I set proper permission (through WebUI) to that user (in my case admin).
But when I try to update public folder`s 'EffectiveRights' to add permission level to that user I cannot do it. Which request I need to send to update user permission level on public folder or add proper 'EffectiveRights' on that public folder?
Example of the request:
POST outlook.office365.com/EWS/Exchange.asmx
Content-Type:text/xml; charset=utf-8
Accept:text/xml; charset=utf-8
BODY
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<UpdateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<FolderChanges>
<t:FolderChange>
<t:DistinguishedFolderId Id="publicfoldersroot" />
<t:Updates>
<t:SetFolderField>
<t:FieldURI FieldURI="folder:EffectiveRights"/>
<t:Folder>
<t:EffectiveRights>
<t:CreateAssociated>false</t:CreateAssociated>
<t:CreateContents>true</t:CreateContents>
<t:CreateHierarchy>false</t:CreateHierarchy>
<t:Delete>false</t:Delete>
<t:Modify>false</t:Modify>
<t:Read>true</t:Read>
</t:EffectiveRights>
</t:Folder>
</t:SetFolderField>
</t:Updates>
</t:FolderChange>
</FolderChanges>
</UpdateFolder>
</soap:Body>
</soap:Envelope>
and the response is:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1164" MinorBuildNumber="25" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:UpdateFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:UpdateFolderResponseMessage ResponseClass="Error">
<m:MessageText>Set action is invalid for property.</m:MessageText>
<m:ResponseCode>ErrorInvalidPropertySet</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:MessageXml>
<t:FieldURI FieldURI="folder:EffectiveRights"/>
</m:MessageXml>
<m:Folders/>
</m:UpdateFolderResponseMessage>
</m:ResponseMessages>
</m:UpdateFolderResponse>
</s:Body>
</s:Envelope>
another one example:
POST outlook.office365.com/EWS/Exchange.asmx
Content-Type:text/xml; charset=utf-8
Accept:text/xml; charset=utf-8
BODY
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:UpdateFolder>
<m:FolderChanges>
<t:FolderChange>
<t:FolderId Id="AAEuAAAAAAAaRHOQqmYRzZvIAKoAL8RaAwCOXNGsJPKoS5iTrqfBNvbzAACDSr4rAAA=" />
<t:Updates>
<t:SetFolderField>
<t:FieldURI FieldURI="folder:PermissionSet" />
<t:Folder>
<t:PermissionSet>
<t:Permissions>
<t:Permission>
<t:UserId>
<t:PrimarySmtpAddress>test#test_test.onmicrosoft.com</t:PrimarySmtpAddress>
</t:UserId>
<t:PermissionLevel>Editor</t:PermissionLevel>
</t:Permission>
</t:Permissions>
</t:PermissionSet>
</t:Folder>
</t:SetFolderField>
</t:Updates>
</t:FolderChange>
</m:FolderChanges>
</m:UpdateFolder>
</soap:Body>
</soap:Envelope>
and the response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1143" MinorBuildNumber="18" Version="V2018_01_08" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:UpdateFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:UpdateFolderResponseMessage ResponseClass="Error">
<m:MessageText>Access is denied. Check credentials and try again., Underlying MAPI stream threw exception</m:MessageText>
<m:ResponseCode>ErrorAccessDenied</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Folders/>
</m:UpdateFolderResponseMessage>
</m:ResponseMessages>
</m:UpdateFolderResponse>
</s:Body>
</s:Envelope>
Because your trying to create folders in publicfoldersroot no user has rights by default to do that (this is to stop people messing up the Public Folder root). So if you want your user test#test_test.onmicrosoft.com you would need to first grant them rights to do that on the Root folder either using the EAC or Add-PublicFolderclientPermissions. I would suggest you first create a folder in the Root using the EAC and then get your code to create child folders of that, from a development point of view this is easier to cleanup when you need to delete everything and test again then trying to clear the whole root hierarchy each time.
Also only you second example will work because EffectiveRights is a calculate property so can't be updated, all you can do is update the underlying DACL of the folder which is what you second request is doing
Is there a way to get the SMTP details of the current mail from an Outlook web addin? I see that the VSTO addin has this.
I got all the mime data through this
<?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>
<GetItem
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<ItemShape>
<t:BaseShape>Default</t:BaseShape>
<t:IncludeMimeContent>true</t:IncludeMimeContent>
</ItemShape>
<ItemIds>
<t:ItemId Id=" item_id "/>
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
The mime data can then be decoded to get more details about the message