xml invalid when searching for 2 words in tas

Topics: User Forum
Nov 30, 2006 at 3:56 PM

my flickr.net app worked until quite recently. I've updated my version of the Flickr.Net wrapper library, I'm guessing that Flickr have gone and changed something in their API.

I have a tag search facility. It works fine with one word search, but if you try to put in two words, or word1+word2, it returns the following:

Invalid response received (There is an error in XML document (3, 42).) (9998)

FlickrException: Invalid response received (There is an error in XML document (3, 42).) (9998)] FlickrNet.Flickr.Deserialize(String responseString) +151 FlickrNet.Flickr.GetResponse(Hashtable parameters, TimeSpan cacheTimeout) +833 FlickrNet.Flickr.GetResponseCache(Hashtable parameters) +47 FlickrNet.Flickr.PhotosSearch(PhotoSearchOptions options) +1368 photolibrary.default.LoadPics(Object tags) +327 photolibrary.default.btnTagSearch_Click(Object sender, EventArgs e) +34 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1273

I've managed to find out that the XML being returned that triggers the error is:

<?xml version="1.0" encoding="utf-8" ?> <rsp stat="ok"> <photos page="1" pages="0" perpage="500" total="" /> </rsp>

This is the code I use on the aspx page to get the search

Dim searchOptions As PhotoSearchOptions = New PhotoSearchOptions

searchOptions.TagMode = TagMode.AllTags

If Not IsNothing(tags) Then

searchOptions.Tags = tags

End If

Dim flkrPhotos As Photos = flk.PhotosSearch(searchOptions)

and tags comes into the function ByVal from a textbox control.

Any help appreciated.

Dec 1, 2006 at 9:27 AM
well I can't get this to fail at all at the moment, any search I run that returns 0 photos is setting the total to zero correctly, so it looks like it might have been a bug in Flickr.

If this IS still happening for you then could you post the exact tags you are trying to search for, as I've tried "word1 word2", "word1,word2", "word1+word" all of which work fine.