+ else if (!strcmp(operation, "scan"))
+ {
+ Z_SRW_PDU *sr = yaz_srw_get(decode, Z_SRW_scan_request);
+
+ if (!scanClause)
+ yaz_add_srw_diagnostic(decode, diag, num_diag, 7,
+ "scanClause");
+ sr->srw_version = version;
+ *srw_pdu = sr;
+ sr->u.scan_request->scanClause = scanClause;
+ sr->u.scan_request->database = db;
+ sr->u.scan_request->stylesheet = stylesheet;
+
+ (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package)->which = Z_SOAP_generic;
+
+ (*soap_package)->u.generic =
+ odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
+
+ (*soap_package)->u.generic->p = sr;
+ (*soap_package)->u.generic->ns = soap_handlers[0].ns;
+ (*soap_package)->u.generic->no = 0;
+
+ (*soap_package)->ns = "SRU";
+
+ return 0;
+ }
+ else
+ {
+ /* unsupported operation ... */
+ /* Act as if we received a explain request and throw diagnostic. */
+
+ Z_SRW_PDU *sr = yaz_srw_get(decode, Z_SRW_explain_request);
+
+ sr->srw_version = version;
+ *srw_pdu = sr;
+ sr->u.explain_request->recordPacking = recordPacking;
+ sr->u.explain_request->database = db;
+
+ sr->u.explain_request->stylesheet = stylesheet;
+
+ (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package)->which = Z_SOAP_generic;
+
+ (*soap_package)->u.generic =
+ odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
+
+ (*soap_package)->u.generic->p = sr;
+ (*soap_package)->u.generic->ns = soap_handlers[0].ns;
+ (*soap_package)->u.generic->no = 0;
+
+ (*soap_package)->ns = "SRU";
+
+ yaz_add_srw_diagnostic(decode, diag, num_diag, 4, operation);
+ return 0;
+ }