The datastreams are base64 encoded and embeded within the XML that is ingested, which actually allows me to ingest the object with its datastreams in one call. As far I remember this is also a mechanism that is recomended by other users -:)

I'm not using the fedora client (as you suggest to use) and I'm also not intend to do it, as I'd like to stick to the SOAP webservice API. My datastreams are simple xml contents generated from Java objects and they describe meta content of the binary data that are stored in fedora as well, so when i modify the meta content or some other binary content i'd like to do it by value (proving the byte content of it), and not creating a file first and then point to it. Is it possible?

> Date: Tue, 9 Dec 2008 15:56:41 +0100
> To:
> Subject: Re: [Fedora-commons-users] Error when modifying a datastream by value
> From:
> CC:
> > Of cource I'm using ingest method to create objects and not purge -:)
> using ingest indicates that you create your object entirely in xml before.
> if so, you could easily create it with the datatstream already.
> base64 encoded internal text/xml datastream seems rather pointless -- and
> is probably forbidden: mime type base64 != text/xml
> 1) for an internal xml datatsteam you could use an instance of
> FedoraClient and uploadFile().
> 2) or you simply create an empty xml, that you serve and use as dsLocation
> (http://localhost/empty.xml) and in a next step you then use
> modifyDatastreamByValue() with your xml as byte[].
> a rather crude version of 2 would probably be to have a fedora object
> with an empty datatstream with your id, that you fetch via
> Datastream query=apim.getDatatstream(pid, id, null);
> and add to your object via
> apim.addDatastream(pid, query.getID(), new String[0], query.getLabel(),
> query.isVersionable(), query.getMIMEType(), query.getFormatURI(),
> query.getLocation(), query.getControlGroup()
> .getValue(), query.getState(), query.getChecksumType(),
> query.getChecksum(), "added datastream");
> (that's what i did since i tested my datastreams and disseminators with an
> object before and it was the easiest way for me.)
> then you're back at modify...
> i fail to understand, why the Datastream constructor does not accept a
> byte[] as well for an internal xml datastream, but that's a flaw we have
> to live with.

Connect to the next generation of MSN Messenger  Get it now!

Discover the new Windows Vista Learn more!