Contacts not showing in addressbook after importing
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Contacts not showing in addressbook after importing

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Nostra
Guest





Posted: Wed Oct 19, 2005 4:58 pm    Post subject: Contacts not showing in addressbook after importing Reply with quote

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://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/\"
xmlns:g=\"urn:schemas:httpmail:\" xmlns:d=\"DAV:\"
xmlns:e=\"http://schemas.microsoft.com/exchange/\"
xmlns:j=\"urn:schemas:mailheader:\" xmlns:x=\"xml:\"
xmlns:con=\"http://schemas.microsoft.com/mapi/\"
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>john.doe@dummy.be</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.

Back to top
Glen Scales [MVP]
Guest





Posted: Thu Oct 20, 2005 12:59 am    Post subject: Re: Contacts not showing in addressbook after importing Reply with quote

To make the contact appear in the address book view you need to set the
http://schemas.microsoft.com/mapi/emaillisttype property to 1

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

"Nostra" <Nostra@discussions.microsoft.com> wrote in message
news:2998BBD6-EBB8-4792-94D8-F6F7F8036888@microsoft.com...
Quote:
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://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/\"
xmlns:g=\"urn:schemas:httpmail:\" xmlns:d=\"DAV:\"
xmlns:e=\"http://schemas.microsoft.com/exchange/\"
xmlns:j=\"urn:schemas:mailheader:\" xmlns:x=\"xml:\"
xmlns:con=\"http://schemas.microsoft.com/mapi/\"
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>john.doe@dummy.be</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.
Back to top
Nostra
Guest





Posted: Thu Oct 20, 2005 8:58 am    Post subject: Re: Contacts not showing in addressbook after importing Reply with quote

Glen... 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:

Quote:
To make the contact appear in the address book view you need to set the
http://schemas.microsoft.com/mapi/emaillisttype property to 1

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

"Nostra" <Nostra@discussions.microsoft.com> wrote in message
news:2998BBD6-EBB8-4792-94D8-F6F7F8036888@microsoft.com...
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://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/\"
xmlns:g=\"urn:schemas:httpmail:\" xmlns:d=\"DAV:\"
xmlns:e=\"http://schemas.microsoft.com/exchange/\"
xmlns:j=\"urn:schemas:mailheader:\" xmlns:x=\"xml:\"
xmlns:con=\"http://schemas.microsoft.com/mapi/\"
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>john.doe@dummy.be</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.





Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

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




Windows Server Dedicated Servers
New Topics Powered by phpBB