We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Object Reference error when using EWSClient.GetContacs

After upgrading to 17.4, Aspose Email throws an Object reference exception when trying to GetContacts from office365.


This is the code I’m using:
var client =EWSClient.GetEWSClient(MAILSERVER, mailAddress, mailPassword, domain);
var contactCollection = client.GetContacts(client.MailboxInfo.ContactsUri);

This is the error I get:
2017/05/23 12:28:03.604 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - System.NullReferenceException from Aspose.Email
2017/05/23 12:28:03.619 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - Object reference not set to an instance of an object.
2017/05/23 12:28:03.619 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - at #=qHx$H819s6J8V8_2Ad3PdzPWfCuzyVmTBJG$1SpkOykZULl4DXYPkQDi2w8i2y25Q.#=qyBTs6Pm2XT7rrY_lTARbYAXxNwFe2_ZmWVzZbGSX4bk=(ContactItemType #=qmVrhCJV6clysV3ksht4VgQ==, List1 #=q3j$EWAIrro_hVJZ65SVzXq2hZgNr8TS$0JctaJu_Ypo=)</div><div> at #=q$URVFJ46Py_sB1wW4BhrMlxBBAff4rCUmTy697lRNldEs5shCrH0bISWYGq4qZttr2BeOO9wOaIaWYtwWk6gnQ==.#=qelzCaEmFjO5lCC_iw6H$rw==(List1 #=qXbHE6Sf3DIOashJDq1P$iA==, ExchangeListContactsOptions #=qnVinIpv3grjH1YTaHEyVNw==)
at #=q$URVFJ46Py_sB1wW4BhrMlxBBAff4rCUmTy697lRNldEs5shCrH0bISWYGq4qZttr2BeOO9wOaIaWYtwWk6gnQ==.GetContacts(String #=q9wodUnHA4FXo71BdJz4meA==)
at Services.DataService.Controllers.DocumentsController.Contacts(String emailpass) in C:\Workspace\6.2Patch\Source\Services\REST\DataService\Controllers\DocumentsController.cs:line 1447
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)

The method GetMailboxes() throws a similar exception.

Thanks,

Felix
Lopez-Phillips


Senior Software Engineer<o:p></o:p>

DOCUPHASE

+1.727.441.8228
www.docuphase.com


Hi Felix,


Thank you for contacting Aspose support team.

This issue is re-produced and logged under Id:EMAILNET-38753 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

The issues you have found earlier (filed as EMAILNET-38753) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thanks, that solved the problem with the GetContacts() method but as I mentioned in my first email the GetMailBoxes() threw a similar error.

With the 17.6 version release the GetMailBoxes throws the following error now:

The specified e-mail address is currently not supported.

The stack trace:

at #=q46bCUqGsDG$h2hXsY_YuoUv8_T1vDaDxSSayhRP3U$HRSwBcZfrHSCACB034Wsxf.#=qHFL$noo7Rej7NPsXx22PVHOWUwwv00C1nWm$73AeVI8=(String #=qtBSdXAHT0dVknebNVYYU1A==, Int32& #=qSTCWT30Bl_JJQCZbpTEGQw==, StringBuilder #=q_ZsakSS6EnWwlX78w2a53Q==, StringBuilder #=qX9r7fQDcHYBdp7Sln1S$hA==, Boolean #=qKNbE9Gb8DcUEIyZZJJfd0A==)
at #=q46bCUqGsDG$h2hXsY_YuoUv8_T1vDaDxSSayhRP3U$HRSwBcZfrHSCACB034Wsxf.#=qHFL$noo7Rej7NPsXx22PVHOWUwwv00C1nWm$73AeVI8=(String #=qtBSdXAHT0dVknebNVYYU1A==, Int32& #=qSTCWT30Bl_JJQCZbpTEGQw==, String& #=q_ZsakSS6EnWwlX78w2a53Q==)
at Aspose.Email.MailAddress.#=qT0OMOk3d4SpyuQGFXqiJ8g==(String #=qX9r7fQDcHYBdp7Sln1S$hA==)
at Aspose.Email.MailAddress.#=qKf6peq4vulZEA3KBqYIme6a4r0v_Vnr5GiwGmaU19pw=(String #=qX9r7fQDcHYBdp7Sln1S$hA==)
at Aspose.Email.MailAddress.set_Address(String value)
at #=qCsj6d7Nyv$B0vE6HlCrvN0eQddAPCecoKBEF_Zhi0EMKct$iXnaBc9UAt3zMESZd.#=qVXcQCKpX1xHOzcJVEwxdQCzRxz$IE$WjN5CY21dZi_A=(ContactItemType #=qeZfWVIbegoy4K6V5chEe4Q==, List1 #=qRis$Z$IsOlhxFZeLJvUKwi2$CqR9XYRWdt$Yo0OzUL4=)</div><div> at #=q$yz4C5jwN9cJZYeawrTUTPCDGBoXj02TULPb9$GFNlvOJO7bkpLv0peNWloirobt05vvpHwb4uVML3K2BYEEOQ==.#=qQeUiZj9Hsl1qOQrI5MCiF1ikn51GVI38P8wpiUWg4dE=(String #=qN5JO4My0wm8Pt3$dsjKBpeJaxE59OSGz0fyeZ7D0Dj8=, ResolveNamesSearchScopeType #=q3zFBnS4WEDs_WvsyIFWBQQ==, ExchangeListContactsOptions #=qgK40ADtCd73AQrOA96$63g==)</div><div> at #=q$yz4C5jwN9cJZYeawrTUTPCDGBoXj02TULPb9$GFNlvOJO7bkpLv0peNWloirobt05vvpHwb4uVML3K2BYEEOQ==.GetMailboxes()</div><div> at Services.DataService.Controllers.DocumentsController.Contacts(String emailpass) in C:\Workspace\6.2Development\Source\Services\REST\DataService\Controllers\DocumentsController.cs:line 1432</div><div> at lambda_method(Closure , Object , Object[] )</div><div> at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)</div><div> at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)

Hi Felix,


We are sorry for the inconvenience caused to you.

The issue was reproduced at our end and has been logged as EMAILNET-38769 for further investigation by our Product team. We’ll update you here once there is some feedback or a fix version available in this regard.