hi

Using .Net as a client tesktop application i am trying to get some
records from the sand box(using h9)
when calling the service.Query method i am getting an exception:
"Token invalid - Invalid AuthSub token.
Error 401"
Am i doing something wrong? do i need to register a domain although I
am trying to access
to sand box from a client desktop application?

here is the code i wrote




            GAuthSubRequestFactory authFactory = new
GAuthSubRequestFactory("weaver", "exampleCo-exampleApp-1");

            HealthService service = new HealthService("exampleCo-
exampleApp-1");

            service.RequestFactory = authFactory;
            service.setUserCredentials(<Email>, <Password>);

            string token = service.QueryAuthenticationToken();
             HealthQuery profileQuery = new HealthQuery("https://
www.google.com/h9/feeds/profile/default");
            profileQuery.Digest = true;
                       try
                {
// ******** HERE IS THE EXCEPTION
                    HealthFeed feed = service.Query(profileQuery);
//********
                    foreach (HealthEntry entry in feed.Entries)
                    {
                        XmlNode ccr = (XmlExtension)
entry.FindExtension("ContinuityOfCareRecord", "urn:astm-org:CCR");
                        if (ccr != null)
                            {
                                StringWriter sw = new StringWriter();
                                XmlTextWriter xw = new XmlTextWriter
(sw);
                                xw.Formatting = Formatting.Indented;
                                ccr.WriteTo(xw);
                                Console.WriteLine(sw.ToString
());
                            }
                    }
                }
                catch (GDataRequestException e)
                {

                }

thnks,

Erez

--~--~---------~--~----~------------~-------~--~----~
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