Home All Groups Group Topic Archive Search About
Author
31 Mar 2006 3:00 PM
Yahya
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

Author
3 Apr 2006 12:17 PM
Andrew Sword [MVP]
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
>
>
Author
3 Apr 2006 1:45 PM
Lee Derbyshire
"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
_______________________________________
Author
6 Apr 2006 7:25 AM
Yahya
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
> _______________________________________
>
>
>
Author
6 Apr 2006 12:30 PM
Lee Derbyshire
"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.
Author
7 Apr 2006 9:48 AM
Yahya
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.
>
>
Author
7 Apr 2006 12:09 PM
Lee Derbyshire
"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
_______________________________________
Author
7 Apr 2006 12:31 PM
Yahya
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
> _______________________________________
>
>
Author
7 Apr 2006 1:04 PM
Lee Derbyshire
"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?
Author
7 Apr 2006 1:16 PM
Yahya
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?
>
>
Author
7 Apr 2006 1:49 PM
Lee Derbyshire
"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?
Author
7 Apr 2006 1:57 PM
Yahya
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?
>
>
Author
7 Apr 2006 2:31 PM
Lee Derbyshire
"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.
Author
7 Apr 2006 4:02 PM
Yahya
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.
>
>
Author
7 Apr 2006 5:23 PM
Lee Derbyshire
"Yahya" <x@x.x> wrote in message
news:emCJtylWGHA.4452@TK2MSFTNGP04.phx.gbl...
> Do you think this is the cause of the conflict?

I think that there is a very good chance, yes.  To make sure, you would have
to see if you get the same problem when all your URLs are definitely unique.

AddThis Social Bookmark Button