Solved

Intermittent IIS 400 Bad Request when using HttpWebResponse

Posted on 2011-09-06
3
318 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
ID: 36490099
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
ID: 36570890
I will look at this when i get a moment, things have been crazy.
0
 
LVL 2

Author Closing Comment

by:brian_appliedcpu
ID: 36908448
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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