SRUSRW: Search/Retrieve Web ServiceSRW is a variation of SRU. Messages are conveyed from client to server, not by a URL, but instead using XML over HTTP via the W3C recommendation SOAP, which specifies how to wrap an XML message within an XML envelope. The SRW specification tries to adhere to the Web Services Interoperability recommendations. Benefits of SRWThe incremental benefits of SRW (that is, the advantages of using SRW over SRU) are: better extension support, authentication, and web service features. SOAP VersionSRW clients and servers must support SOAP version 1.1. They may support version 1.2 or later. This is to allow the most flexibility in implementation as possible. Service StyleThe SOAP service style for SRW is document/literal. Messages should be inline with no multrefs. Other ConsiderationsIf there is a doubt whether to return a SOAP fault or an SRW diagnostic, then the diagnostic is the preferred solution, as the client must support the diagnostics, and toolkits may not handle SOAP faults as gracefully (see below). The SOAPAction HTTP header may be present in a request (but should not be required for SRW implementations). If present, its value must be an empty string, and it must be expressed as:
(A header of
is incorrect.)
"Toolkit as Impediment"This phrase, coined by one of the designers of SRW, refers to the fact that different toolkits make some things easy to accomplish where they might be extremely arcane in others. The design of SRW tries to take a good cross sample of well-supported, standards-compliant toolkits, and takes the line of least resistance. Thus if you ever think, 'Why is it done like that?!', the answer is probably that it was easiest to do it that way while remaining standards compliant.
ParametersThe parameters for the SRW request and response are the same as the SRU searchRetrieve request and response parameters, with the following exceptions:
ExamplesA typical searchRetrieve request might be: <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Body> <SRW:searchRetrieveRequest xmlns:SRW="//www.loc.gov/zing/srw/"> <SRW:version>1.1</SRW:version> <SRW:query>(dc.author exact "jones" and dc.title >= "smith")</SRW:query> <SRW:startRecord>1</SRW:startRecord> <SRW:maximumRecords>10</SRW:maximumRecords> <SRW:recordSchema>info:srw/schema/1/mods-v3.0</SRW:recordsSchema> </SRW:searchRetrieveRequest> </SOAP:Body> </SOAP:Envelope> The searchRetrieve response would be of the form: <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Body> <SRW:searchRetrieveResponse xmlns:SRW="//www.loc.gov/zing/srw/" xmlns:DIAG="//www.loc.gov/zing/srw/diagnostics/"> <SRW:version>1.1</SRW:version> <SRW:numberOfRecords>2</SRW:numberOfRecords> <SRW:resultSetId>8c527d60-c3b4-4cec-a1de-1ff80a5932df</SRW:resultSetId> <SRW:resultSetIdleTime>600</SRW:resultSetIdleTime> <SRW:records> <SRW:record> <SRW:recordSchema>info:srw/schema/1/mods-v3.0</SRW:recordSchema> <SRW:recordPacking>string</SRW:recordPacking> <SRW:recordData> <?xml version="1.0" encoding="UTF-8"?> <mods xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/" xsi:schemaLocation=" http://www.loc.gov/standards/mods/mods.xsd"> <titleInfo> <title>Sound and fury : the making of the punditocracy /</title> </titleInfo> <name type="personal"> <namePart>Alterman, Eric.</namePart> <role>creator</role> </name> ... </SRW:recordData> <SRW:recordPosition>1</SRW:recordPosition> </SRW:record> <SRW:record> <SRW:recordSchema>info:srw/schema/1/diagnostic-v1.1 </SRW:recordSchema> <SRW:recordPacking>string</SRW:recordPacking> <SRW:recordData> <diagnostic> <uri>info:srw/diagnostic/1/68</uri> <details>Not authorised to send record</details> </diagnostic> </SRW:recordData> <SRW:recordPosition>2</SRW:recordPosition> </SRW:record> </SRW:records> <SRW:diagnostics> <DIAG:diagnostic> <DIAG:uri>info:srw/diagnostic/1/59</DIAG:uri> <DIAG:message>Result set created with valid partial results available</DIAG:message> </DIAG:diagnostic> </SRW:diagnostics> </SRW:searchRetrieveResponse> </SOAP:Body> </SOAP:Envelope> |
September 3, 2013 |