LearnItFirst User Forum

New SQL Server 2008 DBA Course
Welcome Guest Search | New Posts | Members | Log In | Register

¿Is it possible to create a contact in Exchange 2007 with webdav operations? Options
shades_80
Posted: Tuesday, October 14, 2008 11:53:30 AM

Rank: Newbie

Joined: 10/14/2008
Posts: 1
Points: 3
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"Wink
objRequest.setRequestHeader("Translate", "f"Wink
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:x=""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>@@Nombre@@</c:givenName>" & _
"<c:middlename></c:middlename>" & _
"<c:sn>@@ApellidoPaterno@@ @@ApellidoMaterno@@</c:sn>" & _
"<c:cn>@@Nombre@@ @@ApellidoPaterno@@ @@ApellidoMaterno@@</c:cn>" & _
"<mail:subject>@@Nombre@@ @@ApellidoPaterno@@</mail:subject>" & _
"<c:fileas>@@ApellidoPaterno@@ @@ApellidoMaterno@@, @@Nombre@@</c:
fileas>" & _
"<c:initials></c:initials>" & _
"<c:nickname></c:nickname>" & _
"<cStick out tongueersonaltitle>@@Tratamiento@@</cStick out tongueersonaltitle>" & _
"<c:namesuffix></c:namesuffix>"

' Put it all together in an HTTP request.
strBody = "<?xml version=""1.0""?>" & _
"<gStick out tongueropertyupdate " & strXMLNSInfo & _
"<g:set>" & _
"<gStick out tonguerop>" & _
"<g:contentclass>urn:content-classesStick out tongueerson</g:
contentclass>" & _
"<eEmbarrassmentutlookmessageclass>IPM.Contact</e:
outlookmessageclass>" & _
strNameInfo & _
"</gStick out tonguerop>" & _
"</g:set>" & _
"</gStick out tongueropertyupdate>"

' 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.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.