Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Connecting with Office 365-Autodiscover could not be located

$
0
0

Hi ,

I have built a VB project where I was using API 1.2 to connect to exchange server 2010 using webservices.

To be more specific , I was connecting in my Office 365 which had exchange 2010.

I was using the below code where the Me.ExchangeVersion1 is an enumaration.

1 for exchange 2007 ,etc... Exchange 2013 has number 4.

But I'm getting now in exchange 2013(office 365) and error which says.

The Autodiscover service couldn't be located.

 I'm changing the exchangeversion to 4 and leave the rest of the code intact.       

Am I doing anything wrong ?

I have asked a long time ago about if there will be changes between API 1.2 and API 2.0 and ,don't remember the name ,someone from Microsoft told me that no changes will be made unless you want to use new features of Exchange 2013 which I didn't want that. In other words , business as usual. Can anyone assist me on this ? Is it something that I need to look for ?Or change in my code ?

 Public Function GetBinding() As ExchangeService
        ' Create the binding.
        Dim service As New ExchangeService(Me.ExchangeVersion1)

        ' Define credentials.
        service.Credentials = New WebCredentials(UserName, PassWord)


        ' Use the AutodiscoverUrl method to locate the service endpoint.
        Try


            service.AutodiscoverUrl(UserName, _
                    New AutodiscoverRedirectionUrlValidationCallback( _
                        AddressOf MycustomClass.RedirectionUrlValidationCallback))


        Catch ex As AutodiscoverRemoteException
            Me.ErrorCode = -1
            Me.SetErrorMessage(ex.Message)
            Throw ex
        End Try


        Return service
    End Function

  ' Create the callback to validate the redirection URL.
    Private Shared Function RedirectionUrlValidationCallback(ByVal redirectionUrl As String) As Boolean
        ' Perform validation.
        Return (redirectionUrl = _
                "https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml")
    End Function



Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>