Contacts not showing up in the addressbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

we are currently experiencing problems with contacts not showing up in the
addressbook. Al of these contacts were imported from a SQL Server database by
means of a C# application. When we open such a contact, everything seems ok.
When we remove the mail address and/or the displayname and add it again
(simply cut/paste), save the contact, it shows up in the addressbook.

The code which is used to insert the contacts is as follows:

//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 used to create the contact is this:

"<?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>[email protected]</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 tried the "Check Names" option in Outlook, but this doesn't work. We
actually need to change the mail address or displayname to get it to show up.

Is there something we forgot to do?

We are using Outlook 2003 (no Service packs applied... stupid, I know, but
we don't have anything to say in this...)


Thanks.
 
Importing Contacts will frequently fail to resolve the email addresses.
Addresses will not show up in the Address Book until they are resolved.
You should ask your question in a programming group to see if someone knows
how to write code that will resolve electronic addresses as you import them.
--
Russ Valentine
[MVP-Outlook]
Hi,

we are currently experiencing problems with contacts not showing up in the
addressbook. Al of these contacts were imported from a SQL Server database
by
means of a C# application. When we open such a contact, everything seems
ok.
When we remove the mail address and/or the displayname and add it again
(simply cut/paste), save the contact, it shows up in the addressbook.

The code which is used to insert the contacts is as follows:

//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 used to create the contact is this:

"<?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>[email protected]</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 tried the "Check Names" option in Outlook, but this doesn't work. We
actually need to change the mail address or displayname to get it to show
up.

Is there something we forgot to do?

We are using Outlook 2003 (no Service packs applied... stupid, I know, but
we don't have anything to say in this...)


Thanks.
 
Back
Top