directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: How to bind and search binary data in Apache DS?
Date Mon, 02 Mar 2009 10:44:30 GMT
Sudheer Kumar wrote:
>>> As you are using JNDI you need to specify your attribute as binary.>>Either
use the ;binary option or put your attribute to the>>"java.naming.ldap.attributes.binary"
environment property. See [1] for>>more information.
>>> Kind Regards,>>Stefan
>>> [1]
> ------------------ Thanks for the information. However, what I want is to
> store a String (an xml data) in the form of binary in Apache Directory
> Server.  I used to store the same in Sun one and Tivoli and was successful.
>  With Them I can simply bind String content to binary attributes and
> retrieve them as String. I don't have to do anything at the client side.  I
> need it because my xml content will be more than 64KB at times.   Is there
> any setting in the server.xml for binary attributes? if so please give me a
> sample or a link.    I used the "java.naming.ldap.attributes.binary" option
> in JNDI and was able to get the byte array (an image I stored). What I want
> is a similar setting where I would try to bind a String to an attribute
> whose types is binary.
We had that in ApacheDS 1.0, but we removed it, as we have a better way 
to detect if the attribute is binary or not. All our attributes are now 
defined as either String or Binary internally. When you define a new 
AttributeType, you have to define it as binary if you want it to be 
binary (the defaukt is String, AFAIR).
> I tried storing a sample byte array as follows: 'byte[] newValue = new
> byte[]{0x00, 0x01, 0x02, 0x03};' It was successful but, when I tried the
> following:
> byte[] newValue = new byte[]{0x3C, 0x3F, 0x78, 0x6D, 0x6C, 0x20} it
> FAILED!?? Why? 
I have no idea. Can you post the code you are using to demonstrate what 
you observe ?

cordialement, regards,
Emmanuel L├ęcharny

View raw message