SRW SOAP Messages

Version 1.1, 12th January 2004

explain Operation

The first SRW Operation would normally be the Explain operation. A typical Explain request would be:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:explainRequest xmlns:SRW="http://www.loc.gov/zing/srw/">
      <SRW:version>1.1</SRW:version>
    </SRW:explainRequest>
  </SOAP:Body>
</SOAP:Envelope>

The corresponding response from the server would be:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:explainResponse xmlns:SRW="http://www.loc.gov/zing/srw/">
      <SRW:version>1.1</SRW:version>
      <SRW:record>
        <SRW:recordSchema>http://explain.z3950.org/dtd/2.0/</SRW:recordSchema>
        <SRW:recordPacking>string</SRW:recordPacking>
        <SRW:recordData>
          &lt;explain id=&quot;org.o-r-g.srw-first&quot; 
                          authoritative=&quot;true&quot;&gt;
            &lt;serverInfo wsdl=&quot;http://srw.o-r-g.org/wsdlfile.txt&quot; 
                               protocol=&quot;srw&quot; version=&quot;1.1&quot;&gt;
              &lt;host&gt;srw.o-r-g.org&lt;/host&gt;
              &lt;port&gt;8080&lt;/port&gt;
              &lt;database numRecs=&quot;100&quot; lastUpdate=&quot;2002-08-18 11:30:00&quot;&gt;
                /l5r
              &lt;/database&gt;
            &lt;/serverInfo&gt;
           ...
         </SRW:recordData>
      </SRW:record>
    </SRW:explainResponse>
  </SOAP:Body>
</SOAP:Envelope>

 

searchRetrieve Operation

Subsequent operations might be searchRetrieve operations. A typical searchRetrieve request might be:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:searchRetrieveRequest xmlns:SRW="http://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>http://www.loc.gov/mods/</SRW:recordsSchema>
    </SRW:searchRetreiveRequest>
  </SOAP:Body>
</SOAP:Envelope>

The searchRetreive response would be of the form:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:searchRetrieveResponse xmlns:SRW="http://www.loc.gov/zing/srw/" 
         xmlns:DIAG="http://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>http://www.loc.gov/mods/</SRW:recordSchema>
          <SRW:recordPacking>string</SRW:recordPacking>
          <SRW:recordData>
            &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
            &lt;mods xmlns:xlink=&quot;http://www.w3.org/TR/xlink&quot; 
               xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; 
               xmlns=&quot;http://www.loc.gov/mods/&quot; 
               xsi:schemaLocation=&quot;http://www.loc.gov/standards/mods/mods.xsd&quot;&gt;
              &lt;titleInfo&gt;
                &lt;title&gt;Sound and fury : the making of the punditocracy /&lt;/title&gt;
              &lt;/titleInfo&gt;
              &lt;name type=&quot;personal&quot;&gt;
                &lt;namePart&gt;Alterman, Eric.&lt;/namePart&gt;
                &lt;role&gt;creator&lt;/role&gt;
              &lt;/name&gt;
              ...
          </SRW:recordData>
          <SRW:recordNumber>1</SRW:recordNumber>
        </SRW:record>
        <SRW:record>
          <SRW:recordSchema>http://www.loc.gov/zing/srw/diagnostics/</SRW:recordSchema>
          <SRW:recordPacking>string</SRW:recordPacking>
  
          <SRW:recordData>
            &lt;diagnostic&gt;
&lt;code&gt;68&lt;/code&gt;
&lt;details&gt;Not authorised to send record&lt;/details&gt;
&lt;/diagnostic&gt; </SRW:recordData> <SRW:recordNumber>2</SRW:recordNumber> </SRW:record> <SRW:records> <SRW:diagnostics> <DIAG:diagnostic> <DIAG:code>59</DIAG:code> <DIAG:message>Result set created with valid partial results available</DIAG:message> </DIAG:diagnostic> </SRW:diagnostics> </SRW:searchRetrieveResponse> </SOAP:Body> </SOAP:Envelope>

 

scan Operation

The other operation that can occur is scan. SOAP examples:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:scanRequest xmlns:SRW="http://www.loc.gov/zing/srw/">
      <SRW:version>1.1</SRW:version>
      <SRW:scanClause>dc.author any "jones"</SRW:scanClause>
      <SRW:maximumTerms>20</SRW:maximumTerms>
      <SRW:responsePosition>1</SRW:responsePosition>
    </SRW:scanRequest>
  </SOAP:Body>
</SOAP:Envelope>

And the response:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP:Body>
    <SRW:scanResponse xmlns:SRW="http://www.loc.gov/zing/srw/">
      <SRW:version>1.1</SRW:version>
      <SRW:terms>
        <SRW:term>
          <SRW:value>jones</SRW:value>
          <SRW:numberOfRecords>234</SRW:numberOfRecords>
        <SRW:/term>
        <SRW:term>
          <SRW:value>jonty</SRW:value>
          <SRW:numberOfRecords>56</SRW:numberOfRecords>
        <SRW:/term>
         ...
      </SRW:terms>
    </SRW:scanResponse>
  </SOAP:Body>
</SOAP:Envelope>