1

Re: The query you send to NBN produce no results

I had a response from Jonathan Cooper about some of the stuff I posted previously and the reason he found that some of the exceptions I am getting was that the particular query I was running didn't produce anything. There is nothing on the NBN Gateway for species x at location y.

I replied saying:

I think there ought to be a distinction between an error - i.e. the request XML you sent is in some way incorrect, and a failure to find anything, i.e. the syntax of the request was correct but produced no result. The latter case needs to return something valid which flags "result set empty" rather than throwing an exception.

The best way to tackle this would seem to be having some specified value (e.g. "NULL") which is used as the item values in the response XML when the result set was empty. The client would then have a valid reposnse to parse but would need to test for the known no-reponse value when generating HTML.

Jon's reponse was:

Yes, I'll have a chat with Richard.  I agree, no data found isn't an exception.  We need to sort out how to handle it.

Stuart

2 (edited by Richard Ostler 12-05-2006 10:19:29)

Re: The query you send to NBN produce no results

An option maybe to add a boolean attribute to the response root elements to flag whether or not there is data. For example say you have posted a species list query, but no species are found the response would look something like:

<SpeciesListResponse hasData="false" .... />

You would then test for the hasData attribute.

Any thoughts?

[b]Richard Ostler[/b]
NBN Developer