Intermittent IIS 400 Bad Request when using HttpWebResponse

brian_appliedcpu
brian_appliedcpu used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
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.
I will look at this when i get a moment, things have been crazy.

Author

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial