that does not make sense, there must be something missing.....

This is the constructor code for EMail:

        /// <summary>
         /// default constructor for gd:email with an initial value  
for the email
         /// </summary>
         /// <param name="emailAddress">the initial email address</ 
param>
         public EMail(string emailAddress)
         : base(GDataParserNameTable.XmlEmailElement,
                GDataParserNameTable.gDataPrefix,
                GDataParserNameTable.gNamespace)
         {
             addAttributes();
             this.Address = emailAddress;
         }

So this is doing the same as your code... I also just wrote some  
testcode, where i checked this, and:

             EMail email = new EMail("[EMAIL PROTECTED]");
           where i verified that email.Address contains [EMAIL PROTECTED] then.


Frank Mantek
Google
On Apr 28, 2008, at 10:59 AM, Deeraf wrote:

>
> I got the solution,
>
> EMail primaryEmail = new EMail("[EMAIL PROTECTED]");
>
> doesn't set address property of EMail.
> It should be set exclusivley not in constructor like this
>
> EMail primaryEmail = new EMail("[EMAIL PROTECTED]");
> primaryEmail.Address = "[EMAIL PROTECTED]";
>
>
> On Apr 26, 5:03 pm, Deeraf <[EMAIL PROTECTED]> wrote:
>> This exception is occured when i try to run the following code
>> Execution of request 
>> failed:http://www.google.com/m8/feeds/contacts/default/base
>>
>> GAuthSubRequestFactory authFactory = new
>> GAuthSubRequestFactory("cp","GmailTest");
>>             authFactory.Token = (String)Session["token"];
>>             ContactService service = new
>> ContactService(authFactory.ApplicationName);
>>             service.RequestFactory = authFactory;
>>
>>             ContactEntry newEntry = new ContactEntry();
>>             newEntry.Title.Text = "Information";
>>
>>             EMail primaryEmail = new EMail("[EMAIL PROTECTED]");
>>             primaryEmail.Primary = true;
>>             primaryEmail.Rel = ContactsRelationships.IsWork;
>>             newEntry.Emails.Add(primaryEmail);
>>
>>             PhoneNumber phoneNumber = new PhoneNumber("111-111-222");
>>             phoneNumber.Primary = true;
>>             phoneNumber.Rel = ContactsRelationships.IsMobile;
>>             newEntry.Phonenumbers.Add(phoneNumber);
>>
>>             newEntry.Content.Content = "Information Center";
>>
>>             Uri uriFeed = new
>> Uri(ContactsQuery.CreateContactsUri("default"));
>>             ContactEntry createEntry =
>> (ContactEntry)service.Insert(uriFeed, newEntry);
>>
>> Last line is having exception
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to