Announcement

Collapse
No announcement yet.

żIs it possible to create a contact in Exchange 2007 with webdav operations?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • żIs it possible to create a contact in Exchange 2007 with webdav operations?

    Hello!

    I wrote an application in vb.net (2005) to create contacts in Exchange 2000,
    unfortunately the same code doesn't work in Exchange 2007. Then, I copy the
    lines with indications which work fine against Exchange 2000:

    Dim objRequest As New MSXML.XMLHTTPRequest

    ' Open the request object, assigning it the method PROPPATCH.
    ' WHERE
    ' strURL = "http://192.1.1.134/public/contactos/i00001_10709.eml"
    objRequest.open("PROPPATCH", strURL.ToString, False, usuarioEX.ToString,
    passwordEX.ToString)

    ' Set the necessary headers for the request.
    objRequest.setRequestHeader("Content-Type", "text/xml")
    objRequest.setRequestHeader("Translate", "f")
    objRequest.setRequestHeader("Content-Length", Len(strBody))

    ' Specify the namespaces to be used.
    strXMLNSInfo = "xmlns:g=""DAV:"" " & _
    "xmlns:c=""urn:schemas:contacts:"" " & _
    "xmlns:e=""http://schemas.microsoft.com/exchange/"" " & _
    "xmlns:mapi=""http://schemas.microsoft.com/mapi/"" " & _
    "xmlns=""xml:"" xmlns:cal=""urn:schemas:calendar:"" " & _
    "xmlns:mail=""urn:schemas:httpmail:"">"

    ' Specify the contact's name information .... First Name, Middle Name, Last
    Name, etc
    strNameInfo = "<c:givenName>@@[email protected]@</c:givenName>" & _
    "<c:middlename></c:middlename>" & _
    "<c:sn>@@[email protected]@ @@[email protected]@</c:sn>" & _
    "<c:cn>@@[email protected]@ @@[email protected]@ @@[email protected]@</c:cn>" & _
    "<mail:subject>@@[email protected]@ @@[email protected]@</mail:subject>" & _
    "<c:fileas>@@[email protected]@ @@[email protected]@, @@[email protected]@</c:
    fileas>" & _
    "<c:initials></c:initials>" & _
    "<c:nickname></c:nickname>" & _
    "<cersonaltitle>@@[email protected]@</cersonaltitle>" & _
    "<c:namesuffix></c:namesuffix>"

    ' Put it all together in an HTTP request.
    strBody = "<?xml version=""1.0""?>" & _
    "<gropertyupdate " & strXMLNSInfo & _
    "<g:set>" & _
    "<grop>" & _
    "<g:contentclass>urn:content-classeserson</g:
    contentclass>" & _
    "<eutlookmessageclass>IPM.Contact</e:
    outlookmessageclass>" & _
    strNameInfo & _
    "</grop>" & _
    "</g:set>" & _
    "</gropertyupdate>"

    ' Send the request, using the XML document as the body.
    objRequest.send(strBody)

    ' Display the results.
    If (objRequest.status >= 200 And objRequest.status < 300) Then
    ToolStripStatusLabel1.Text = "Status: Ok. "
    .............................
    ..................
    ........

    After the send method is executed when the application runs against Exchange
    2000 the objRequest status is 207 (GOOD) but is 501 (Not Implemented) when
    the application runs against Exchange 2007. The value assigned to the
    variable strURL in the trial with Exchange 2007 is "
    http://192.1.1.124/owa/i00001_10709.eml" The objective is the same that it
    was in Exchange 2000, create a contact in a public folder called contactos.

    żIs it possible to create a contact in Exchange 2007 with the webdav
    operations that I am using?
    If yes, żDoes anybody know what i have to correct?

    Also, I believe that there is something wrong in the url used in the trial
    with Exchange 2007 because it doesn't specify where the contact should be
    created (in the public folder called contactos). It was difficult for me to
    establish the url to create the contact in Exchange 20007, because "
    http://192.1.1.124/owa/#" was the url showed for many windows while I was
    sailing in OWA 2007.

    żDoes anybody know the specific url that I should use to create a contact in
    Exchange 20007 (in a public folder called contactos)?


    Thanks in advance.

    Memo.
Working...
X