SOAP header Action was not understood



We are getting “SOAP header Action was not understood” error on IEWSClient.ListMessages function when calling any mailboxes. Sample code below:

NetworkCredential credentials = new NetworkCredential();
credentials.UserName = Options.MailProcessDefinition.UserName;
credentials.Password = Options.Password;
credentials.Domain = Options.MailProcessDefinition.Domain;

IEWSClient client = EWSClient.GetEWSClient(“”, credentials);
client.ListMessages(mailBoxFolderUri, numberOfMessages);

Error appears quite often but not constantly. Is this a known issue? if so is there a workaround?

We are using Aspose.Email



Hi Henrik,

We regret any inconvenience caused to you.

We have tested connectivity to Office365 account and listing messages functionality with the latest version of the API i.e. Aspose.Email for .NET 17.5 and were not able to face any such problem. Could you please give it a try using the latest version of the API and let us know your feedback? Following test account and sample code was used by us for testing this issue at our end.

Sample Code

IEWSClient client = EWSClient.GetEWSClient(“”, username, “Aspose1234”);

client.ListMessages(client.MailboxInfo.InboxUri, 3);


I am facing this same issue currently. This was working till some days back correctly. Now it is giving error whenever I execute the line:

var client = EWSClient.GetEWSClient(“”, serviceId, servicePassword, domainId);

Error Details:
2019-08-05 07:36:46,668 [10] ERROR - Getting error while retrieving mail details from GetEmails method.
System.Web.Services.Protocols.SoapHeaderException: SOAP header Action was not understood.
at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at #=zQ6x2gZKDdkg2KO_xlBukqO4WBSnEMMYQuAyAc8IugWy0rJi0Uw==.GetFolder(GetFolderType GetFolder1)
at Aspose.Email.Clients.Exchange.WebService.EWSClient.GetEWSClient(String mailboxUri, ICredentials credentials, WebProxy proxy)
at Aspose.Email.Clients.Exchange.WebService.EWSClient.GetEWSClient(String mailboxUri, String username, String password, String domain)
at …



I have observed the issue shared by you and request you to please first try using Aspose.Email for .NET 19.7 on your end. If there is still an issue then please provide the sample project along with test account access reproducing the issue so that we may investigate that further to help you out.