cancel
Showing results for 
Search instead for 
Did you mean: 

CAPTCHA_Functionality

Former Member
0 Kudos

Hi,

We are implementing E-Recruitment.As a part of that for external candidate registration we are planning to implement

CAPTCHA_Functionality.

is it possible to do this in WDA .if yes please give me some inputs

Thanks

Bala Duvvuri

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The generation of the Captcha key would have to be done externally. I would suggest that to have any chance you should start by reading these documents from Eddy De Clercq:

[/people/eddy.declercq/blog/2005/09/13/die-mensch-maschine|/people/eddy.declercq/blog/2005/09/13/die-mensch-maschine]

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4e539c30-0501-0010-3291-a4c4193a6414|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4e539c30-0501-0010-3291-a4c4193a6414]

The sample would have to be adjusted from BSP to Web Dynpro. Not sure how easy that would be. Also he uses a PHP script to actually generate the image. The logic to generate the public keys would still all be valid for Web Dynpro ABAP however. WDA being stateful, you wouldn't necessarily have to use the server cookies either - as the keys could just be stored in the context.

joachimvanpraet
Active Participant
0 Kudos

Hi,

I created a blogpost for using captcha in ABAP WD:

http://scn.sap.com/community/web-dynpro-abap/blog/2012/12/11/using-captcha-in-abap-webdynpro

kr,

Joachim

Former Member
0 Kudos

Hi

I have followed the link what u have posted ,but unable to display the captcha image ,

I can view the captcha value in the text view but not as an image .

please find my present post abt this http://scn.sap.com/thread/3394620

its giving this FM out dated

" generate an url
   CALL FUNCTION 'GUID_CREATE'
     IMPORTING
       EV_GUID_32 = lv_guid.

Thanks & Regards

Deepika

joachimvanpraet
Active Participant
0 Kudos

Deepika,

This should work.

Can you test this function module in se37?

Is your lv_guid type GUID_32?

Can you send me a screenshot of st22 with the source code extract?

kr,

Joachim

Former Member
0 Kudos

Hi Joachim

I am using GUID_32 and that function module is working fine in se37 .

But lv_url is returning Null value ,

I am attaching the dump as well as output .

This captcha is displayed in the textview ,i binded that image attribute to text view UI element its displaying the dynamic value but the same is not displayed in the Image UI element .

please find the screens .

Thanks & Regards

Deepika

joachimvanpraet
Active Participant
0 Kudos

hi,

I think your problem occurs before the GUID_CREATE function.

The problem is situated here:

CALL METHOD lo_http_client->request->set_header_field 

    EXPORTING 

      name  = '~request_uri' 

      value = iv_url. 

Please put an external breakpoint on this line and check the value of iv_url.

This value should contain the path to your captcha image on the j2ee server.

kr,

Joachim

Former Member
0 Kudos

Hi Joachim

Here these are the values getting in the following fields

lv_url------------/captcha/captcha.png?captcha=ilOeFBlz---------------in get_cached_url method

iv_url ----------/captcha/captcha.png?captcha=ilOeFBlz

lv_url -------------/sap/bc/webdynpro/sap/ztestcapt

/B4B52F5397081ED2BDBACA4894224026150232.png-----------------in generate_captcha method.

and in the lv_image I am getting  this value 3C68746D6C3E3C686561643E3C7469746C653E4170706C69636174696F6E20536572766572204572726F723C2F7469746C653E3C2F686561643E3C626F64793E0D0A3C48323E3C623E343034205265736F75726365206E6F7420666F756E643C2F623E3C2F48323E3C62723E506172746E6572206E6F7420726561636865643C62723E3C62723E0D0A4572726F72206973206C6F676765642077697468205461673A207B30303033333761397D3C62723E3C68723E0D0A467269204A756C2032362031353A30303A343620323031330A0D0A3C2F626F64793E3C2F68746D6C3E0D0A

But in two cases sy-subrc is failed .

I am attaching the screen shots of the same .

Thanks & Regards

Deepika

joachimvanpraet
Active Participant
0 Kudos

Hi Deepika,

If available try to use method GUID_CREATE from the class CL_RECA_GUID.

kr,

Joachim

Former Member
0 Kudos

Hi joachim

I have used above class and there are no error related to GUID_create method ,but the value of the image is coming in this format ' B4B52F5397081EE2BEFFE0AC7E614631'

and same in the is comming in ov_url parameter

ov_url =/sap/bc/webdynpro/sap/z_captcha/B4B52F5397081EE2BEFFC2D9F2870606105931.png

Binded the UI elements as per the docu

An image and bind the source property to attribute IMAGE af the CAPTCHA node.

     b.      An input field and bind the property value to attribute ANSWER of the CAPTCHA node.

Is this value is correct what I am getting and image is not getting displayed

and in st22 no dump is raised .

I am attaching the screen shot along with url .

Can you please reply in which step I am making mistake .

Thanks & Regards

Deepika

joachimvanpraet
Active Participant
0 Kudos

Deepika,

The generated URL's are correct. Probably there is something wrong in the connection from your ABAP server to the java server.

Is the java part working correctly?

IS the webdynpro generating the correct url to the java part?

Try to run the same url on the server. Is it resolving the correct image?

The Abap webdynpro is reading the image from the java server in its cache and then displays this image in the webdynpro.

kr,

Joachim

Former Member
0 Kudos

Hi Joachim

Can you please provide me the WDJAVA functionality with screen shot and step by step process unable to get the steps what is posted in the wdjava .

Awaiting for your quick response

Thanks & Regards

Deepika.

Former Member
0 Kudos

Hi Joachim

Instead of developing WebdynproJava ,I have deployed the standard .ear file which is  given in the link .

LocalDevelopment~captcha~ear~flexso.com.ear

but still I am unable to view the image .

application  in portal .

portal url :

http://xxxx:51000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fNIITHome!2fCaptcha!2fZ_CAPTC...

But here I am unable to get the Z_captcha = to some value.

As per the wdjava file deployment

http://<portalserver>:<port>/captcha/captcha.png?captcha=test

captcha=test

But in my link I dnt find any such value assigned .

Do I need to pass any Application parameters in the WDABAP iview .

Could please help me how to find out the error to resolve the above issue

Thanks & Regards

Deepika

Former Member
0 Kudos

Hi

webdynpro java application not working fine ,I deployed the .ear file of the captcha.

But when  I test the wdabap app from portal the image is not getting displayed in portal .

Thanks & Regards

Deepika

Former Member
0 Kudos

Hi Joachim

Thanks for your help .

I am able to get the out put now .

Thanks & Regards

Deepika

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey Bala,

did you find any solution to implement a Captcha into WDA without BSP and without Java?

Thanks & greets,

Steffi