| Author |
Message |
wannaknowmore
Guest
|
Posted:
Fri Nov 11, 2005 12:04 am Post subject:
Bad request |
|
|
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 |
|
|
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 |
|
|
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 |
|
 |
|
|
|
|