Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HTTP 401 connection to Web Services

6 views
Skip to first unread message

milop

unread,
Dec 10, 2009, 10:06:52 AM12/10/09
to
Hello.

I've written a webpart for a Sharepoint 2007 installation that accesses an
Exchange 2007 service via Exchange Web Services.

The two servers are on separate machines.

If I create a new NetworkCredential using UserID/Password/Domain, no
problem. It connects and everything works.

If I change the credentials to CredentialCache.DefaultNetworkCredentials I
get an HTTP 401 from the web part.

Here's the code that fails:

Public Function GetServiceBinding(ByVal ExchangeURI As String) As
Exchange2007WS.ExchangeServiceBinding

Try
Dim esb As New Exchange2007WS.ExchangeServiceBinding()
esb.PreAuthenticate = True
esb.Credentials = CredentialCache.DefaultNetworkCredentials
esb.Url = ExchangeURI
Return esb

Catch ex As Exception
Throw

End Try

End Function

Is it the double-hop issue, NTLM's inablility to delegate its credentials
from one machine to the other? The two servers are part of the same domain.

Thanks in advance,

Mike


milop

unread,
Dec 11, 2009, 6:03:05 AM12/11/09
to
I found the answer.

Yes, it was the double-hop.

To make it work I enabled ExchangeImpersonation.

"milop" <mi...@slomins.com> wrote in message
news:eMqUzpae...@TK2MSFTNGP02.phx.gbl...

0 new messages