Bad request
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Bad request

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
wannaknowmore
Guest





Posted: Fri Nov 11, 2005 12:04 am    Post subject: Bad request Reply with quote

I am using code directly from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_exch2k_getting_item_property_values_http_webdav_.asp
in C#.
The first time I ran (with my values) it ran perfectly .. the second
time I ran it it gave me a System.Net.WebException {"The remote server
returned an error: (400) Bad Request."} StackTrace " at
System.Net.HttpWebRequest.CheckFinalStatus()\r\n at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n
at System.Net.HttpWebRequest.GetResponse()\r\n at
TestConsole.GettingItemPropertyValuesWebDAV.Main(String[] args) in
c:\\r\\prgrm\\testconsole\\gettingitempropertyvalueswebdav.cs:line
84" string
line 84 is Response = (HttpWebResponse)Request.GetResponse(); for me.

Ever since WITH THE SAME CODE it passes something like 1 times out of
10 runs .. ??

Any suggestions?

Back to top
wannaknowmore
Guest





Posted: Fri Nov 11, 2005 5:58 pm    Post subject: Re: Bad request Reply with quote

the below is my code:

// Build the PROPFIND request body.
StringBuilder strbr = new StringBuilder() ;
strbr.Append("<?xml version=\"1.0\"?>") ;
strbr.Append("<d:propfind xmlns:d='DAV:'><d:prop>") ;
strbr.Append("<d:displayname/></d:prop></d:propfind>") ;
strBody = strbr.ToString() ;
// Create a new CredentialCache object and fill it with the network
// credentials required to access the server.
MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add( new System.Uri(strSrcURI),
"BASIC",
new System.Net.NetworkCredential(strUserName, strPassword, strDomain)
);

The change from the original code: NTLM to BASIC and the StringBuilder
- but even this is giving the same error as above.

Please advice.
Back to top
wannaknowmore
Guest





Posted: Fri Nov 11, 2005 5:58 pm    Post subject: Re: Bad request Reply with quote

the below is my code:

// Build the PROPFIND request body.
StringBuilder strbr = new StringBuilder() ;
strbr.Append("<?xml version=\"1.0\"?>") ;
strbr.Append("<d:propfind xmlns:d='DAV:'><d:prop>") ;
strbr.Append("<d:displayname/></d:prop></d:propfind>") ;
strBody = strbr.ToString() ;
// Create a new CredentialCache object and fill it with the network
// credentials required to access the server.
MyCredentialCache = new System.Net.CredentialCache();
MyCredentialCache.Add( new System.Uri(strSrcURI),
"BASIC",
new System.Net.NetworkCredential(strUserName, strPassword, strDomain)
);

The change from the original code: NTLM to BASIC and the StringBuilder
- but even this is giving the same error as above.

Please advice.

Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
New Topics Powered by phpBB