static void srw_bend_search(association *assoc, request *req,
Z_SRW_PDU *sr,
- Z_SRW_searchRetrieveResponse *srw_res,
+ Z_SRW_PDU *res,
int *http_code)
{
+ Z_SRW_searchRetrieveResponse *srw_res = res->u.response;
int srw_error = 0;
Z_External *ext;
Z_SRW_searchRetrieveRequest *srw_req = sr->u.request;
rr.partial_resultset = 0;
rr.query = (Z_Query *) odr_malloc(assoc->decode, sizeof(*rr.query));
rr.query->u.type_1 = 0;
+ rr.extra_args = sr->extra_args;
+ rr.extra_response_data = 0;
if (srw_req->query_type == Z_SRW_query_type_cql)
{
srw_res->records = 0;
}
}
+ if (rr.extra_response_data)
+ {
+ res->extraResponseData_buf = rr.extra_response_data;
+ res->extraResponseData_len = strlen(rr.extra_response_data);
+ }
if (rr.estimated_hit_count || rr.partial_resultset)
{
yaz_add_srw_diagnostic(
}
else
{
- srw_bend_search(assoc, req, sr, res->u.response,
- &http_code);
+ srw_bend_search(assoc, req, sr, res, &http_code);
}
if (http_code == 200)
soap_package->u.generic->p = res;
bsrr->srw_setnameIdleTime = 0;
bsrr->estimated_hit_count = 0;
bsrr->partial_resultset = 0;
+ bsrr->extra_args = 0;
+ bsrr->extra_response_data = 0;
yaz_log (log_requestdetail, "ResultSet '%s'", req->resultSetName);
if (req->databaseNames)
if (match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
+ else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ &(*p)->extraResponseData_buf,
+ &(*p)->extraResponseData_len))
+ ;
else if (match_xsd_integer(ptr, "numberOfRecords", o,
&res->numberOfRecords))
;
if (match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
+ else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ &(*p)->extraResponseData_buf,
+ &(*p)->extraResponseData_len))
+ ;
else if (match_xsd_string(ptr, "stylesheet", o,
&req->stylesheet))
;
if (match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
+ else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ &(*p)->extraResponseData_buf,
+ &(*p)->extraResponseData_len))
+ ;
else if (match_element(ptr, "record"))
yaz_srw_record(o, ptr, &res->record, &res->extra_record,
client_data, ns);
if (match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
+ else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ &(*p)->extraResponseData_buf,
+ &(*p)->extraResponseData_len))
+ ;
else if (match_xsd_string(ptr, "scanClause", o,
&req->scanClause.cql))
;
if (match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
+ else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ &(*p)->extraResponseData_buf,
+ &(*p)->extraResponseData_len))
+ ;
else if (match_element(ptr, "terms"))
yaz_srw_terms(o, ptr, &res->terms,
&res->num_terms, client_data,
{
Z_SRW_PDU **p = handler_data;
xmlNsPtr ns_srw;
+ xmlNodePtr ptr = 0;
if ((*p)->which == Z_SRW_searchRetrieve_request)
{
Z_SRW_searchRetrieveRequest *req = (*p)->u.request;
- xmlNodePtr ptr = xmlNewChild(pptr, 0,
- BAD_CAST "searchRetrieveRequest", 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "searchRetrieveRequest", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
else if ((*p)->which == Z_SRW_searchRetrieve_response)
{
Z_SRW_searchRetrieveResponse *res = (*p)->u.response;
- xmlNodePtr ptr = xmlNewChild(pptr, 0,
- BAD_CAST "searchRetrieveResponse", 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "searchRetrieveResponse", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
else if ((*p)->which == Z_SRW_explain_request)
{
Z_SRW_explainRequest *req = (*p)->u.explain_request;
- xmlNodePtr ptr = xmlNewChild(pptr, 0, BAD_CAST "explainRequest",
- 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "explainRequest", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
else if ((*p)->which == Z_SRW_explain_response)
{
Z_SRW_explainResponse *res = (*p)->u.explain_response;
- xmlNodePtr ptr = xmlNewChild(pptr, 0, BAD_CAST "explainResponse",
- 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "explainResponse", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
else if ((*p)->which == Z_SRW_scan_request)
{
Z_SRW_scanRequest *req = (*p)->u.scan_request;
- xmlNodePtr ptr = xmlNewChild(pptr, 0, BAD_CAST "scanRequest", 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "scanRequest", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
else if ((*p)->which == Z_SRW_scan_response)
{
Z_SRW_scanResponse *res = (*p)->u.scan_response;
- xmlNodePtr ptr = xmlNewChild(pptr, 0, BAD_CAST "scanResponse", 0);
+ ptr = xmlNewChild(pptr, 0, BAD_CAST "scanResponse", 0);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
}
else
return -1;
+ if (ptr && (*p)->extraResponseData_len)
+ add_XML_n(ptr, "extraResponseData",
+ (*p)->extraResponseData_buf,
+ (*p)->extraResponseData_len, ns_srw);
+
}
return 0;