[webservices] 204/404 vs empty xml doc

Philip Crotwell crotwell at seis.sc.edu
Tue Apr 2 14:11:13 PDT 2013


Hi

Following up on my inability to catch a 204, can you explain the
rationalization for using a 204 instead of returning an empty, but
structurally correct, quakeml document for a query that doesn't match
anything. For example is I ask for a time window and magnitude range that
doesn't match any earthquake, send back this:

<q:quakeml xmlns:q="http://quakeml.org/xmlns/quakeml/1.2" xmlns="
http://quakeml.org/xmlns/bed/1.2">
<eventParameters publicID="smi:service.iris.edu/fdsnws/event/1/query">
</eventParameters>
</q:quakeml>

To be honest, I would rather have an empty XML document returned in the
case where the query is well formed and valid, but just so happens that
nothing in the database matched my query. HTTP error codes make it sound
like there was an error, but that is not really the case here. There wasn't
any data and so an empty xml document is a fine thing to return.

I had a quick read of the http spec, and it doesn't really sound to me like
a 204 is actually meant to mean, "sorry, no data", but rather is to be used
in cases where there is some communications efficiencies to be had by
avoiding a "entity body" and a update of the document view.

I guess I just don't see any advantage of 204 being the default for "no
data" for these xml web services, especially when it will almost certainly
cause confusion given the way browsers handle it, ie leaving the old page
content on the display.

$0.02
Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/webservices/attachments/20130402/7dadefb0/attachment.htm>


More information about the webservices mailing list