It looks like you might be having the error since you're posting to
the profile feed, and not the register feed.  AuthSub shouldn't be
supported on the profile feed either.

http://code.google.com/apis/health/docs/2.0/reference.html#Authentication

Although it's true that not all feeds and operations support AuthSub/
OAuth (e.g. profile list feed), OAuth is supported where AuthSub is.
There are some caveats, however, in how Health supports OAuth.  The
big ones are as follows:

- H9 and Health support OAuth 1.0, not 1.0a.  There's a post on how to
deal with this in the following thread:

    
http://groups.google.com/group/googlehealthdevelopers/browse_thread/thread/6b2381d1cef17dc8

- Neither H9 or Health support anonymous OAuth, so you'll need to sign
your requests.

- H9 supports HMAC-SHA1 signing (using the consumer secret) and RSA-
SHA1 (using a SSL private key), but Health only supports RSA-SHA1, so
it's good to work with RSA-SHA1 from the beginning.

I hope this helps!

Paul


On Oct 11, 4:47 pm, Bess Ho <[email protected]> wrote:
> OAuth is not completely supporting every API. That is my speculation.
>
>
>
>
>
> On Mon, Oct 11, 2010 at 4:43 PM, CTISTeam <[email protected]> wrote:
> > One more thing...
>
> > When we tried with AuthSub it worked without any issue. But OAuth
> > still a quesiton ?
>
> > On Oct 11, 10:26 am, kanaya bhattad <[email protected]> wrote:
> > > 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]>
> > <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]>
> > <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]>
> > <googlehealthdevelopers%­[email protected]>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/googlehealthdevelopers?hl=en.-Hide
> > quoted text -
>
> > > - Show quoted text -
>
> > --
> > 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.
>
> --
> Bess Ho
> UI Architect / Developer / Designer
> iPhone Developer
> Silicon Valley Web Builder (SVWB) Founder
>
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain CONFIDENTIAL material. If you receive
> this material/information in error, please contact the sender and delete or
> destroy the material/information.

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