Robert Sanderson wrote:
>> In case of a HTTP POST request, I need to open the POST'ed data, to see
>> what I should do - and that's application logic!
> No, you can and should check the content-type header.
> See: http://www.loc.gov/standards/sru/sru-post.html
That was what I meant, but did not write clearly.
Still, you are chickening out.
I got no clear answers for the following situations a
SRU GET/POST/SOAP server should survive:
a) A HTTP POST request is not in the headers specified of content type
application/x-www-form-urlencoded SRU/POST or
text/xml SRU/SOAP or
what's the correct behaviour ?? I suppose it's
HTTP error 415 Unsupported Media Type
b) A HTTP POST request is of content type text/xml or
application/soap+xml, but the posted data can not be parsed as XML
I see no HTTP error which fits the bill at
but I might have missed something. Maybe the best here is
HTTP error 400 Bad Request ???
c) A HTTP POST with correct text/xml headers and parsable XML, but is
just no SOAP
Nobody asked for SOAP, so this should be a HTTP error rather than a
SOAP error, right ?? Which one ??
d) A HTTP POST with correct application/soap+xml headers and parsable
XML, but is just no SOAP with Envelope and Body wrappers.
Now a SOAP error is appropriate, I guess.
http://www.w3.org/TR/soap/ is the page.
Section 2.3 "Fault Scenarios" seems not to give a clear answer.
There it is stated that the Body has to carry a
XML block, The env:Code sub-element of env:Fault is itself made up of
a mandatory env:Value sub-element, whose content is specified in the
SOAP specification (see SOAP Part 1 section 5.4.6) as well as an
optional env:Subcode sub-element.
Looking at that reference,
I would guess it's the "Sender" fault code which needs to be send ??
What's your advice here ??
e) Your example of an invalid SRU GET request
which does not state any operation, must issue a fatal diagnostic.
7 Mandatory parameter not supplied
I presume you wrap this in a <srw:explainResponse>,
as there are only scan, search and explain to choose from, and the
two others feel quite odd to wrap it into, right ??
But this means assuming the operation 'explain' if you can not
determine which operation to use ??
Cheers, Marc Cromme
>> 3) if I get something else in the POST'ed data - I do what ??
>> How should the server respond ??
> Whatever a SOAP server would do with a broken request, which I'm sure is
> defined in the SOAP w3 docs.
>> If no valid operation is parsed (due to empty parameter SRU GET list),
>> explain is assumed anyhow ..
> That's not exactly how it works.
> Either there are no parameters, or there's an operation parameter.
> Anything else is a broken client.
> is just not a valid SRU URL. Nor is:
Marc Cromme, cand. polyt, Ph.D
Senior Developer, Project Manager
Index Data Aps
K°bmagergade 43, 2
1150 Copenhagen K.
tel: +45 3341 0100
fax: +45 3341 0101
INDEX DATA Means Business
for Open Source and Open Standards