Contacts not showing in addressbook after importing

Contacts not showing in addressbook after importing

Post by Tm9zdHJ » Thu, 20 Oct 2005 22:08:07


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.
 
 
 

Contacts not showing in addressbook after importing

Post by Glen Scale » Fri, 21 Oct 2005 09:39:36

To make the contact appear in the address book view you need to set the
http://www.yqcomputer.com/

Also make sure you have set the urn:schemas:contacts:fileas and
urn:schemas:httpmail:subject properties as these also affect how the contact
will appear in the address book.

Cheers
Glen

 
 
 

Contacts not showing in addressbook after importing

Post by Tm9zdHJ » Fri, 21 Oct 2005 16:50:01

len... this appears a partial solution.

I added the property below but then it didn't work either. So I looked
around on the internet looking for usages of emaillisttype property and found
a post on a forum (http://www.adminlife.com/247reference/msgs/4/24041.aspx)
where they use another property which needs to be set...
The http://schemas.microsoft.com/mapi/fileunder property.

After adding this as well... the contact is listed in the addressbook.

But thanks for the answer Glen. Without this, I wouldn't have stumbled upon
the solution.

"Glen Scales [MVP]" wrote: