static void handle_srw_record(Z_SRW_record *rec)
{
if (rec->recordPosition)
- {
printf("pos=" ODR_INT_PRINTF, *rec->recordPosition);
- setno = *rec->recordPosition + 1;
- }
if (rec->recordSchema)
printf(" schema=%s", rec->recordSchema);
printf("\n");
}
handle_srw_record(res->records + i);
}
+ setno += res->num_records;
}
static void handle_srw_scan_term(Z_SRW_scanTerm *term)
{YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {"searchRetrieveResponse", 0, (Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,
"Bad XML Document", 0);
ptr = xmlDocGetRootElement(doc);
- if (!ptr || !ptr->ns)
+ if (!ptr || ptr->type != XML_ELEMENT_NODE || !ptr->ns)
{
xmlFreeDoc(doc);
return z_soap_error(o, p, "SOAP-ENV:Client",
"No Envelope element", 0);
}
/* check for SRU root node match */
-
for (i = 0; handlers[i].ns; i++)
- if (yaz_match_glob(handlers[i].ns, (const char *)ptr->ns->href))
- break;
+ {
+ const char *hns = handlers[i].ns;
+ if (strchr(hns, ':'))
+ {
+ if (yaz_match_glob(hns, (const char *) ptr->ns->href))
+ break;
+ }
+ else
+ {
+ if (yaz_match_glob(hns, (const char *) ptr->name))
+ break;
+ }
+ }
if (handlers[i].ns)
{
void *handler_data = 0;
return ret;
}
/* OK: assume SOAP */
-
- if (!ptr || ptr->type != XML_ELEMENT_NODE ||
- xmlStrcmp(ptr->name, BAD_CAST "Envelope") || !ptr->ns)
+ if (xmlStrcmp(ptr->name, BAD_CAST "Envelope"))
{
xmlFreeDoc(doc);
return z_soap_error(o, p, "SOAP-ENV:Client",
const char *ns = (const char *) ptr->ns->href;
for (i = 0; handlers[i].ns; i++)
{
- if (yaz_match_glob(handlers[i].ns, ns))
+ if (strchr(handlers[i].ns, ':') &&
+ yaz_match_glob(handlers[i].ns, ns))
break;
}
if (handlers[i].ns)
{
Z_SOAP *soap_package = 0;
ODR o = c->odr_in;
- Z_SOAP_Handler soap_handlers[3] = {
+ Z_SOAP_Handler soap_handlers[4] = {
{YAZ_XMLNS_SRU_v1_response, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_SRU_v2_mask, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {"searchRetrieveResponse", 0, (Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,