Aspose.email - The request failed with HTTP status 404: Resource Not Found

I have a console application with the following code:

Sub Main()

Const mailboxUri As String = "http://server/exchange/"
Const username As String = "user"
Const password As String = "password"
Const domain As String = "domain"
Dim credential As New NetworkCredential(username, password, domain)
Using client As New ExchangeWebServiceClient(mailboxUri, credential)
Dim ver As ExchangeMailboxInfo = client.GetMailboxInfo
End Using

End Sub

I am getting the following error:

The request failed with HTTP status 404: Resource Not Found.



It is authenticating correctly, if the password is incorrect, I get the error: The request failed with HTTP status 401: Unauthorized.


I am running Exchange Server 2003, and the server web access is available from the URL as above.

Should I be configuring Exchange Server a specific way for the this to work?

Hi Paul,

As the authentication is done correctly, it seems an issue with the URL that is being presented to the Aspose.Email API. Please try the Uri as follow and let us know your feedback. I have quoted this from the documentation link as available HERE. Please add the username at the end of the Uri.

'Create instance of ExchangeClient class by giving credentials 
`Dim client As ExchangeClient = New ExchangeClient(“[http://MachineName/exchange/Username](http://machinename/exchange/Username)”, “Username”, “password”, “domain”)

Still no luck, still 404 but now “Not Found” instead


I have enabled the WebClient service on the server now.

Should I be opening any ports on Windows Firewall?

Is there any other technical configuration I could possibly require?



Hi Paul,


As you have mentioned that you are using Exchange server 2003, you don’t have to use the ExchangeWebServiceClient class as it is for Exchange server 2007 and 2010. Aspose.Email communicates with Exchange Server 2003 using WebDav protocol, and uses the instance of ExchangeClient class for this purpose. Please try the code at the link that I provided earlier and let us know your feedback.

If the problem still persists, we request you to please create a test account for us at your exchange server and provide us the credentials. We will try to test it from our end and let you know our feedback.

Interesting…


Creating a new user works, but my existing user (created when we migrated to Exchange 2003 doesn’t work) I will have to figure this out Exchange side.

Another question, is it possible to use the username and password of the the current logged network user (WinForms application), to passthrough to the ExchangeClient class?

Many thanks
Paul
Hi Paul,

I am afraid to share that I have never tested this scenario. You may please test it at your side and if you face any problem with regard to Aspose.Email, feel free to write us back along with some sample application if possible. We will be more than happy to assist you as much as possible.

Your patience and understanding is highly appreciated.

No problem, I appreciate your quick feedback!


Thanks
Paul

Hi Paul,


You are welcome. Please feel free to contact us if you have any additional query/inquiry. We will feel glad to assist you further.