Hi, Could ypu please check by changing your HealthService service = new HealthService(reqFctry.ApplicationName);
with *Service service = new Service(authFactory.Service, authFactory.ApplicationName);* Thanks and Regards, Kanaya On Mon, Oct 11, 2010 at 7:38 PM, CTIS C <[email protected]> wrote: > Hi, All, > > Thanks for pitching in... keeps me going. > > I looked at the .Net error and found that actual errors is... > > *"The remote server returned an error: (401) Unauthorized."* > ** > Any thoughts ? > > Thanks > > On Mon, Oct 11, 2010 at 4:32 AM, Ashwini Shahapurkar < > [email protected]> wrote: > >> Hi, >> >> Following code worked for me. Just try it out and let me know if it works >> for you also. >> >> Entry newNotice = new Entry(); >> newNotice.setTitle(new PlainTextConstruct(subject)); >> newNotice.setContent(new PlainTextConstruct(message)); >> >> if (ccr != null) { >> XmlBlob ccrElement = new XmlBlob(); >> ccrElement.setBlob(ccr); >> newNotice.setXmlBlob(ccrElement); >> } >> createdNotice = healthService.insert(new URL(url), newNotice); >> >> On Mon, Oct 11, 2010 at 11:11 AM, CTISTeam <[email protected]>wrote: >> >>> Hi, All, >>> >>> We are using OAuth to connect to Google Health. We are able to >>> retrieve CCR data. Now when we try to post/insert any new data, we >>> are >>> getting message “Execution of request failed”. >>> >>> >>> Following is code snippet which we have used for posting new episode >>> to Google H9. >>> >>> >>> GOAuthRequestFactory reqFctry = new GOAuthRequestFactory("weaver", >>> "domain-applcaiton-v1"); >>> reqFctry.ConsumerKey = consumerKey; >>> reqFctry.ConsumerSecret = consumerSecret; >>> >>> >>> reqFctry.GAuthToken = GAuthToken; >>> >>> >>> HealthService service = new HealthService(reqFctry.ApplicationName); >>> service.RequestFactory = reqFctry; >>> >>> >>> AtomEntry newNotice = new AtomEntry(); >>> >>> >>> newNotice.Title.Text = "A test message"; >>> newNotice.Content.Content = "This is a test message."; >>> >>> >>> String ccrXmlString ="<ContinuityOfCareRecord xmlns=\"urn:astm- >>> org:CCR >>> \"><Body><Results><Result><Test><Description><Text>Blood Pressure, >>> Diastolic(Lower Number)</Text><Code><Value>18.4248</Value> >>> <CodingSystem>Google</CodingSystem></Code></ >>> Description><TestResult><Value>80</Value><Units><Unit>mmHg</Unit></ >>> Units></TestResult><DateTime><Type><Text>Collection start date</ >>> Text></ >>> Type><ExactDateTime>2010-05-02T07:00:00Z</ExactDateTime></DateTime></ >>> Test></Result><Result><Test><Description><Text>Blood Pressure, >>> Systolic (Upper Number) </Text><Code><Value>18.13801</ >>> Value><CodingSystem>Google</CodingSystem></Code></ >>> Description><TestResult><Value>120</Value><Units><Unit>mmHg</Unit></ >>> Units></TestResult><DateTime><Type><Text>Collection start date</ >>> Text></ >>> Type><ExactDateTime>2007-05-02T07:00:00Z</ExactDateTime> </ >>> DateTime></ >>> Test></Result></Results></Body></ContinuityOfCareRecord>"; >>> >>> >>> XmlDocument ccrDoc = new XmlDocument(); >>> ccrDoc.LoadXml(ccrXmlString); >>> newNotice.ExtensionElements.Add(newXmlExtension(ccrDoc.DocumentElement)); >>> >>> >>> service.Insert(new Uri("https://www.google.com/h9/feeds/profile/ >>> default"), newNotice); >>> >>> >>> So are we missing anything? Any help or guidance will be helpful. >>> >>> Thanks >>> >>> -- >>> 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]<googlehealthdevelopers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/googlehealthdevelopers?hl=en. >>> >>> >> >> >> -- >> Regards, >> >> Ashwini S. >> >> Always remember to be happy because you never know who's falling in love >> with your smile. >> >> >> -- >> 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]<googlehealthdevelopers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/googlehealthdevelopers?hl=en. >> > > -- > 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]<googlehealthdevelopers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/googlehealthdevelopers?hl=en. > -- 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.
