Forum Stats

  • 3,872,586 Users
  • 2,266,452 Discussions
  • 7,911,259 Comments

Discussions

The requested URL /apex/wwv_flow.show was not found on this server .. help?

752596
752596 Member Posts: 180
edited Jul 26, 2011 1:13PM in APEX Discussions
Hi all, I'm trying to implement the tutorial here http://www.inside-oracle-apex.com/adding-captcha-to-your-oracle-apex-application/ and I'm trying to run the function he mentioned in step two:
CREATE OR REPLACE FUNCTION checkRecaptcha
  ( pPrivateKey IN VARCHAR2
  , pRemoteIP   IN VARCHAR2 := OWA_Util.get_cgi_env('REMOTE_ADDR')
  , pChallenge  IN VARCHAR2
  , pResponse   IN VARCHAR2
  )
  RETURN VARCHAR2
IS
    --
    vRequest      Utl_Http.req;
    vPostText     VARCHAR2(500);
    vResponse     Utl_Http.resp;
    vResponseText VARCHAR2(2000);
    vError        VARCHAR2(200);
BEGIN
    ----------------------------------------------------------------------------
    -- Build text for the post action.
    -- For a field description, see
    -- http://recaptcha.net/apidocs/captcha/
    ----------------------------------------------------------------------------
    vPostText :=
      'privatekey='||Utl_Url.escape(pPrivateKey, TRUE)||CHR(38)||
      'remoteip='  ||Utl_Url.escape(pRemoteIP,   TRUE)||CHR(38)||
      'challenge=' ||Utl_Url.escape(pChallenge,  TRUE)||CHR(38)||
      'response='  ||Utl_Url.escape(pResponse,   TRUE)||CHR(38)
    ;
    ----------------------------------------------------------------------------
    -- if you need to set a proxy, uncomment next line.
    ----------------------------------------------------------------------------
    /* Utl_Http.set_proxy('proxy.it.my-company.com', 'my-company.com'); */
    ----------------------------------------------------------------------------
    -- Send data to reCAPTCHA.
    ----------------------------------------------------------------------------
    vRequest := Utl_Http.begin_request
                  ( url    => 'http://api-verify.recaptcha.net/verify'
                  , method => 'POST'
                  );
    Utl_Http.set_header
      ( r     => vRequest
      , name  => 'Content-Type'
      , value => 'application/x-www-form-urlencoded'
      );
    Utl_Http.set_header
      ( r     => vRequest
      , name  => 'Content-Length'
      , value => LENGTH(vPostText)
      );
    Utl_Http.write_text
      ( r    => vRequest
      , data => vPostText
      );
    vResponse := Utl_Http.get_response(vRequest);
    IF vResponse.status_code = '200' -- the HTTP call was successful
    THEN
        Utl_Http.read_text(vResponse, vResponseText);
        -- Has the user entered a correct solution?
        IF vResponseText LIKE 'false%'
        THEN
            vError := SUBSTR(vResponseText, 7);
        END IF;
    ELSE
        vError := 'HTTP status: '||vResponse.status_code||'-'||vResponse.reason_phrase;
    END IF;
    --
    Utl_Http.end_response(vResponse);
    --
    RETURN vError;
END checkRecaptcha;
but it refuses to work. A popup box with a single button 'submit' appears. I press it and then I get this error:

Not found*
The requested URL /apex/wwv_flow.show was not found on this server


All my other functions and procedures run just fine without error. This particular one is the only one that doesn't run.

Has anyone encountered this before? How do I overcome it?

Thanks
-J
«13

Answers

  • Michel van Zoest
    Michel van Zoest Member Posts: 131 Blue Ribbon
    Assuming you are using Oracle 11g (if not, please specify your environment and it's versions).

    Have you added http://api-verify.recaptcha.net/verify to the ACL for the APEX user?
  • 752596
    752596 Member Posts: 180
    I'm using Application Express 3.2.1.00.10 or so the system says...

    Sorry, I don't understand the terminology :( what is the ACL and how should I add that URL? I've never seen it before.

    Thanks very much for your reply :)
    -J
  • Michel van Zoest
    Michel van Zoest Member Posts: 131 Blue Ribbon
    ACL is the Active Control List introduced in database 11g.

    To add a domain to that list for a certain user, you can use the small tutorial on this site: http://blog.whitehorses.nl/2010/02/09/apex-webservice-references-and-acl/
    Oracle has written some tutorials on that subject themselves. A search on OTN could help you find them.
    Michel van Zoest
  • 752596
    752596 Member Posts: 180
    Thanks Michel. I'm trying to follow that tutorial there - where do I run this particular script? In the SQL workshop? And if so, I get some errors about these variables not being declared. Any ideas?

    Thanks much
    -J
  • Michel van Zoest
    Michel van Zoest Member Posts: 131 Blue Ribbon
    edited Mar 10, 2010 9:05AM
    You should run those scripts as the SYS or SYSTEM user.

    But before we continue on this path; in my first reply I asked if you are on 11g. Are you?

    Use
    select * from v$version
    to see your version.

    Edited by: Michel van Zoest on Mar 10, 2010 3:04 PM
  • 752596
    752596 Member Posts: 180
    edited Mar 10, 2010 9:07AM
    ah, sorry about that. Yes, it seems that I am. Thanks again Michel :) Trying to run them as sys now.
  • 752596
    752596 Member Posts: 180
    whoops I am wrong! I just did that before you posted your reply.

    I'm on oracle 10G, not 11G. I had no idea. I know that I installed oracle XE from the start. It wouldn't work in firefox, so I upgraded it to apex 3 by installing some instructions I found. What do I do now, then?

    -J
  • Michel van Zoest
    Michel van Zoest Member Posts: 131 Blue Ribbon
    Ah, then it seems we have a very different problem. Hopefully someone else will come along to help, because most of my experience is with 11g. But I'll try to help anyway :)

    Maybe it has to do with rights your user has on the UTL_HTTP package, but then you would have a lot of other problems. I'll look into it for a bit and when I find something, I'll come back to you.
  • 752596
    752596 Member Posts: 180
    Thank you for all your help so far, I really appreciate it. I'll do some research on it myself :) Or maybe I'll just upgrade to 11g? How practical is that? or is it a headache and will lock out all my admin accounts?

    -J
  • Patrick Wolf-Oracle
    Patrick Wolf-Oracle Consulting Member of Technical Staff Posts: 2,461 Employee
    I think the reason for the error is a different one and doesn't have to anything to do with the procedure. I suspect the cause for the errors are the input fields.
    Please enable advanced error output by following the steps at

    http://www.inside-oracle-apex.com/oracle-apex-got-404-not-found-2/

    Regards
    Patrick
    Patrick Wolf-Oracle
This discussion has been closed.