13 Replies Latest reply on Jul 3, 2012 1:37 PM by Udo

    The role of ApEx listener

    895614
      Hello All,

      I want a few expert views on my understanding

      As far as I understand, mod_plsql is responsible for generating html outputs which the XML http server or OHA presents to the user.

      Now when we use ApEx listener, we are no longer using mod_plsql so I guess ApEx listener sends only the queries to the database. The database responds back with the result and the listener then generates the html page out of it and sends it back to the user. So as far as I understand, with the listener configuration, owa packages are no longer used.

      Please correct me if I am wrong

      Thanks
        • 1. Re: The role of ApEx listener
          Prabodh
          Hi,
          >
          As far as I understand, mod_plsql is responsible for generating html outputs which the XML http server or OHA presents to the user.

          Now when we use ApEx listener, we are no longer using mod_plsql so I guess ApEx listener sends only the queries to the database. The database responds back with the result and the listener then generates the html page out of it and sends it back to the user. So as far as I understand, with the listener configuration, owa packages are no longer used.

          >
          The above is rather inaccurate and incomplete description.

          Please read the What is the Oracle APEX Listener? on this page

          For understanding Oracle HTTP Server(OHS) please read this.

          If you start with wrong assumptions and premises you are very likely to come to wrong conclusions.
          Is your query related to the theoretical difference? Or, does this have any bearing to any real life situation? If it is a real situation it might be better if you describe it and you dilemma.

          Regards,
          • 2. Re: The role of ApEx listener
            895614
            Hi Probodh,

            My query is purely theoretical. I want to understand the exact role of the listener.

            Please point out the inaccuracies in my statement. I seek your kind help in understanding my mistake. I have gone through the documents which you have pointed out and I have written my conclusions in my post.

            Thanking you in anticipation of your help

            Regards
            • 3. Re: The role of ApEx listener
              895614
              http://www.oracle.com/technetwork/middleware/ias/index-091236.html

              The above link says that Oracle HTTP Server provides HTTP listener to weblogic server. If OHS is based on Apache and has all its modules then why cant we use the mod_plsql module in it to configure DAD just the way we do in OAS.

              Are there 2 possible ways to use weblogic for ApEx, one using mod_plsql and the other by hosting ApEx listener on it

              Please help
              • 4. Re: The role of ApEx listener
                Prabodh
                Hi,

                This may perhaps help you get some details.http://books.google.co.in/books?id=1UgGdLBM8VcC&pg=PA1&source=gbs_toc_r&cad=4#v=onepage&q&f=false
                There is no Whitepaper on this topic that I know of, yet.

                Regards,
                • 5. Re: The role of ApEx listener
                  895614
                  Prabodh,

                  The link talks mostly about the installation part and does discuss EPG and OAS in considerable detail. However the pages dealing with weblogic are not available in this preview. So it shares limited info on the exact tasks performed by apex listener

                  Thanks
                  • 6. Re: The role of ApEx listener
                    895614
                    Guys, any help is appreciated
                    • 7. Re: The role of ApEx listener
                      Udo
                      Hi,

                      I'm not sure I actually got what you are looking for, but I'll try to answer your question anyway.
                      Now when we use ApEx listener, we are no longer using mod_plsql so I guess ApEx listener sends only the queries to the database. The database responds back with the result and the listener then generates the html page out of it and sends it back to the user. So as far as I understand, with the listener configuration, owa packages are no longer used.
                      If you use APEX Listener, you don't need mod_plsql to make your APEX instance available to HTTP clients any longer, i.e., APEX Listener is a web server alternative to host your APEX.
                      Note that APEX itself is the main actor for generating HTML. OWA Packages will still be needed, as APEX Listener uses them as well. To quote the [url http://www.oracle.com/technetwork/developer-tools/apex-listener/overview/index.html]APEX Listener OTN homepage:
                      Can be used for Application Express or any Oracle web-toolkit application
                      I want to understand the exact role of the listener.
                      APEX Listener is the HTTP Server to handle HTTP client requests towards PL/SQL procedures, including the APEX framework (which in fact is the main target of APEX Listener).
                      Compared to mod_plsql, an APEX Listener instance would be the equivalent to a DAD, though there are some differences concerning some configuration features, e.g. APEX Listener doesn't have the CGI-Environment available in mod_plsql, whereas mod_plsql doesn't offer functionality like Resource Templates directly.
                      The above link says that Oracle HTTP Server provides HTTP listener to weblogic server. If OHS is based on Apache and has all its modules then why cant we use the mod_plsql module in it to configure DAD just the way we do in OAS.

                      Are there 2 possible ways to use weblogic for ApEx, one using mod_plsql and the other by hosting ApEx listener on it
                      Exactly. You could even use both alternatives (OHS/mod_plsql and WLS/APEX Listener) at the same time. So you can still use mod_plsql if you want to, but it seems to be a discontinued technology for Oracle - it still is available, but future releases will probably come without it, so support will end sooner or later.

                      -Udo
                      1 person found this helpful
                      • 8. Re: The role of ApEx listener
                        895614
                        Hi Udo,

                        Many thanks for this awesome answer.

                        I guess my question was not properly worded and this was because I had an impression that mod_plsql itself generates the HTML code which is then put on the client's browser through the webserver. However, this doubt was cleared in the following thread

                        Re: The role of ApEx listener

                        I now understand that mod_plsql actually uses the OWA web tool kit to generate the HTML. It is probably like some central node which calls the right functions in web toolkit to get the HTML

                        Now that you have cleared my doubt about the presence of mod_plsql in weblogic, I will try to come up with a demonstration of configuring the ApEx DAD on weblogic and share it with the rest of the world on my blog.

                        I however have a few more doubts and I seek your kind help in these
                        1. I have installed ApEx listener on weblogic and I executed the following anonymous plsql block from sql workshop

                        begin
                        owa_util.print_cgi_env();
                        end;

                        I could see all the environment variables. Please explain this paradox

                        2. Could you also elaborate on your following statement
                        Udo wrote:
                        APEX Listener doesn't have the CGI-Environment available in mod_plsql
                        -Udo
                        Does this mean that ApEx listener also has mod_plsql

                        3. I have read in many places that ApEx's EPG configuration is only possible in version 11G but the database homepage is ApEx and it is using the XML HTTP protocol server because I was able to change the port of the database homepage using the following code. So if it is there then why cant it be used

                        begin
                        DBMS_XDB.sethttpport (8082);
                        end;



                        Thanks again for a wonderful answer

                        Regards

                        Edited by: 892611 on Jun 30, 2012 5:46 AM
                        • 9. Re: The role of ApEx listener
                          MortenBraten
                          I now understand that mod_plsql actually uses the OWA web tool kit to generate the HTML. It is probably like some central node which calls the right functions in web toolkit to get the HTML
                          Actually, all this is well-documented and the Oracle docs go into great detail about how this works:

                          http://docs.oracle.com/cd/B14099_19/web.1012/b14010/concept.htm


                          +"As a plug-in to Oracle HTTP Server, mod_plsql causes stored procedures to be executed in response to HTTP requests. For each URL that is processed, mod_plsql either uses a database session from its connection pool, or creates a new session on the fly and pools it. For mod_plsql to invoke the appropriate database PL/SQL procedure in a URL-processing session, you must first configure a virtual path and associate that path with a Database Access Descriptor (DAD)."+

                          +"To develop the stored procedures that are executed by mod_plsql at runtime, you use the PL/SQL Web Toolkit: a set of PL/SQL packages that can be used to obtain information about an HTTP request; specify HTTP response headers, such as cookies, content-type, and mime-type, for HTTP headers; set cookies; and generate standard HTML tags for creating HTML pages."+


                          +"The following scenario provides an overview of what steps occur when a server receives a client request:+

                          +1. The Oracle HTTP Server receives a request containing a virtual path, which is configured to be serviced by mod_plsql.+

                          +2. The Oracle HTTP Server routes the request to mod_plsql.+

                          +3. By using the configuration information stored in your DAD, mod_plsql connects to the database. The request is forwarded by mod_plsql to the Oracle Database.+

                          +4. mod_plsql prepares the call parameters, and invokes the PL/SQL procedure in the application.+

                          +5. The PL/SQL procedure generates an HTML page using data and the PL/SQL Web Toolkit accessed from the database.+

                          +6. The response is returned to mod_plsql.+

                          +7. The Oracle HTTP Server sends the response to the client browser."+

                          The Apex Listener works the same way as mod_plsql, except that it is written in Java and is meant to be hosted in a Java-based webserver instead of Apache/OHS.

                          Application Express (Apex) uses the PL/SQL Web Toolkit (ie the OWA packages such as HTP, OWA_UTIL, etc) to generate HTML output. In other words, Apex is built on top of the PL/SQL Web Toolkit and depends on it to work.

                          - Morten

                          http://ora-00001.blogspot.com
                          1 person found this helpful
                          • 10. Re: The role of ApEx listener
                            895614
                            Hi Udo,

                            I am a little confused now.

                            http://www.oracle.com/technetwork/middleware/ias/index-091236.html says that OHS is a component of Weblogic but https://blogs.oracle.com/cloudappfoundation/entry/oracle_weblogic_server_12c_launch says that Oracle HTTP SErver 11g is certified with WebLogic Server 12c and the PLSQL gateway will work via that route. I guess that being " certified with WebLogic Server 12c" means that we can use OHS plugin if we want to use PLSQL gateway. Is my guess correct? If yes, then the question is, why cant we use the PL SQL gateway of OHS in weblogic. If there is already an OHS in weblogic then what does the plugin do?

                            Thanking you in anticipation of your help

                            Regards
                            • 11. Re: The role of ApEx listener
                              Udo
                              Hi,

                              I think we're getting off-topic now, since your new questions merely concern WLS/OHS, not APEX Listener...
                              Anyway, I'll try to give you an answer here.
                              http://www.oracle.com/technetwork/middleware/ias/index-091236.html says that OHS is a component of Weblogic but https://blogs.oracle.com/cloudappfoundation/entry/oracle_weblogic_server_12c_launch says that Oracle HTTP SErver 11g is certified with WebLogic Server 12c and the PLSQL gateway will work via that route.
                              It can be a little confusing, but your quote is slightly inaccurate: OHS 11g is a component of OFM, not a part of Weblogic. Weblogic itself is another component in OFM, and you can combine both (i.e., use OHS as a HTTP Listener for WLS). The second document concerns just WLS 12c, not a complete middleware suite like OFM. It states, that you can (still) use OHS 11g as a HTTP Listener for WLS 12c.
                              I guess that being " certified with WebLogic Server 12c" means that we can use OHS plugin if we want to use PLSQL gateway. Is my guess correct?
                              Yes.
                              If yes, then the question is, why cant we use the PL SQL gateway of OHS in weblogic. If there is already an OHS in weblogic then what does the plugin do?
                              As I've mentioned earlier, you can still use mod_plsql (PL/SQL Gateway) on OHS in front of WLS. The OHS Plug-In for WLS is for OHS configuration, etc.. I start to believe you've mixed up APEX Listener with that OHS Plug-In for WLS. See the corresponding [url http://docs.oracle.com/cd/E14571_01/web.1111/e16435/oracle.htm#CIABDFBJ]documentation for WLS Plug-Ins for details on the OHS Plug-In.
                              APEX Listener is an alternative to mod_plsql, e.g. if you don't have or don't want an OHS in front of your JEE Server (be it WLS or any other).

                              -Udo
                              • 12. Re: The role of ApEx listener
                                895614
                                Thanks a ton, Udo.

                                All clouds are now cleared and I can see the light of the day again

                                Let me pen my understanding again

                                1. Weblogic is a J2EE webserver and does not have mod_plsql or OHS

                                2. Weblogic and OHS are both parts of Fusion middleware and OHS can be configured in front of weblogic if required.

                                3. Apex listener is a J2EE substitute to mod_plsql and does exactly the same functions as mod_plsql

                                Thanks again for all your patience and time to answer my question.

                                Regards,
                                • 13. Re: The role of ApEx listener
                                  Udo
                                  Let me pen my understanding again:
                                  [...]
                                  I couldn't have summarized it better. ;)
                                  (Just that you don't say "J2EE" anymore these days but JEE instead, but somewhat narrow-minded...)

                                  -Udo