After that last post, and the response that I got to it, I did some more work. After re-downloading the NewsGator WSDL (defined) files, my next problem (where nothing got returned by a function… error or result) was fixed. Apparently the original WSDL file didn’t document this function. I’m not sure whether it was truly added after the fact entirely, or if the WSDL file simply hadn’t included it.
If you know anything about this stuff, you may be wondering why I’m not using the WSDL files stored on NewsGator’s server. Welp, here’s the reason:
[faultcode] => soap:Client
[faultstring] => Server did not recognize the value of HTTP Header SOAPAction: .
Uhhh… All I did was switch the WSDL URL to your server. I switch it back to the one located on my localhost and hit F5 and it all works perfectly… So that’s problem one. I’m not really sure if I can blame NG here or not, since I’m honestly not totally familiar with all this WSDL stuff and don’t have the time or desire to learn enough about it to post the blame.
Next is an actual problem with their code that I know (98% possitive) I can blame on NG, this time with the AddSubscription function:
[faultcode] => soap:Server
[faultstring] => Object reference not set to an instance of an object. — > Object reference not set to an instance of an object.
Now this is one I’ve yet to see… Last time I got a more meaningful error telling me which parameter was expected and not provided. This time I’m left scratching my head, wondering what the hell I did wrong… Only, I didn’t do anything wrong. According to their documentation:
int AddSubscription(xmlUrl, folderId, cred)
This call adds a subscription to the url given, adding it to the specified folder and attaching credentials to the subscription. These credentials are submitted to the server when NewsGator Online downloads the xmlUrl. xmlUrl should point to a syndicated feed in RSS or Atom format.
The URL of a syndicated feed (in RSS or Atom format) that you want to subscribe to.
The ID of a folder in the My Feeds hierarchy to put the subscription in.
A credential structure describing the authentication required to access xmlUrl. You can omit this parameter for unsecured feeds.
Well, we’ll ignore for the moment that I’m left guessing what format they want the “credential structure” to be in. The point is, I’ve specified the xmlUrl (http://chrismeller.com/feed/ - this blog’s RSS 2.0 feed, which is actually present in my non-test NG account) and folderId (124017 - a folder called “wordpress” that was created when I imported my OPML file from FeedLounge for testing this API). Since it’s a totally public feed, I haven’t specified cred (not to mention I wouldn’t know HOW if it were private), but even when it’s actually passed as the structure I’ve guessed (username = username, password = password), nothing changes.
Now let’s add to this a 3rd point. Even after my interaction with NewsGator after the last post, they didn’t update all the documentation to reflect the changes made:
XmlElement GetSubscriptionList(location, syncToken)
Returns the user’s subscriptions, including the folder hierarchy defined in NewsGator Online, for the specified locationName (NOT location ID), using the syncToken as advice for generating synchronization information on the server.
The emphasis is mine, and shows the error that still exists. Didn’t we just establish that the name of the parameter is actually “location” (not “locationName”), which implies that they actually do want the ID, and NOT the location name? Incidently, both name and ID still work (as I just tested). In all fairness, he did say he would have these changes to the backend “loaded soon”, which may not have been done yet.
Let’s not forget that one last significant problem either… NG requires that you register your project and obtain a unique API token to identify it every time it hits the NG server. Unfortunately, their server doesn’t appear to actually CHECK for this token. It wasn’t until last night that I finally added the API Token SOAP header to my code, since everything had worked since I first started testing without it.
Welp, there it is folks. That’s my gripe with NG right now. I love their products, but it doesn’t seem that they’ve got all their ducks in a row with this API release. Unfortunately, I don’t seem to be having the same luck that some others (last paragraph) are with this API (I didn’t see a comment from Greg Reinacker, the NG founder, on my last post, did anyone else?). Instead, mine appears to be much more along the lines of that which had been anticipated.
Honestly, I think this API would be great, if the documentation were correct. Unfortunately, I’ve been left guessing at which parameters and exactly what they wanted for functions far too many times as I’ve been writing my PHP class to interact with it thus far.
By the way Greg, I’d really like to enter your API developer competition and have a chance at that kick-ass PowerBook, but at this rate I’ll never make the November 11th deadline… at least not of ‘05. After coding the API interaction class for PHP, I’ve still got to actually write the rest of the code for my project (unless of course you think the PHP class in itself would merrit submission)!
Got a comment or solution to my problem? email me! Drop me an email and I’ll shoot you back my cell # if you want a more in-depth conversation…