From: Adam Dickmeiss Date: Thu, 23 Jun 2005 13:09:42 +0000 (+0000) Subject: Changed xmles command to take OID + doc as parameter (previous X-Git-Tag: YAZXF2.1.4.2.2.release~28 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=5b9a39fc00ab0969ff020f05c51c5d336e00d762;p=yaz-moved-to-github.git Changed xmles command to take OID + doc as parameter (previous version only took doc). --- diff --git a/NEWS b/NEWS index 0e68a28..665927d 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ Possible compatibility problems with earlier versions marked with '*'. +Added new yaz-client, xmles, which takes a (private) OID and +a document to be sent as an extended service request. + Describe new yaz-client commands wait_response and set_auto_wait. --- 2.1.8 2005/06/07 diff --git a/client/client.c b/client/client.c index 86caf06..2778a5c 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: client.c,v 1.288 2005-06-21 07:33:09 adam Exp $ + * $Id: client.c,v 1.289 2005-06-23 13:09:42 adam Exp $ */ #include @@ -2313,13 +2313,14 @@ static int cmd_update_common(const char *arg, int version) static int cmd_xmles(const char *arg) { + int noread = 0; + char oid_str[51]; + int oid_value_xmles = VAL_XMLES; Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest); Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest; Z_External *ext = (Z_External *) odr_malloc(out, sizeof(*ext)); req->taskSpecificParameters = ext; - req->packageType = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV, - VAL_XMLES); ext->direct_reference = req->packageType; ext->descriptor = 0; ext->indirect_reference = 0; @@ -2327,9 +2328,25 @@ static int cmd_xmles(const char *arg) ext->which = Z_External_octet; ext->u.single_ASN1_type = (Odr_oct *) odr_malloc (out, sizeof(Odr_oct)); + sscanf(arg, "%50s%n", oid_str, &noread); + if (noread == 0) + { + printf("Missing OID for xmles\n"); + return 0; + } + arg += noread; + oid_value_xmles = oid_getvalbyname(oid_str); + if (oid_value_xmles == VAL_NONE) + { + printf("Bad OID: %s\n", oid_str); + return 0; + } + if (parse_cmd_doc(&arg, out, (char **) &ext->u.single_ASN1_type->buf, &ext->u.single_ASN1_type->len, 0) == 0) return 0; + req->packageType = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV, + oid_value_xmles); send_apdu(apdu); return 2; @@ -4256,7 +4273,7 @@ static struct { {"itemorder", cmd_itemorder, "ill|item ",NULL,0,NULL}, {"update", cmd_update, " []",NULL,0,NULL}, {"update0", cmd_update0, " []",NULL,0,NULL}, - {"xmles", cmd_xmles, "",NULL,0,NULL}, + {"xmles", cmd_xmles, " ",NULL,0,NULL}, {"packagename", cmd_packagename, "",NULL,0,NULL}, {"proxy", cmd_proxy, "[('tcp'|'ssl')][':']",NULL,0,NULL}, {"charset", cmd_charset, " ",NULL,0,NULL}, diff --git a/configure.in b/configure.in index ff17517..0d0f1c3 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2005 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.182 2005-06-08 09:11:17 adam Exp $ +dnl $Id: configure.in,v 1.183 2005-06-23 13:09:42 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 2.1.9) AM_MAINTAINER_MODE @@ -160,7 +160,7 @@ if test "$with_iconv" != "no"; then ]) fi dnl ------ various functions -AC_CHECK_FUNCS(vsnprintf gettimeofday poll strerror_r usleep) +AC_CHECK_FUNCS(vsnprintf gettimeofday poll strerror_r usleep fopen64) if test "$ac_cv_func_poll" = "yes"; then AC_CHECK_HEADERS(sys/poll.h) fi diff --git a/doc/yaz-client-commands.xml b/doc/yaz-client-commands.xml index fd98374..1c21bc5 100644 --- a/doc/yaz-client-commands.xml +++ b/doc/yaz-client-commands.xml @@ -1,5 +1,5 @@ @@ -646,12 +646,11 @@ xmles + OID doc - Sends XML Extended Services request using the doc given. - This is a privately defined Extended Service using OID - 1.2.840.10003.9.1000.105.4. + Sends XML Extended Services request using the OID and doc given.