API Developer Token Issue

Newsgator Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



API Developer Token Issue Expand / Collapse
Author
Message
Posted 10/19/2005 11:07:56 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/20/2005 2:27:00 PM
Posts: 4, Visits: 1
I made a simple application that uses the NewsGator API to sync subscriptions and store the feeds on my local server. I was not sending the Developer Token, and as of the update yesterday, the application broke because of this. So, i am in the process of updating the application to use the Developer Token to make all calls to the API.

I have been able to get the GetUpdates() method of the SubscriptionWebService object to work, regardless of the token i set for the object. I am able to call the GetSubscriptionList method, however.

For example, the following code runs fine until the SubSvc.GetUpdates call. Does the GetSubscriptionList not require the API token and the GetUpdates does?


SubSvc.NGAPITokenValue = New com.newsgator.services1.NGAPIToken
SubSvc.NGAPITokenValue.Token = config.NGAPIToken
xe = SubSvc.GetSubscriptionList(config.Location, lastSubUpdate.SyncToken)
arrStr = SubSvc.GetUpdates(config.Location, lastSubUpdate.SyncToken, newToken)

Any suggestions would be appreciated.


Thanks,
Brian



-----------------------------------
Brian
Go BIG Network
Post #8877
Posted 10/19/2005 1:24:58 PM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 125, Visits: 19
Ok, it turns out that GetUpdates isn't reading the token, but it's trying to set up a transaction context which is probably causing it to blow up. Give me a little bit to get this fixed...
Post #8885
Posted 10/19/2005 7:05:13 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/17/2008 4:50:59 PM
Posts: 10, Visits: 8
Yes, I've had much of my work break, also. And I was sending the token, but obviously not doing it corrently. Do you have a sample SOAP request with the developer token embedded in it, so that I can figure out how to make my PHP SOAP call?



Shelley
Post #8899
Posted 10/19/2005 9:11:43 PM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 125, Visits: 19
Here's a live capture from the sample app:

POST /ngws/svc/Subscription.asmx HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2032)
Content-Type: text/xml; ch****t=utf-8
SOAPAction: "http://services.newsgator.com/svc/Subscription.asmx/GetSubscriptionList"
Authorization: Digest username="elaina w",realm="NewsGator Online Services",nonce="MTAvMTkvMjAwNSA5OjAzOjUyIFBN",uri="/ngws/svc/Subscription.asmx",algorithm="MD5",cnonce="3a31a66d0b553801518c5e33c432d63a",nc=00000001,qop="auth",response="fb3e2828a4eda16c3946b6996c3cfe5d",opaque="0000000000000000"
Content-Length: 588
Connection: Keep-Alive
Host: services.newsgator.com

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header>
<NGAPIToken xmlns="http://services.newsgator.com/svc/Subscription.asmx">
<Token>A8A8A9B5DC8240a4B1065C8CE4771074</Token>
</NGAPIToken>
</soap:Header>
<soap:Body>
<GetSubscriptionList xmlns="http://services.newsgator.com/svc/Subscription.asmx">
<location>nggordon</location>
<syncToken>MDEyMDA1LTEwLTE5VDIxOjAyOjAw</syncToken>
</GetSubscriptionList>
</soap:Body>
</soap:Envelope>


I also worked up a simple PHP example at http://www.agileprogrammer.com/eightytwenty/archive/2005/10/18/8745.aspx
I'm sure I violated all sorts of PHP coding rules but it does work. The tricky thing about the API token header is that it takes on the namespace of the web service being called.
Post #8900
Posted 10/20/2005 7:44:06 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/20/2005 2:27:00 PM
Posts: 4, Visits: 1
The issue with GetUpdates is a separate issue, correct? Any ETA on when it might be fixed?

Thanks,
Brian



-----------------------------------
Brian
Go BIG Network
Post #8914
Posted 10/20/2005 9:15:13 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/17/2008 4:50:59 PM
Posts: 10, Visits: 8
Thanks, I've got the tokens working. Sorry to have added an off-topic post.



Shelley
Post #8917
Posted 10/20/2005 11:46:17 AM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 125, Visits: 19
Rawdrib, sorry, forgot to mention that I loaded a fix for GetUpdates around 17:00 MDT yesterday, are you still broken?
Post #8921
Posted 10/20/2005 12:06:38 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/20/2005 2:27:00 PM
Posts: 4, Visits: 1
It wasn't working until i reloaded the Web References in my .NET project. Weird...shouldn't that update automatically if the web service changes?

Thanks for the quick response!



-----------------------------------
Brian
Go BIG Network
Post #8922
Posted 10/20/2005 11:41:01 PM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 125, Visits: 19
Ah, you may have to reload them again, then. I left the Token header declaration off of that method, though it was expecting a token, which is why that method would blow up.
Post #8940
« Prev Topic | Next Topic »