Return new ino:id after insert

Hello!

I need to retrieve the ino:id that has been newly assigned to a document that has just been inserted.

There are possibly several identical documents under one doctype. So there is no way to perform a query on the id based on the content of the document. (the structure may be unknown to the application anyway.)

I’m using this id for performing a query immediately after insertion.
Is it possible to do this with the C-API?
i tried to use tac_get_messagetext after tac_process, but it return nothing interesting.

Thanks,
Henning

Another way that just came into my mind is to add a unique name to the document when inserting, like tac_load allows.
Is it possible to add xml documents with tac_load?
The API documentation tells “If required, use tac_process() instead for XML documents.”
When is this required?
Which mime_type value is necessary for xml?

Greets,
Henning

These posts would probably have been better under the “Tamino API for C” forum.

After a _process request to Tamino the ino:id normally appears in the response document and as a HTTP header (X-INO-id).

You might be able to see this trying a test like the following:

http://localhost/tamino/mydb/ino:etc?_process=

Thanks markk!

But, the result of http://localhost/tamino/mydb/ino:etc?_process=
is different from what i get by calling tac_get_messagetext after calling _process(), which is just like this:

<?xml version="1.0" encoding="iso-8859-1"?> 200 document processing started

(not that interesting for me :wink:

Is there a way to get the result, the webserver returns after calling _process()?

Greets,
Henning

I had a quick look in TaminoAPI4C.h and the following functions look appropriate. The documentation seems to support this.


int tac_get_inoID(TAC_HANDLE handle, long int *ino_id);
int tac_last_xml_response(TAC_HANDLE handle, const char **response);

Thanks!

tac_last_xml_response is exactly what i was looking for.
:lol: