|
|
|
date: Tue, 9 May 2006 16:13:32 +0300,
group: microsoft.public.exchange2000.development
back
Re: 409 conflict?
Hi,
Here is my part of code for sending mail...
#region MailBox
// Build the mailbox URI.
strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;
#endregion
#region Gnderen Submission
strSubURI = "http://" + strServer + "/exchange/" + strAlias
+ "/##DavMailSubmissionURI##/";
#endregion
#region Draft
strTempURI = "http://" + strServer + "/exchange/" + strAlias
+ "/drafts/" + strSubject + ".eml";
#endregion
#region Message
strBody = "To: " + strTo + "\n" +
"Cc: " + strToCC + "\n" +
"Subject: " + strSubject + "\n" +
"Date: " + System.DateTime.Now +
"X-Mailer: test mailer" + "\n" +
"MIME-Version: 1.0" + "\n" +
"Content-Type: text/plain;" + "\n" +
"Charset = \"iso-8859-9\"" + "\n" +
"Content-Transfer-Encoding: 7bit" + "\n" +
"\n" + strText;
#endregion
#region Credentials
MyCredentialCache = new System.Net.CredentialCache ( );
MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "NTLM" , new
NetworkCredential ( strAlias , strPassword , strDomain ) );
MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Basic" , new
NetworkCredential ( strAlias , strPassword , strDomain ) );
MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Digest" , new
NetworkCredential ( strAlias , strPassword , strDomain ) );
#endregion
#region PUT Message
// Create the HttpWebRequest object.
PUTRequest = ( HttpWebRequest ) HttpWebRequest.Create ( strTempURI );
// Add the network credentials to the request.
PUTRequest.Credentials = MyCredentialCache;
// Specify the PUT method.
PUTRequest.Method = "PUT";
// Encode the body using UTF-8.
bytes = Encoding.GetEncoding ( "iso-8859-9" ).GetBytes ( ( string )
strBody );
// Set the content header length. This must be
// done before writing data to the request stream.
PUTRequest.ContentLength = bytes.Length;
// Get a reference to the request stream.
PUTRequestStream = PUTRequest.GetRequestStream ( );
// Write the message body to the request stream.
PUTRequestStream.Write ( bytes , 0 , bytes.Length );
// Close the Stream object to release the connection
// for further use.
PUTRequestStream.Close ( );
// Set the Content-Type header to the RFC 822 message format.
PUTRequest.ContentType = "message/rfc822";
// PUT the message in the Drafts folder of the
// sender's mailbox.
PUTResponse = ( HttpWebResponse ) PUTRequest.GetResponse ( );
#endregion
When the cursor comes to the "PUTResponse = ( HttpWebResponse )
PUTRequest.GetResponse ( );" row while i am debugging, after executing, it
gives the 409 error.
I hope it helps you thanks...
"Henning Krause [MVP]" wrote in
message news:OLa8a92cGHA.3840@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> a 409 usually indicates that the parent folder does not exist.
>
> It would help a lot, if you post your code here along with the urls you
> use.
>
> Greetings,
> Henning Krause
>
> "Adam Right" wrote in message
> news:%23fg3jn2cGHA.5048@TK2MSFTNGP03.phx.gbl...
>> Hi,
>>
>> I am using HTTPWebRequest to write an email file to exhchange server, and
>> using HttpWebResponse. But when webresponse is executed it gives an error
>> 409 "remote server returned error". what can be the problem? Thanks..
>>
>
>
date: Tue, 9 May 2006 17:35:26 +0300
author: Adam Right
Re: 409 conflict?
Hello,
are you working on an english mailbox? The drafts folder is one of the
localized folders...
Greetings,
Henning Krause
"Adam Right" wrote in message
news:ewLAVV3cGHA.3908@TK2MSFTNGP04.phx.gbl...
>
> Hi,
>
> Here is my part of code for sending mail...
>
> #region MailBox
> // Build the mailbox URI.
> strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;
> #endregion
>
> #region Gnderen Submission
> strSubURI = "http://" + strServer + "/exchange/" + strAlias
> + "/##DavMailSubmissionURI##/";
> #endregion
>
> #region Draft
> strTempURI = "http://" + strServer + "/exchange/" + strAlias
> + "/drafts/" + strSubject + ".eml";
> #endregion
>
> #region Message
> strBody = "To: " + strTo + "\n" +
> "Cc: " + strToCC + "\n" +
> "Subject: " + strSubject + "\n" +
> "Date: " + System.DateTime.Now +
> "X-Mailer: test mailer" + "\n" +
> "MIME-Version: 1.0" + "\n" +
> "Content-Type: text/plain;" + "\n" +
> "Charset = \"iso-8859-9\"" + "\n" +
> "Content-Transfer-Encoding: 7bit" + "\n" +
> "\n" + strText;
> #endregion
>
> #region Credentials
>
> MyCredentialCache = new System.Net.CredentialCache ( );
> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "NTLM" , new
> NetworkCredential ( strAlias , strPassword , strDomain ) );
> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Basic" , new
> NetworkCredential ( strAlias , strPassword , strDomain ) );
> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Digest" , new
> NetworkCredential ( strAlias , strPassword , strDomain ) );
>
> #endregion
>
> #region PUT Message
> // Create the HttpWebRequest object.
> PUTRequest = ( HttpWebRequest ) HttpWebRequest.Create ( strTempURI );
>
> // Add the network credentials to the request.
> PUTRequest.Credentials = MyCredentialCache;
>
> // Specify the PUT method.
> PUTRequest.Method = "PUT";
>
> // Encode the body using UTF-8.
> bytes = Encoding.GetEncoding ( "iso-8859-9" ).GetBytes ( ( string )
> strBody );
>
> // Set the content header length. This must be
> // done before writing data to the request stream.
> PUTRequest.ContentLength = bytes.Length;
>
> // Get a reference to the request stream.
> PUTRequestStream = PUTRequest.GetRequestStream ( );
>
> // Write the message body to the request stream.
> PUTRequestStream.Write ( bytes , 0 , bytes.Length );
>
> // Close the Stream object to release the connection
> // for further use.
> PUTRequestStream.Close ( );
>
> // Set the Content-Type header to the RFC 822 message format.
> PUTRequest.ContentType = "message/rfc822";
>
> // PUT the message in the Drafts folder of the
> // sender's mailbox.
> PUTResponse = ( HttpWebResponse ) PUTRequest.GetResponse ( );
> #endregion
>
> When the cursor comes to the "PUTResponse = ( HttpWebResponse )
> PUTRequest.GetResponse ( );" row while i am debugging, after executing, it
> gives the 409 error.
>
> I hope it helps you thanks...
>
>
> "Henning Krause [MVP]" wrote in
> message news:OLa8a92cGHA.3840@TK2MSFTNGP04.phx.gbl...
>> Hello,
>>
>> a 409 usually indicates that the parent folder does not exist.
>>
>> It would help a lot, if you post your code here along with the urls you
>> use.
>>
>> Greetings,
>> Henning Krause
>>
>> "Adam Right" wrote in message
>> news:%23fg3jn2cGHA.5048@TK2MSFTNGP03.phx.gbl...
>>> Hi,
>>>
>>> I am using HTTPWebRequest to write an email file to exhchange server,
>>> and using HttpWebResponse. But when webresponse is executed it gives an
>>> error 409 "remote server returned error". what can be the problem?
>>> Thanks..
>>>
>>
>>
>
>
date: Tue, 9 May 2006 16:50:12 +0200
author: Henning Krause [MVP]
Re: 409 conflict?
Hi,
Yes i am working in english box. Is there solution for 409 conflict problem?
"Henning Krause [MVP]" wrote in
message news:eufGof3cGHA.1204@TK2MSFTNGP02.phx.gbl...
> Hello,
>
> are you working on an english mailbox? The drafts folder is one of the
> localized folders...
>
> Greetings,
> Henning Krause
>
> "Adam Right" wrote in message
> news:ewLAVV3cGHA.3908@TK2MSFTNGP04.phx.gbl...
>>
>> Hi,
>>
>> Here is my part of code for sending mail...
>>
>> #region MailBox
>> // Build the mailbox URI.
>> strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;
>> #endregion
>>
>> #region Gnderen Submission
>> strSubURI = "http://" + strServer + "/exchange/" + strAlias
>> + "/##DavMailSubmissionURI##/";
>> #endregion
>>
>> #region Draft
>> strTempURI = "http://" + strServer + "/exchange/" + strAlias
>> + "/drafts/" + strSubject + ".eml";
>> #endregion
>>
>> #region Message
>> strBody = "To: " + strTo + "\n" +
>> "Cc: " + strToCC + "\n" +
>> "Subject: " + strSubject + "\n" +
>> "Date: " + System.DateTime.Now +
>> "X-Mailer: test mailer" + "\n" +
>> "MIME-Version: 1.0" + "\n" +
>> "Content-Type: text/plain;" + "\n" +
>> "Charset = \"iso-8859-9\"" + "\n" +
>> "Content-Transfer-Encoding: 7bit" + "\n" +
>> "\n" + strText;
>> #endregion
>>
>> #region Credentials
>>
>> MyCredentialCache = new System.Net.CredentialCache ( );
>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "NTLM" , new
>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Basic" , new
>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Digest" , new
>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>
>> #endregion
>>
>> #region PUT Message
>> // Create the HttpWebRequest object.
>> PUTRequest = ( HttpWebRequest ) HttpWebRequest.Create ( strTempURI );
>>
>> // Add the network credentials to the request.
>> PUTRequest.Credentials = MyCredentialCache;
>>
>> // Specify the PUT method.
>> PUTRequest.Method = "PUT";
>>
>> // Encode the body using UTF-8.
>> bytes = Encoding.GetEncoding ( "iso-8859-9" ).GetBytes ( ( string )
>> strBody );
>>
>> // Set the content header length. This must be
>> // done before writing data to the request stream.
>> PUTRequest.ContentLength = bytes.Length;
>>
>> // Get a reference to the request stream.
>> PUTRequestStream = PUTRequest.GetRequestStream ( );
>>
>> // Write the message body to the request stream.
>> PUTRequestStream.Write ( bytes , 0 , bytes.Length );
>>
>> // Close the Stream object to release the connection
>> // for further use.
>> PUTRequestStream.Close ( );
>>
>> // Set the Content-Type header to the RFC 822 message format.
>> PUTRequest.ContentType = "message/rfc822";
>>
>> // PUT the message in the Drafts folder of the
>> // sender's mailbox.
>> PUTResponse = ( HttpWebResponse ) PUTRequest.GetResponse ( );
>> #endregion
>>
>> When the cursor comes to the "PUTResponse = ( HttpWebResponse )
>> PUTRequest.GetResponse ( );" row while i am debugging, after executing,
>> it gives the 409 error.
>>
>> I hope it helps you thanks...
>>
>>
>> "Henning Krause [MVP]" wrote in
>> message news:OLa8a92cGHA.3840@TK2MSFTNGP04.phx.gbl...
>>> Hello,
>>>
>>> a 409 usually indicates that the parent folder does not exist.
>>>
>>> It would help a lot, if you post your code here along with the urls you
>>> use.
>>>
>>> Greetings,
>>> Henning Krause
>>>
>>> "Adam Right" wrote in message
>>> news:%23fg3jn2cGHA.5048@TK2MSFTNGP03.phx.gbl...
>>>> Hi,
>>>>
>>>> I am using HTTPWebRequest to write an email file to exhchange server,
>>>> and using HttpWebResponse. But when webresponse is executed it gives an
>>>> error 409 "remote server returned error". what can be the problem?
>>>> Thanks..
>>>>
>>>
>>>
>>
>>
>
>
date: Tue, 9 May 2006 18:59:55 +0300
author: Adam Right
Re: 409 conflict?
Hello,
are you sure, you are not uploading a file to an url already in use by
another item? Have you tried a different name?
From the MSDN documentaion:
"Cannot PUT a resource if all ancestors do not already exist. [WebDAV]
If versioning is being used and the entity being PUT includes changes to a
resource that conflict with those made by an earlier (third-party) request,
the server might use the 409 response code to indicate that it cannot
complete the request. [HTTP/1.1]"
Greetings,
Henning Krause
"Adam Right" wrote in message
news:Oj5iiE4cGHA.1436@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> Yes i am working in english box. Is there solution for 409 conflict
> problem?
>
>
> "Henning Krause [MVP]" wrote in
> message news:eufGof3cGHA.1204@TK2MSFTNGP02.phx.gbl...
>> Hello,
>>
>> are you working on an english mailbox? The drafts folder is one of the
>> localized folders...
>>
>> Greetings,
>> Henning Krause
>>
>> "Adam Right" wrote in message
>> news:ewLAVV3cGHA.3908@TK2MSFTNGP04.phx.gbl...
>>>
>>> Hi,
>>>
>>> Here is my part of code for sending mail...
>>>
>>> #region MailBox
>>> // Build the mailbox URI.
>>> strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;
>>> #endregion
>>>
>>> #region Gnderen Submission
>>> strSubURI = "http://" + strServer + "/exchange/" + strAlias
>>> + "/##DavMailSubmissionURI##/";
>>> #endregion
>>>
>>> #region Draft
>>> strTempURI = "http://" + strServer + "/exchange/" + strAlias
>>> + "/drafts/" + strSubject + ".eml";
>>> #endregion
>>>
>>> #region Message
>>> strBody = "To: " + strTo + "\n" +
>>> "Cc: " + strToCC + "\n" +
>>> "Subject: " + strSubject + "\n" +
>>> "Date: " + System.DateTime.Now +
>>> "X-Mailer: test mailer" + "\n" +
>>> "MIME-Version: 1.0" + "\n" +
>>> "Content-Type: text/plain;" + "\n" +
>>> "Charset = \"iso-8859-9\"" + "\n" +
>>> "Content-Transfer-Encoding: 7bit" + "\n" +
>>> "\n" + strText;
>>> #endregion
>>>
>>> #region Credentials
>>>
>>> MyCredentialCache = new System.Net.CredentialCache ( );
>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "NTLM" , new
>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Basic" , new
>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Digest" , new
>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>>
>>> #endregion
>>>
>>> #region PUT Message
>>> // Create the HttpWebRequest object.
>>> PUTRequest = ( HttpWebRequest ) HttpWebRequest.Create ( strTempURI );
>>>
>>> // Add the network credentials to the request.
>>> PUTRequest.Credentials = MyCredentialCache;
>>>
>>> // Specify the PUT method.
>>> PUTRequest.Method = "PUT";
>>>
>>> // Encode the body using UTF-8.
>>> bytes = Encoding.GetEncoding ( "iso-8859-9" ).GetBytes ( ( string )
>>> strBody );
>>>
>>> // Set the content header length. This must be
>>> // done before writing data to the request stream.
>>> PUTRequest.ContentLength = bytes.Length;
>>>
>>> // Get a reference to the request stream.
>>> PUTRequestStream = PUTRequest.GetRequestStream ( );
>>>
>>> // Write the message body to the request stream.
>>> PUTRequestStream.Write ( bytes , 0 , bytes.Length );
>>>
>>> // Close the Stream object to release the connection
>>> // for further use.
>>> PUTRequestStream.Close ( );
>>>
>>> // Set the Content-Type header to the RFC 822 message format.
>>> PUTRequest.ContentType = "message/rfc822";
>>>
>>> // PUT the message in the Drafts folder of the
>>> // sender's mailbox.
>>> PUTResponse = ( HttpWebResponse ) PUTRequest.GetResponse ( );
>>> #endregion
>>>
>>> When the cursor comes to the "PUTResponse = ( HttpWebResponse )
>>> PUTRequest.GetResponse ( );" row while i am debugging, after executing,
>>> it gives the 409 error.
>>>
>>> I hope it helps you thanks...
>>>
>>>
>>> "Henning Krause [MVP]" wrote in
>>> message news:OLa8a92cGHA.3840@TK2MSFTNGP04.phx.gbl...
>>>> Hello,
>>>>
>>>> a 409 usually indicates that the parent folder does not exist.
>>>>
>>>> It would help a lot, if you post your code here along with the urls you
>>>> use.
>>>>
>>>> Greetings,
>>>> Henning Krause
>>>>
>>>> "Adam Right" wrote in message
>>>> news:%23fg3jn2cGHA.5048@TK2MSFTNGP03.phx.gbl...
>>>>> Hi,
>>>>>
>>>>> I am using HTTPWebRequest to write an email file to exhchange server,
>>>>> and using HttpWebResponse. But when webresponse is executed it gives
>>>>> an error 409 "remote server returned error". what can be the problem?
>>>>> Thanks..
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
date: Tue, 9 May 2006 20:54:52 +0200
author: Henning Krause [MVP]
Re: 409 conflict?
Hi,
I have tried to change the name of my mail while i was debugging the source
code , but it gave me the same error message. I have read MSDN documentation
that you have send in your mail but i cannot understand it much, because i
have not enough information about exchange server and [webdav], so i do not
know the terminology such as "PUT" or like that.
Can you explain me the case in MSDN documentation? According to the that
case, how can i check my code or exhange server configuration while i am
debugging my code to send an email? Thanks...
"Henning Krause [MVP]" wrote in
message news:O5HzSo5cGHA.3632@TK2MSFTNGP05.phx.gbl...
> Hello,
>
> are you sure, you are not uploading a file to an url already in use by
> another item? Have you tried a different name?
>
> From the MSDN documentaion:
> "Cannot PUT a resource if all ancestors do not already exist. [WebDAV]
> If versioning is being used and the entity being PUT includes changes to a
> resource that conflict with those made by an earlier (third-party)
> request, the server might use the 409 response code to indicate that it
> cannot complete the request. [HTTP/1.1]"
>
> Greetings,
>
> Henning Krause
>
>
> "Adam Right" wrote in message
> news:Oj5iiE4cGHA.1436@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> Yes i am working in english box. Is there solution for 409 conflict
>> problem?
>>
>>
>> "Henning Krause [MVP]" wrote in
>> message news:eufGof3cGHA.1204@TK2MSFTNGP02.phx.gbl...
>>> Hello,
>>>
>>> are you working on an english mailbox? The drafts folder is one of the
>>> localized folders...
>>>
>>> Greetings,
>>> Henning Krause
>>>
>>> "Adam Right" wrote in message
>>> news:ewLAVV3cGHA.3908@TK2MSFTNGP04.phx.gbl...
>>>>
>>>> Hi,
>>>>
>>>> Here is my part of code for sending mail...
>>>>
>>>> #region MailBox
>>>> // Build the mailbox URI.
>>>> strMailboxURI = "http://" + strServer + "/exchange/" + strAlias;
>>>> #endregion
>>>>
>>>> #region Gnderen Submission
>>>> strSubURI = "http://" + strServer + "/exchange/" + strAlias
>>>> + "/##DavMailSubmissionURI##/";
>>>> #endregion
>>>>
>>>> #region Draft
>>>> strTempURI = "http://" + strServer + "/exchange/" + strAlias
>>>> + "/drafts/" + strSubject + ".eml";
>>>> #endregion
>>>>
>>>> #region Message
>>>> strBody = "To: " + strTo + "\n" +
>>>> "Cc: " + strToCC + "\n" +
>>>> "Subject: " + strSubject + "\n" +
>>>> "Date: " + System.DateTime.Now +
>>>> "X-Mailer: test mailer" + "\n" +
>>>> "MIME-Version: 1.0" + "\n" +
>>>> "Content-Type: text/plain;" + "\n" +
>>>> "Charset = \"iso-8859-9\"" + "\n" +
>>>> "Content-Transfer-Encoding: 7bit" + "\n" +
>>>> "\n" + strText;
>>>> #endregion
>>>>
>>>> #region Credentials
>>>>
>>>> MyCredentialCache = new System.Net.CredentialCache ( );
>>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "NTLM" , new
>>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Basic" , new
>>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>>> MyCredentialCache.Add ( new Uri ( strMailboxURI ) , "Digest" , new
>>>> NetworkCredential ( strAlias , strPassword , strDomain ) );
>>>>
>>>> #endregion
>>>>
>>>> #region PUT Message
>>>> // Create the HttpWebRequest object.
>>>> PUTRequest = ( HttpWebRequest ) HttpWebRequest.Create (
>>>> strTempURI );
>>>>
>>>> // Add the network credentials to the request.
>>>> PUTRequest.Credentials = MyCredentialCache;
>>>>
>>>> // Specify the PUT method.
>>>> PUTRequest.Method = "PUT";
>>>>
>>>> // Encode the body using UTF-8.
>>>> bytes = Encoding.GetEncoding ( "iso-8859-9" ).GetBytes ( ( string )
>>>> strBody );
>>>>
>>>> // Set the content header length. This must be
>>>> // done before writing data to the request stream.
>>>> PUTRequest.ContentLength = bytes.Length;
>>>>
>>>> // Get a reference to the request stream.
>>>> PUTRequestStream = PUTRequest.GetRequestStream ( );
>>>>
>>>> // Write the message body to the request stream.
>>>> PUTRequestStream.Write ( bytes , 0 , bytes.Length );
>>>>
>>>> // Close the Stream object to release the connection
>>>> // for further use.
>>>> PUTRequestStream.Close ( );
>>>>
>>>> // Set the Content-Type header to the RFC 822 message format.
>>>> PUTRequest.ContentType = "message/rfc822";
>>>>
>>>> // PUT the message in the Drafts folder of the
>>>> // sender's mailbox.
>>>> PUTResponse = ( HttpWebResponse ) PUTRequest.GetResponse ( );
>>>> #endregion
>>>>
>>>> When the cursor comes to the "PUTResponse = ( HttpWebResponse )
>>>> PUTRequest.GetResponse ( );" row while i am debugging, after executing,
>>>> it gives the 409 error.
>>>>
>>>> I hope it helps you thanks...
>>>>
>>>>
>>>> "Henning Krause [MVP]" wrote in
>>>> message news:OLa8a92cGHA.3840@TK2MSFTNGP04.phx.gbl...
>>>>> Hello,
>>>>>
>>>>> a 409 usually indicates that the parent folder does not exist.
>>>>>
>>>>> It would help a lot, if you post your code here along with the urls
>>>>> you use.
>>>>>
>>>>> Greetings,
>>>>> Henning Krause
>>>>>
>>>>> "Adam Right" wrote in message
>>>>> news:%23fg3jn2cGHA.5048@TK2MSFTNGP03.phx.gbl...
>>>>>> Hi,
>>>>>>
>>>>>> I am using HTTPWebRequest to write an email file to exhchange server,
>>>>>> and using HttpWebResponse. But when webresponse is executed it gives
>>>>>> an error 409 "remote server returned error". what can be the problem?
>>>>>> Thanks..
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
date: Thu, 11 May 2006 13:20:10 +0300
author: Adam Right
|
|