+ return send_APDU (c, apdu);
+}
+
+static zoom_ret send_srw (ZOOM_connection c, Z_SRW_searchRetrieve *sr)
+{
+ Z_SOAP_Handler h[2] = {
+ {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec},
+ {0, 0, 0}
+ };
+ ODR o = odr_createmem(ODR_ENCODE);
+ int ret;
+ Z_SOAP *p = odr_malloc(o, sizeof(*p));
+ Z_GDU *gdu;
+ ZOOM_Event event;
+
+ gdu = z_get_HTTP_Request(c->odr_out);
+ gdu->u.HTTP_Request->path = c->path;
+ z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
+ "Content-Type", "text/xml");
+ z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
+ "SOAPAction", "\"\"");
+ p->which = Z_SOAP_generic;
+ p->u.generic = odr_malloc(o, sizeof(*p->u.generic));
+ p->u.generic->no = 0;
+ p->u.generic->ns = 0;
+ p->u.generic->p = sr;
+ p->ns = "http://schemas.xmlsoap.org/soap/envelope/";
+
+ ret = z_soap_codec(o, &p,
+ &gdu->u.HTTP_Request->content_buf,
+ &gdu->u.HTTP_Request->content_len, h);
+
+ if (!z_GDU(c->odr_out, &gdu, 0, 0))
+ return zoom_complete;
+ c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
+
+ odr_destroy(o);
+
+ event = ZOOM_Event_create (ZOOM_EVENT_SEND_APDU);
+ ZOOM_connection_put_event (c, event);
+ odr_reset(c->odr_out);
+ return do_write (c);
+}
+
+static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
+{
+ ZOOM_resultset resultset;
+ Z_SRW_searchRetrieve *sr = yaz_srw_get(c->odr_out,
+ Z_SRW_searchRetrieve_request);
+
+ assert (c->tasks);
+ assert (c->tasks->which == ZOOM_TASK_SEARCH);