N
Nostra
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\"?><dropertyupdate
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><drop><c:sn>blabla</c:sn><d:contentclass>urn:content-classeserson</d:contentclass><c:givenName>haha</c:givenName><c:cn>Test
Contact</c:cn><eutlookmessageclass>IPM.Contact</eutlookmessageclass><con:email1addrtype>SMTP</con:email1addrtype><con:email1emailaddress>[email protected]</con:email1emailaddress><g:subject>blabla</g:subject><c:fileas>TestContact</c:fileas><cersonaltitle>Mr.</cersonaltitle><con:email1originaldisplayname>John</con:email1originaldisplayname></drop></d:set></dropertyupdate>"
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.
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\"?><dropertyupdate
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><drop><c:sn>blabla</c:sn><d:contentclass>urn:content-classeserson</d:contentclass><c:givenName>haha</c:givenName><c:cn>Test
Contact</c:cn><eutlookmessageclass>IPM.Contact</eutlookmessageclass><con:email1addrtype>SMTP</con:email1addrtype><con:email1emailaddress>[email protected]</con:email1emailaddress><g:subject>blabla</g:subject><c:fileas>TestContact</c:fileas><cersonaltitle>Mr.</cersonaltitle><con:email1originaldisplayname>John</con:email1originaldisplayname></drop></d:set></dropertyupdate>"
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.