NetTalk Central

Author Topic: (XPost) Interacting with Exchange Web Services (EWS)  (Read 3346 times)

Stu

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
    • Email
(XPost) Interacting with Exchange Web Services (EWS)
« on: June 04, 2014, 05:12:58 PM »
Hi Folks,

I'm trying to get access to emails through Exchange Web Services.

When needing authorization, I've been using ThisWebClient.Authorization = ThisWebClient.CreateAuthorizationString(username,password) in a procedure with a NetWebClient object.

At the moment, accessing the EWS page (https://mailserver.com/ews/Exchange.asmx) with the above gives back 401s.

Reading http://msdn.microsoft.com/en-us/library/office/dd633692(v=exchg.80).aspx makes me wonder if I need to somehow include the "Domain" in there. I've tried "domain\username" in the above username, but it doesn't seem to work.

Any ideas/thoughts?
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11191
    • View Profile
Re: (XPost) Interacting with Exchange Web Services (EWS)
« Reply #1 on: June 04, 2014, 10:57:50 PM »
just to be clear - is https://mailserver.com/ews/Exchange.asmx something I should be able to access from here, or is it something you can only get to from your computer?

a 401 is a page not found, not an authorization error, so I'm wondering if the error code is wrong, or you simply have the wrong address...

cheers
Bruce

Stu

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
    • Email
Re: (XPost) Interacting with Exchange Web Services (EWS)
« Reply #2 on: June 05, 2014, 03:36:05 PM »
Apologies Bruce, should have been https://<mailservername>/ews/Exchange.asmx. No, you can't get to it.

I've done a fair bit more research and experimentation since posting this up.

It gives back a 401 with "authorization" issue in the header.

The address I'm using is correct. I can log in over a browser. But using a Fetch with the same credentials (username/password) gives back the Authorization error 401 header.

Now.

Because /owa (the browser login for exchange) is set to "forms based security" (not basic or digest), EWS uses that security. Now I'm not sure exactly what it means, but the Basic and/or Digest code in nettalk doesn't work.

Am still very much in the unknown with this. But will plod on.
Cheers,

Stu Andrews