Re: ERR_03039 : the given requestID is not an integer

2019-11-29 Thread Emmanuel Lécharny

Hi Malo

On 29/11/2019 11:16, Malo Toudic wrote:

Hi all,

Is there any reason why the requestID need to be an integer in a 
batchRequest ? When using a string the following error is returned :


"ERR_03039 the given requestID is not an integer"



The requestID has to be an integer, but inside a string, like "12345".

The error you're getting is due to some bad string, like "12AGH", for 
instance.



The code that produces this error :

    /**
 * Parses and verify the parsed value of the requestID
 *
 * @param attributeValue the value of the attribute
 * @param xpp the XmlPullParser
 * @return the int value of the resquestID
 * @throws XmlPullParserException if RequestID isn't an Integer and 
if requestID is below 0

 */
    public static int parseAndVerifyRequestID( String attributeValue, 
XmlPullParser xpp ) throws XmlPullParserException

    {
    try
    {
    int requestID = Integer.parseInt( attributeValue );

    if ( requestID < 0 )
    {
    throw new XmlPullParserException( I18n.err( 
I18n.ERR_03038, requestID ), xpp, null );

    }

    return requestID;
    }
    catch ( NumberFormatException nfe )
    {
    throw new XmlPullParserException( I18n.err( I18n.ERR_03039 
), xpp, nfe );

    }
    }

As you can see, we expect a string containing an integer.

You have to check the content of your DSML request.



I'm using org.apache.directory.api:api-all:1.0.0 from Maven. I also 
verified the source code of the last version of api-all and the method 
verifying the requestID format is the same.



FTR, the 1.0.3 version is out since april, and it contains many fixes 
since 1.0.0, which is 2 years old already...




-
To unsubscribe, e-mail: api-unsubscr...@directory.apache.org
For additional commands, e-mail: api-h...@directory.apache.org



ERR_03039 : the given requestID is not an integer

2019-11-29 Thread Malo Toudic

Hi all,

Is there any reason why the requestID need to be an integer in a 
batchRequest ? When using a string the following error is returned :


"ERR_03039 the given requestID is not an integer"

I'm using org.apache.directory.api:api-all:1.0.0 from Maven. I also 
verified the source code of the last version of api-all and the method 
verifying the requestID format is the same.


In the DSMLv2 schema 
(https://www.oasis-open.org/committees/dsml/docs/DSMLv2.xsd) the 
requestID is of type xsd:string :






I don't see anywhere in the DSMLv2 specification a constraint that 
stipulate the requestID must be an integer.


Regards,

Malo Toudic

-
To unsubscribe, e-mail: api-unsubscr...@directory.apache.org
For additional commands, e-mail: api-h...@directory.apache.org