|
exchange
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Webdav Put 200I am using the below attached code to copy messages from a Public Folder to a General Purpose Public Folder by using the Webdav and the Get and Put methode, I have noticed that messages with the Status of 201 are sucessfully created by the ones with the status of 200 are not created, why am I encountering such a behavior? Dim oXMLHttp As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30 Dim oXMLHttpPut As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30 Dim sDestinationUrl As String sDestinationUrl = sUrlTo & Mid(sSourceUrl, 42) Try oXMLHttp.open("GET", sSourceUrl, False, strDomain & "\" & strUserName, strPassword) oXMLHttp.setRequestHeader("Translate", "f") oXMLHttp.setRequestHeader("Content-Type", "message/rfc822") oXMLHttp.send(Missing.Value) If oXMLHttp.status <> "201" And oXMLHttp.status <> "200" And oXMLHttp.status <> "207" Then 'MsgBox("Error occurrd in CreateItem from the Get function. URI = " + sSourceUrl + " Error Status " + oXMLHttp.status + " Status Text " + oXMLHttp.statusText + " ResponseText " + oXMLHttp.responseText) End If 'Write stream received to new file in the destination folder oXMLHttpPut.open("PUT", sDestinationUrl, False, strDomain & "\" & strUserName, strPassword) oXMLHttpPut.setRequestHeader("Translate", "f") 'Commenting out to try and get contacts to be written correctly oXMLHttpPut.setRequestHeader("Content-Type", "message/rfc822") 'MsgBox(oXMLHttp.responseText) oXMLHttpPut.send(oXMLHttp.responseText) Dim statusPut As Integer statusPut = oXMLHttpPut.status If oXMLHttpPut.status <> "201" Then 'And oXMLHttpPut.status <> "200" Then 'MsgBox("Error occurrd in CreateItem from the PUT function. URI = Error Status " + oXMLHttpPut.status + " Status Text " + oXMLHttpPut.statusText) '+ " ResponseText " + oXMLHttpPut.responseText Else txtStatus.Text = "From: " & sSourceUrl & Chr(13) & Chr(10) & "To: " & sDestinationUrl & Chr(13) & Chr(10) & Chr(13) & Chr(10) & txtStatus.Text ' Open the source item. oXMLHttp.open("DELETE", sSourceUrl, False, strDomain & "\" & strUserName, strPassword) ' Send the query. oXMLHttp.send() End If Regards It might be worth searching www.microsoft.com/msdn for clues.
Show quote "Yahya" <x@x.x> wrote in message news:eCpAYPNVGHA.5808@TK2MSFTNGP12.phx.gbl... > Dear Sirs, > > I am using the below attached code to copy messages from a Public Folder > to > a General Purpose Public Folder by using the Webdav and the Get and Put > methode, I have noticed that messages with the Status of 201 are > sucessfully > created by the ones with the status of 200 are not created, why am I > encountering such a behavior? > > > Dim oXMLHttp As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30 > > Dim oXMLHttpPut As MSXML2.XMLHTTP30 = New MSXML2.XMLHTTP30 > > Dim sDestinationUrl As String > > sDestinationUrl = sUrlTo & Mid(sSourceUrl, 42) > > Try > > oXMLHttp.open("GET", sSourceUrl, False, strDomain & "\" & strUserName, > strPassword) > > oXMLHttp.setRequestHeader("Translate", "f") > > oXMLHttp.setRequestHeader("Content-Type", "message/rfc822") > > oXMLHttp.send(Missing.Value) > > If oXMLHttp.status <> "201" And oXMLHttp.status <> "200" And > oXMLHttp.status > <> "207" Then > > 'MsgBox("Error occurrd in CreateItem from the Get function. URI = " + > sSourceUrl + " Error Status " + oXMLHttp.status + " Status Text " + > oXMLHttp.statusText + " ResponseText " + oXMLHttp.responseText) > > End If > > 'Write stream received to new file in the destination folder > > oXMLHttpPut.open("PUT", sDestinationUrl, False, strDomain & "\" & > strUserName, strPassword) > > oXMLHttpPut.setRequestHeader("Translate", "f") > > 'Commenting out to try and get contacts to be written correctly > > oXMLHttpPut.setRequestHeader("Content-Type", "message/rfc822") > > 'MsgBox(oXMLHttp.responseText) > > oXMLHttpPut.send(oXMLHttp.responseText) > > Dim statusPut As Integer > > statusPut = oXMLHttpPut.status > > If oXMLHttpPut.status <> "201" Then 'And oXMLHttpPut.status <> "200" Then > > 'MsgBox("Error occurrd in CreateItem from the PUT function. URI = Error > Status " + oXMLHttpPut.status + " Status Text " + oXMLHttpPut.statusText) > '+ > " ResponseText " + oXMLHttpPut.responseText > > Else > > txtStatus.Text = "From: " & sSourceUrl & Chr(13) & Chr(10) & "To: " & > sDestinationUrl & Chr(13) & Chr(10) & Chr(13) & Chr(10) & txtStatus.Text > > ' Open the source item. > > oXMLHttp.open("DELETE", sSourceUrl, False, strDomain & "\" & strUserName, > strPassword) > > ' Send the query. > > oXMLHttp.send() > > End If > > > > Regards > > "Yahya" <x@x.x> wrote in message You may be getting the 200 status if the server has FBA enabled, andnews:eCpAYPNVGHA.5808@TK2MSFTNGP12.phx.gbl... > Dear Sirs, > > I am using the below attached code to copy messages from a Public Folder to > a General Purpose Public Folder by using the Webdav and the Get and Put > methode, I have noticed that messages with the Status of 201 are sucessfully > created by the ones with the status of 200 are not created, why am I > encountering such a behavior? is just returning the FBA logon page to your application. Lee. -- _______________________________________ Outlook Web Access For PDA , OWA For WAP www.owapda.com email a@t leederbyshire d.0.t c.0.m _______________________________________ Dear Lee,
Yes, I am receiving the 200 status when messages are not created, also I noticed a strange behavior where some of the messages created have wrong contacts, not as they were copied from. Regards Show quote "Lee Derbyshire" wrote: > "Yahya" <x@x.x> wrote in message > news:eCpAYPNVGHA.5808@TK2MSFTNGP12.phx.gbl... > > Dear Sirs, > > > > I am using the below attached code to copy messages from a Public > Folder to > > a General Purpose Public Folder by using the Webdav and the Get and > Put > > methode, I have noticed that messages with the Status of 201 are > sucessfully > > created by the ones with the status of 200 are not created, why am I > > encountering such a behavior? > > You may be getting the 200 status if the server has FBA enabled, and > is just returning the FBA logon page to your application. > > Lee. > > -- > _______________________________________ > > Outlook Web Access For PDA , OWA For WAP > www.owapda.com > email a@t leederbyshire d.0.t c.0.m > _______________________________________ > > > "Yahya" <Ya***@discussions.microsoft.com> wrote in message created, also Inews:1B31EF1A-BE8B-48EE-AE8F-13165D3A426F@microsoft.com... > Dear Lee, > > Yes, I am receiving the 200 status when messages are not > noticed a strange behavior where some of the messages created have Come to think of it, wouldn't it be easier to use MOVE ?wrong > contacts, not as they were copied from. > > Regards Lee. I tried the Move, but since I am moving messages from Public Folders to
General Purpose Exchange folders I think I am not succeeding. Regards, Yahya Show quote "Lee Derbyshire" <email a@t leederbyshire d.0.t c.0.m> wrote in message news:%23XZGnXXWGHA.1196@TK2MSFTNGP03.phx.gbl... > "Yahya" <Ya***@discussions.microsoft.com> wrote in message > news:1B31EF1A-BE8B-48EE-AE8F-13165D3A426F@microsoft.com... > > Dear Lee, > > > > Yes, I am receiving the 200 status when messages are not > created, also I > > noticed a strange behavior where some of the messages created have > wrong > > contacts, not as they were copied from. > > > > Regards > > Come to think of it, wouldn't it be easier to use MOVE ? > > Lee. > > "Yahya" <x@x.x> wrote in message I think you said in your first post that your General Purpose foldernews:u62%23zhiWGHA.2372@TK2MSFTNGP05.phx.gbl... > I tried the Move, but since I am moving messages from Public Folders to > General Purpose Exchange folders I think I am not succeeding. > > Regards, > Yahya was also a Public Folder. If it is on the same server, then there should not be a problem with the MOVE. Lee. -- _______________________________________ Outlook Web Access For PDA , OWA For WAP www.owapda.com email a@t leederbyshire d.0.t c.0.m _______________________________________ Sorry for not being clear,
the messages are read from a public folder on server1 and being written to a general purpose folder on server2. Thanks, Yahya Show quote "Lee Derbyshire" <email a@t leederbyshire d.0.t c.0.m> wrote in message news:%23qEUkwjWGHA.4132@TK2MSFTNGP04.phx.gbl... > "Yahya" <x@x.x> wrote in message > news:u62%23zhiWGHA.2372@TK2MSFTNGP05.phx.gbl... > > I tried the Move, but since I am moving messages from Public Folders > to > > General Purpose Exchange folders I think I am not succeeding. > > > > Regards, > > Yahya > > I think you said in your first post that your General Purpose folder > was also a Public Folder. If it is on the same server, then there > should not be a problem with the MOVE. > > Lee. > > -- > _______________________________________ > > Outlook Web Access For PDA , OWA For WAP > www.owapda.com > email a@t leederbyshire d.0.t c.0.m > _______________________________________ > > "Yahya" <x@x.x> wrote in message written to anews:%23ijnE9jWGHA.4580@TK2MSFTNGP04.phx.gbl... > Sorry for not being clear, > the messages are read from a public folder on server1 and being > general purpose folder on server2. Okay. That's much trickier, as you discovered. What is the Response> > Thanks, > Yahya Text from the server when you get the 200 status returned? The Status is 200 and the status text is "OK"
Show quote "Lee Derbyshire" <email a@t leederbyshire d.0.t c.0.m> wrote in message news:uiO1cPkWGHA.1564@TK2MSFTNGP03.phx.gbl... > "Yahya" <x@x.x> wrote in message > news:%23ijnE9jWGHA.4580@TK2MSFTNGP04.phx.gbl... > > Sorry for not being clear, > > the messages are read from a public folder on server1 and being > written to a > > general purpose folder on server2. > > > > Thanks, > > Yahya > > Okay. That's much trickier, as you discovered. What is the Response > Text from the server when you get the 200 status returned? > > "Yahya" <x@x.x> wrote in message How about the Response Text, though (different to the Status Text).news:OhcFJWkWGHA.4768@TK2MSFTNGP05.phx.gbl... > The Status is 200 and the status text is "OK" Is there anything interesting in there? I think that since I have messages with the same URL in the General Folder
it is giving me this message, do you think I should try to make the URL unique? Show quote "Lee Derbyshire" <email a@t leederbyshire d.0.t c.0.m> wrote in message news:%23VBmRokWGHA.1192@TK2MSFTNGP03.phx.gbl... > "Yahya" <x@x.x> wrote in message > news:OhcFJWkWGHA.4768@TK2MSFTNGP05.phx.gbl... > > The Status is 200 and the status text is "OK" > > How about the Response Text, though (different to the Status Text). > Is there anything interesting in there? > > "Yahya" <x@x.x> wrote in message URLs for new items should always be unique (I always add a randomnews:uy9jmskWGHA.4148@TK2MSFTNGP03.phx.gbl... > I think that since I have messages with the same URL in the General Folder > it is giving me this message, do you think I should try to make the URL > unique? number in the URL somewhere). I would not have expected a 200 response, though, in the case of a conflict. Do you think this is the cause of the conflict?
Show quote "Lee Derbyshire" <email a@t leederbyshire d.0.t c.0.m> wrote in message news:%23Guoq$kWGHA.3440@TK2MSFTNGP02.phx.gbl... > "Yahya" <x@x.x> wrote in message > news:uy9jmskWGHA.4148@TK2MSFTNGP03.phx.gbl... > > I think that since I have messages with the same URL in the General > Folder > > it is giving me this message, do you think I should try to make the > URL > > unique? > > URLs for new items should always be unique (I always add a random > number in the URL somewhere). I would not have expected a 200 > response, though, in the case of a conflict. > > |
|||||||||||||||||||||||