Solved

Intermittent IIS 400 Bad Request when using HttpWebResponse

Posted on 2011-09-06
3
307 Views
Last Modified: 2012-05-12
I am using the following C# example against Exchange 2003:

http://msdn.microsoft.com/en-us/library/ms877306(v=exchg.65).aspx.

The sample code intermittently encounters a 400 "Bad Request" error when trying to save an Exchange appointment. The error occurs on the command-line:

PROPPATCHResponse = (System.Net.HttpWebResponse)PROPPATCHRequest.GetResponse();

How can I find the cause of this problem?
0
Comment
Question by:brian_appliedcpu
  • 2
3 Comments
 
LVL 28

Assisted Solution

by:strickdd
strickdd earned 500 total points
Comment Utility
My initial inclimnation is that you are not encoding your XML characters (i.e., < should be &lt;). That would form a bad request. I would also recommend drilling down into the web resposne object to see if it gives more error deatils. The last thing is to print out the request object and make sure that it is properly formatted and isn't missing any parameters for any reason.
0
 
LVL 2

Accepted Solution

by:
brian_appliedcpu earned 0 total points
Comment Utility
I will look at this when i get a moment, things have been crazy.
0
 
LVL 2

Author Closing Comment

by:brian_appliedcpu
Comment Utility
Sorry for the slow followup. I was passing a webdav string that contained (among other things) a timezone setting and the XML that specified the setting was mal-formed.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Hangfire / asp.net sample 3 27
Maintain selection of the datagrdview 8 18
Library to convert HTML to PDF. 8 41
XML & .net 5 0
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now