- else if (rr->esr->taskSpecificParameters->which == Z_External_itemOrder)
- {
- Z_ItemOrder *it = rr->esr->taskSpecificParameters->u.itemOrder;
- yaz_log (LOG_LOG, "Received ItemOrder");
- switch (it->which)
- {
-#ifdef ASN_COMPILED
- case Z_IOItemOrder_esRequest:
-#else
- case Z_ItemOrder_esRequest:
-#endif
- {
- Z_IORequest *ir = it->u.esRequest;
- Z_IOOriginPartToKeep *k = ir->toKeep;
- Z_IOOriginPartNotToKeep *n = ir->notToKeep;
-
- if (k && k->contact)
- {
- if (k->contact->name)
- yaz_log(LOG_LOG, "contact name %s", k->contact->name);
- if (k->contact->phone)
- yaz_log(LOG_LOG, "contact phone %s", k->contact->phone);
- if (k->contact->email)
- yaz_log(LOG_LOG, "contact email %s", k->contact->email);
- }
- if (k->addlBilling)
- {
- yaz_log(LOG_LOG, "Billing info (not shown)");
- }
-
- if (n->resultSetItem)
- {
- yaz_log(LOG_LOG, "resultsetItem");
- yaz_log(LOG_LOG, "setId: %s", n->resultSetItem->resultSetId);
- yaz_log(LOG_LOG, "item: %d", *n->resultSetItem->item);
- }
-#ifdef ASN_COMPILED
- if (n->itemRequest)
- {
- Z_External *r = (Z_External*) n->itemRequest;
- ILL_ItemRequest *item_req = 0;
- ILL_Request *ill_req = 0;
- if (r->direct_reference)
- {
- oident *ent = oid_getentbyoid(r->direct_reference);
- if (ent)
- yaz_log(LOG_LOG, "OID %s", ent->desc);
- if (ent && ent->value == VAL_ISO_ILL_1)
- {
- yaz_log (LOG_LOG, "ItemRequest");
- if (r->which == ODR_EXTERNAL_single)
- {
- odr_setbuf(rr->decode,
- r->u.single_ASN1_type->buf,
- r->u.single_ASN1_type->len, 0);
-
- if (!ill_ItemRequest (rr->decode, &item_req, 0, 0))
- {
- yaz_log (LOG_LOG,
- "Couldn't decode ItemRequest %s near %d",
- odr_errmsg(odr_geterror(rr->decode)),
- odr_offset(rr->decode));
- yaz_log(LOG_LOG, "PDU dump:");
- odr_dumpBER(yaz_log_file(),
- r->u.single_ASN1_type->buf,
- r->u.single_ASN1_type->len);
- }
- if (rr->print)
- {
- ill_ItemRequest (rr->print, &item_req, 0,
- "ItemRequest");
- odr_reset (rr->print);
- }
- }
- if (!item_req && r->which == ODR_EXTERNAL_single)
- {
- yaz_log (LOG_LOG, "ILLRequest");
- odr_setbuf(rr->decode,
- r->u.single_ASN1_type->buf,
- r->u.single_ASN1_type->len, 0);
-
- if (!ill_Request (rr->decode, &ill_req, 0, 0))
- {
- yaz_log (LOG_LOG,
- "Couldn't decode ILLRequest %s near %d",
- odr_errmsg(odr_geterror(rr->decode)),
- odr_offset(rr->decode));
- yaz_log(LOG_LOG, "PDU dump:");
- odr_dumpBER(yaz_log_file(),
- r->u.single_ASN1_type->buf,
- r->u.single_ASN1_type->len);
- }
- if (rr->print)
- {
- ill_Request (rr->print, &ill_req, 0,
- "ILLRequest");
- odr_reset (rr->print);
- }
- }
- }
- }
- if (item_req)
- {
- yaz_log (LOG_LOG, "ILL protocol version = %d",
- *item_req->protocol_version_num);
- }
- }
-#endif
- }
- break;
- }
- }