Message : The request failed. The remote server returned an error: (404) Not Found.

May 7, 2014 at 9:33 AM
Edited May 8, 2014 at 8:23 AM
Hi,
Sharepoint Foundation 2013 and Exchange 2010 SP3.
After configuring the impersonate accont I always receive the following error message in the webpart.

MailBox Account : i:0#.w|xxx\yyy
Message : The request failed. The remote server returned an error: (404) Not Found.
MailBox Account : i:0#.w|xxx\yyy
Message : The request failed. The remote server returned an error: (404) Not Found.
Error on getLastUnreadItems function
ErrorCode : at WP_Exchange.WP_Exchange.WP_ExchangeUserControl.getLastUnreadItems(Folder inbox)
Message : Object reference not set to an instance of an object.
May 7, 2014 at 2:12 PM
Hi,

Can you tell me what URL are you using in the webpart.

Damien.
May 8, 2014 at 8:21 AM
Edited May 8, 2014 at 8:47 AM
Hi,
I tried with https://webmail.xxx.yy/ews/exchange.asmx 'cause we have 4 server with load balancers but even using https://SERVER_FQDN/ews/exchange.asmx (where my mailbox database is mounted and active) it's not working.
I verified the account with Rbac Manager (Codeplex Project) and the user has impersonate rights.
To further debug, I have this error in the WebPart:

MailBox Account : i:0#.w|xxx\yyy
Message : The request failed. The remote server returned an error: (401) Unauthorized.
MailBox Account : i:0#.w|xxx\yyy
Message : The request failed. The remote server returned an error: (401) Unauthorized.
Error on getLastUnreadItems function
ErrorCode : at WP_Exchange.WP_Exchange.WP_ExchangeUserControl.getLastUnreadItems(Folder inbox)
Message : Object reference not set to an instance of an object.

On the Exchange server I have the following log
POST /EWS/Exchange.asmx - 443 - xxx.xxx.xxx.xxx MS-WebServices/1.0 - 401 0 0 0

Can it be of any help ?!?
http://support.microsoft.com/kb/811318/en-us

Certificate problems ?!? (it would be nice to ignore certificates mismatch or similar)

Thank You in advance.

Red.
May 13, 2014 at 8:16 AM
Hi,

Exchange Web Services is deployed with the Client Access server role, specified this server in the URL.

The developpement ignore warning SSL, this is not the problem.

Maybe, the identity of the application pool of the SharePoint Web Application.
Can you verify if there is a domain account or a local account.

Damien.
May 13, 2014 at 10:47 AM
Hi,
all the application pool (in IIS) have the identity of "NetworkService" and all my Exchange server have CAS role installed.

Red.
May 13, 2014 at 4:05 PM
OK, try to use te impersonate account in a Windows session and navigate to your EWS URL.
You must have :
Image

If OK it's a webpart configuration problem, what domain name are you using NETBIOS ou FQDN ?
May 14, 2014 at 3:31 PM
Edited May 14, 2014 at 3:32 PM
I confirm that a browser direct call is working as expected.
InWebpart I tried both Netbios and FQDN with the same result.

Exchange 2010 SP3 RU4

Regards.

Red.