On Thu, Sep 18, 2014 at 1:52 AM, Morris, Chris <[email protected]>
wrote:
> To whom it may concern,
>
> I am working through the User's Guide, and some of the code examples that
> you have in "2.2-binding-unbinding" shows the following:
>
> @Test
> public void testAnonymousBindRequest() throws Exception
> {
> BindResponse bindResponse = connection.bind();
>
> assertNotNull( bindResponse );
> assertEquals( ResultCodeEnum.SUCCESS,
> bindResponse.getLdapResult().getResultCode() );
> assertTrue( connection.isAuthenticated() );
> }
>
> The problem is that I am getting an error on the "BindResponse
> bindResponse = connection.bind();" line stating, "cannot convert from type
> void to BindResponse." So, does connection.bind() not return anything,
> because that is my assumption at this point. If that is true, than the
> above needs to be updated as well as the rest of that page. If that is not
> true, I literally have inserted this code into my program, so what am I
> doing wrong?
>
> the API was changed since this page was written,
change that to:
connection.bind();
and remove rest of the lines
but if you want to experiment with the rest of the assertions then
call bind with a BindRequest or call the bind with default credentials like
bind("uid=admin,ou=system", "secret")
Regards,
> Chris Morris
>
> ________________________________
>
> The information contained in this message, and any attachments, may
> contain privileged and/or proprietary information that is intended solely
> for the person or entity to which it is addressed. Moreover, it may contain
> export restricted technical data controlled by Export Administration
> Regulations (EAR) or the International Traffic in Arms Regulations (ITAR).
> Any review, retransmission, dissemination, or re-export to foreign or
> domestic entities by anyone other than the intended recipient in accordance
> with EAR and/or ITAR regulations is prohibited.
>
--
Kiran Ayyagari
http://keydap.com