Hi,
we are experiencing problems with contacts after we imported them into
Exchange. They show up in the Contacts folder in Outlook but they don't
appear in the Addressbook. Only the manually created contacts are listed.
The code we use to import the contacts:
//prep request
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(Url + "/" + File);
Request.ContentType = "text/xml";
Request.Method = "PROPPATCH";
//proxy
Request.Proxy = _Proxy;
//set named credentails
if(_IsDefaultSecurity)
Request.Credentials = CredentialCache.DefaultCredentials;
else
{
CredentialCache Cache = new CredentialCache();
Cache.Add(new Uri(Url), _Security, _Credential);
Request.Credentials = Cache;
}
//encode the body using UTF-8
byte[] bytes = null;
bytes = Encoding.UTF8.GetBytes((string)XmlData);
Request.ContentLength = bytes.Length;
//get request stream.
Stream Data = Request.GetRequestStream();
//inject data into request
Data.Write(bytes, 0, bytes.Length);
//release connection
Data.Close();
The data which is sent in the request (for testing purposes, we have a
testing program which imports 1 contact, so the data only contains 1 contact):
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><d:propertyupdate
xmlns:cal=\"urn:schemas:calendar:\"
xmlns:mapi=\"
http://www.yqcomputer.com/ {00062003-0000-0000-C000-000000000046}/\"
xmlns:g=\"urn:schemas:httpmail:\" xmlns:d=\"DAV:\"
xmlns:e=\"
http://www.yqcomputer.com/ \"
xmlns:j=\"urn:schemas:mailheader:\" xmlns:x=\"xml:\"
xmlns:con=\"
http://www.yqcomputer.com/ \"
xmlns:b=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\"
xmlns:c=\"urn:schemas:contacts:\"><d:set><d:prop><c:sn>blabla</c:sn><d:contentclass>urn:content-classes:person</d:contentclass><c:givenName>haha</c:givenName><c:cn>Test
Contact</c:cn><e:outlookmessageclass>IPM.Contact</e:outlookmessageclass><con:email1addrtype>SMTP</con:email1addrtype><con:email1emailaddress> XXXX@XXXXX.COM </con:email1emailaddress><g:subject>blabla</g:subject><c:fileas>TestContact</c:fileas><c:personaltitle>Mr.</c:personaltitle><con:email1originaldisplayname>John</con:email1originaldisplayname></d:prop></d:set></d:propertyupdate>"
We can force the contact to be listed in the addressbook, but therefore we
need to change the email-address or displayname manually. So, I think it
should have something to do with the resolving of the mail-address...
We are using C# as programming language, Exchange Server 2000 and Outlook
2003.
TIA.