Hi everyone..

I got the fruit of my work. I am able to get the list of user profiles
using ClientLogin Authentication with the following code:-

            Dim req As String
            Dim httpreq As HttpWebRequest
            Dim httpres As HttpWebResponse
req = "https://www.google.com/accounts/ClientLogin?
accountType=HOSTED_OR_GOOGLE&[email protected]&Passwd=yourpassword&service=weaver&source=exampleCo-
exampleApp-1"

            httpreq = CType(HttpWebRequest.Create(req),
HttpWebRequest)
            httpres = CType(httpreq.GetResponse(), HttpWebResponse)
            Dim stream As Stream = httpres.GetResponseStream()
            Dim streamReader As New StreamReader(stream)
            Dim serverresponse As String = streamReader.ReadToEnd()
            Dim arrayofstrings() As String = serverresponse.Split("=")
            Dim auth As String = arrayofstrings(arrayofstrings.Length
- 1)

            Dim service As New HealthService("exampleCo-exampleApp-1")
            service.SetAuthenticationToken(auth)

            Dim profilelist As New HealthQuery("https://www.google.com/
h9/feeds/profile/list")
            Dim feed As HealthFeed = service.Query(profilelist)

            For Each entry As HealthEntry In feed.Entries
                Dim profileTitle As String = entry.Title.Text
            Next


Regards
-- Palli

palli wrote:
> Further research into the topic revealed that the ProfileList feed is
> only available with ClientLogin authentication process.
>
> Correct ?
>
>
>
>
> Thanks & Regards
>
> -- Palli
>
> On May 7, 6:53 pm, palli <[email protected]> wrote:
> > Hi all..
> >
> > I am using the below code to retrieve the feed containing list of user
> > profiles.
> >
> > Dim authFactory As New GAuthSubRequestFactory("weaver", "exampleCo-
> > exampleApp-1")
> >        Dim singleUseToken As String
> >        singleUseToken = Request.QueryString("token")
> >          Dim sessionToken As String
> > sessionToken = Convert.ToString(AuthSubUtil.exchangeForSessionToken
> > (singleUseToken, Nothing))
> >
> >             authFactory.Token = sessionToken
> >             Dim service As New HealthService
> > (authFactory.ApplicationName)
> >             service.RequestFactory = authFactory
> >             Dim profilelist As New HealthQuery("https://www.google.com/
> > h9/feeds/profile/list")
> >             Dim feed As HealthFeed = service.Query(profilelist)
> >
> > But i am getting an error
> > Execution of request failed:https://www.google.com/h9/feeds/profile/list
> >
> > Please suggest what i am missing..
> >
> > Thanks
> > -- Palli
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" 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/googlehealthdevelopers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to