none
Request failed. The remote server returned an error: (405) Method Not Allowed.

    Question

  • Hi,

    I'm using the Exchange Managed API now for a few days, at first everything worked wonderfully, but 2 days ago the administrator of the Exchange-Service has changed the WebService-URL to a SSL-one.
    But I solved this problem with the following lines of code in my class ExchangeWebServiceImpl:

            private static bool ignoreInvalidCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors policyErrors)
            {return true;}


            public ExchangeWebServiceImpl() {
                ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ignoreInvalidCertificate);
            }


    but again I have a problem, when I call the ExchangeServer, doesn't mather if it is a create/delete or find-operation, I get the following error-message:

    Unhandled Exception: Microsoft.Exchange.WebServices.Data.ServiceRequestException: Request failed. The remote server returned an error: (405) Method Not Allowed.
     ---> System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.
       at System.Net.HttpWebRequest.GetResponse()
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.Emit()
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.InternalExecute()
       --- End of inner exception stack trace ---
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.InternalExecute()
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable`1 items, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
       at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateItem(Item item,FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
       at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
       at Microsoft.Exchange.WebServices.Data.Item.Save()
       at ExchangeWebService5.ExchangeWebServiceImpl.createKitchenCalendarEntry(String location, DateTime start, Int32 duration, String subject, String body, Int32min_reminder) in C:\Documents and Settings\<username>\My Documents\Visual Studio 2008\Projects\ExchangeWebService5\ExchangeWebService5\ExchangeWebServiceImpl.cs:line 180
       at ExchangeWebService5.Program.Main(String[] args) in C:\Documents and Settings\<username>\My Documents\Visual Studio 2008\Projects\ExchangeWebService5\ExchangeWebService5\Program.cs:line 61


    thanks for your attention
    I'm despairing here with this problem and would be really happy if you could help me with the solution :-)

    regards
    Michael
    Thursday, August 27, 2009 9:25 AM

Answers