none
EWS API: {"The request failed. The remote server returned an error: (400) Bad Request."} RRS feed

  • Question

  • Hello,

    I make a simple EWS call to create an appointment with a small attachment (120Kb).

    When i .Save() or .Update() the appointment without the attachment everything is ok.

    Doing the same with the attachment fails with the follwoing error:

    {"The request failed. The remote server returned an error: (400) Bad Request."}

    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(HttpWebRequest& request)\r\n   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()\r\n   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()\r\n   at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateAttachments(String parentItemId, IEnumerable`1 attachments)\r\n   at Microsoft.Exchange.WebServices.Data.AttachmentCollection.InternalCreateAttachments(String parentItemId, IEnumerable`1 attachments)\r\n   at Microsoft.Exchange.WebServices.Data.AttachmentCollection.Save()\r\n   at Microsoft.Exchange.WebServices.Data.Item.InternalUpdate(FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode)\r\n   at Microsoft.Exchange.WebServices.Data.Appointment.Update(ConflictResolutionMode conflictResolutionMode, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)\r\n


    Any help would be appreciated. Thanks in advance.

    Friday, August 17, 2012 2:40 PM

Answers

  • This forum is for VSTO Office addins, not for EWS. You might have better luck in getting an answer in an EWS forum such as http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Andries Muylaert" <=?utf-8?B?QW5kcmllcyBNdXlsYWVydA==?=> wrote in message news:4ae85abe-2735-4bee-b339-64ac8d81a810...

    Hello,

    I make a simple EWS call to create an appointment with a small attachment (120Kb).

    When i .Save() or .Update() the appointment without the attachment everything is ok.

    Doing the same with the attachment fails with the follwoing error:

    {"The request failed. The remote server returned an error: (400) Bad Request."}

    at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(HttpWebRequest& request)\r\n   at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()\r\n   at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()\r\n   at Microsoft.Exchange.WebServices.Data.ExchangeService.CreateAttachments(String parentItemId, IEnumerable`1 attachments)\r\n   at Microsoft.Exchange.WebServices.Data.AttachmentCollection.InternalCreateAttachments(String parentItemId, IEnumerable`1 attachments)\r\n   at Microsoft.Exchange.WebServices.Data.AttachmentCollection.Save()\r\n   at Microsoft.Exchange.WebServices.Data.Item.InternalUpdate(FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode)\r\n   at Microsoft.Exchange.WebServices.Data.Appointment.Update(ConflictResolutionMode conflictResolutionMode, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)\r\n


    Any help would be appreciated. Thanks in advance.


    Ken Slovak MVP - Outlook
    Friday, August 17, 2012 3:23 PM