Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Mohanraj.

Asked: January 18, 2018 - 2:07 am UTC

Last updated: January 23, 2018 - 2:05 am UTC

Version: 12c

Viewed 10K+ times! This question is

You Asked

Hi Tom,

I want to open Apex Application in New Window or New Tab through Oracle EBS Home page. I have tried with different method and finally came up with solution based on below link

https://asktom.oracle.com/pls/apex/asktom.search?tag=making-a-url-call-in-plsql

And i am calling below procedure through EBS and it was working fine at first time for one day later am encountering error with same code without changing any settings.

Error: The webpage cannot be found HTTP 404 (Actually the page working fine when we launch separately)

/*CREATE OR REPLACE PROCEDURE TEST_APEX_LAUNCH
IS
BEGIN
htp.htmlOpen;
htp.BodyOpen;

htp.p(utl_http.request('My APEX URL'));
htp.BodyClose;
htp.htmlClose;
END; */


Am using (SSWA plsql function that opens a new window (Kiosk Mode)) as function type in EBS.
We are using Oracle EBS R12 and Apex 5.0.3.


Am i approaching a right way or do we have any alternative solution for this?

Thanks in Advance.

Regards,
Mohanraj A R

and Chris said...

A HTTP 404 is a response from the web server. So your code is making an external call. But the web server can't find the URL you've passed!

The obvious answer is there's something different in how the code constructs the URL and what happens when you type is in your browser...

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Passing Static URL

A reader, January 22, 2018 - 10:07 am UTC

Hi Chris,

Here we are not constructing an URL dynamacially, We are just trying to pass an existng web address through the utl_http.request(' http://www.google.com' ).

The same code is working fine at first time later its giving error.

Please suggest how to achieve this?

Thanks,
Mohanraj A R
Connor McDonald
January 23, 2018 - 2:05 am UTC

A "request" does not retrieve all of the content from a website - it simply opens a channel to perform subsequent operations. To get the content, you need to explicit get it, eg

SQL> set serverout on
SQL> declare
  2    l_url            varchar2(100) := 'http://www.oracledba.co.uk';
  3    l_req   utl_http.req;
  4    l_resp  utl_http.resp;
  5    l_text           varchar2(32767);
  6  begin
  7    l_req  := utl_http.begin_request(l_url);
  8    l_resp := utl_http.get_response(l_req);
  9
 10    -- loop through the data coming back
 11    begin
 12      loop
 13        utl_http.read_text(l_resp, l_text, 32766);
 14        dbms_output.put_line(l_text);
 15      end loop;
 16    exception
 17      when utl_http.end_of_body then
 18        utl_http.end_response(l_resp);
 19    end;
 20  end;
 21  /


More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library