Use utl_http.request,how to replace '&'  in http address?

There are some '&' in http address,as utl_http.request paramater,for example,
dd:=utl_http.request('http://127.0.0.1:7778/forms/frmservlet?config=test&form=test_form.fmx');
will raise error. I want to replace the character '&',How to replace it?

Hi,
I am using : ..'%26param'.. for '&param'
Hope it helps,
Friedhold

Similar Messages

  • Run a report in PL/SQL using utl_http.request

    Hi
    I need to run a report in PL/SQL using utl_http.request
    How that can be done ??
    Thank you!

    Okay, backtrack.
    A web server can deliver all kinds of content. From static HTML pages, to XML files and videos and dynamic content. Including reports.
    The communication language (protocol) used to talk to a web server is HTTP.
    UTL_HTTP is an Oracle PL/SQL library that implements the client side of this communication. It allows the developer to write code that acts like a web browser and communicates with a web server.
    Now what do you not understand and cannot use?
    HTTP is not simple and easy. You need to understand the basics of this communication language in order to communicate successfully with the web server. Like knowing the difference between GET and PUT and POST commands, how the URL query string works and so on.
    Once you know that, you can look at how the web server provides reports. How do you authenticate as a web browser with the web reporting system? What URLs do you use to access which reports? How do you pass name-values to the web server as report parameters? What HTTP response formats (MIME types) does the web report server provide? Which one do you plan to use and how do you parse that response into a meaning structured data format?
    If you're thinking it is "easy", think again. Sure, someone here can provide sample code that for example grabs a CSV report file from a web server and (using a pipeline table function), turn that into rows and columns. But that will not teach you the fundamentals you need to know and not equip you with dealing with the problem with your own brains, hands and keyboard.
    PS. In other words, learn to crawl and walk before trying to run. Get to grips with how HTTP works before diving into the deep end of web report integration.

  • How to Display PHP Output as Portlet in HTML Region using utl_http.request

    I wanted to be able to parse PHP functions to add more functionality to my Page. nothing fantasy, something simple like: http://phpsysinfo.sourceforge.net/phpsysinfo-dev/?template=classic
    Where the realtime values are retrieved from the OS. this represent some kind of problem to me, I know how to do it from Shell Script, Perl or PHP, but not from PL/SQL.
    Based on my experience using Oracle Portal, Portlets, I think we really can make use of the feature used in Portal called Web Clipping. [ This feature basically goes to some Site a retrieve part of the site to show in the current page]. Well the PL/SQL utility utl_http.request does something similar.
    Make sure your request page does not retrieve some headers because that would cause a problem in your page and will not show up.
    This is what I did:
    <b> 1.- </b> Grant Privileges to execute [ <b> utl_http.request </b> ] to the owner of your schema.
    login into the OracleXE / APEX as SYS then go to the Object Navigator, then click on packages, find the utl_http.request then click on it, later click on grant and select your schema owner for your applicaion.
    <b> 2.- </b> Logout as SYS then login as your application schema user. just to test the functionality go to the sql command then enter the following command and then click run:
    <b> select substr(utl_http.request('http://www.oracle.com/'),1, 255) from dual; </b>
    If your output is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Oracle 10g, Siebel, PeopleSoft | Oracle, The World's Largest Enterprise Software Company</title> <meta name="title" content="Enterprise Applications | Database | Fusio
    <font color='blue'> Wow It worked </font>, this really could be useful !!, If not go back to step 1 and check your permissions to execute, or perhaps your Internet connectivity.
    3.- Once we know the package works and we can retrieve content from the Internet. lets go to some of our pages add some HTML Region.
    4.- Create an item and put into the new region. the source will be SQL, For the purposes of my test the query to the Oracle Page failed, so I decided to give a shot with a simple PHP script with no headers.
    The internal server is: http://mytest.com/hello_world.php
    Where the content of the hello_world.php is:
    <?
    echo '"<b> Hello World </b> ";
    ?>
    This PHP works fine and display the basic Hello World. can be the same server or not, also noticed this can be another port perhaps using something like Ruby,Mason or Java.
    <b> 5.- </b> Finally in my Item the source type is SQL and looks like this:
    <b> select substr(utl_http.request('http://mytest.com/hello_world.php'),1, 255) from dual; </b>
    Apply the changes and run the page !!!
    Excelent It worked as expected. now you know how use utl_http.request to create webclipping in your OracleXE / APEX from remote pages, or how to use it to parse the output from CGI, Perl, PHP, Ruby or Java pages.
    Note: [ Just make sure to strip the headers or parse into a PL/SQL Procedure to clean then show ]
    Best Regards <b> Dino </b>.
    Brains R Like Books only work when they R Open.
    http://www.htmldbhosting.com/

    Sorry, from your post in the LabVIEW board I did not understand that it was the Output message that you were looking for.
    I thought you wanted the results from your test steps displayed on the user interface. 
    It is the “Output Panel” in the sequence editor that displays your output message, but I do not know if there is default Output panel activeX indicator for user interface that the TestStand engine would update automatically like it does the execution view.
    Maybe someone else knows 
    As also pointed out, the UI messages is your other option.
    The Output Message event number is 40 
    http://zone.ni.com/devzone/cda/epd/p/id/3879
    UIMsg_OutputMessages–(Value: 40) TestStand sends this message at periodic intervals when it holds references to output messages that calls to the OutputMessage.Post method queue. TestStand transfers the queued messages to an OutputMessages collection attached to the UIMessage.ActiveXData property for this event. An application that processes output messages should copy the output message references from the collection in UIMessage.ActiveXData to its own private OutputMessages collection by passing its private collection to the OutputMessages.CopyMessagesToCollection method. An application calls the Engine.NewOutputMessages method to create a private OutputMessage collection. TestStand generates this event only if the Engine.OutputMessagesEnabled property is True. Because there can be more than one handler for this event, the application should not modify the OutputMessages collection the UIMessage.ActiveXData property holds.
    Omar
    Message Edited by OmarGator on 10-09-2008 10:12 AM

  • Error while using utl_http.request :ORA-12535: TNS:operation timed

    Hi.
    I'm using 11g
    I'm trying to use utl_http.request
    I tried select utl_http.request('http://srvab.us.oracle.com') from dual;
    and get the below error
    Error report:
    SQL Error: ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1577
    ORA-12535: TNS:operation timed out
    ORA-06512: at line 1
    29273. 00000 - "HTTP request failed"
    *Cause:    The UTL_HTTP package failed to execute the HTTP request.
    *Action:   Use get_detailed_sqlerrm to check the detailed error message.
    Fix the error and retry the HTTP request.
    I have tried the below steps after checking Oracle KM
    BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl => 'ACL_OPSLOG.xml',
    description => 'ACL SRVAP AUTOSR PURPOSES',
    principal => 'username',
    is_grant => true,
    privilege => 'connect',
    start_date => null,
    end_date => null );
    COMMIT;
    END;
    BEGIN
    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
    acl => 'ACL_OPSLOG.xml',
    host => '*.us.oracle.com',
    lower_port => null,
    upper_port => null);
    COMMIT;
    END;
    But still no luck.Please assist
    Thanks
    Archana

    According to the exception, the error is not ACL related, but network related.
    Basic test. Connect to the Oracle server using a console (e.g. ssh or telnet into the server). On that server, test the network connectivity to the web server. E.g.
    telnet srvab.us.oracle.com 80If this fails, then so will PL/SQL code in that Oracle server.

  • Unable to receive special characters in XML using UTL_HTTP request from Other application

    Hi Team,
    We are using SOAP request in Oracle Application to Pull XML data from Other application.I am using below commands before receving response but still i am unable to receive special charcters/Spanish Charcters in XML.
    utl_http.set_body_charset(v_http_req, 'UTF-8');
    utl_http.set_header (v_http_req, 'Content-Type', 'text/xml');
    Thanks and Regards,
    Raghul

    Hello,
    Just when you think that you know everything, it is slammed in your face that you don't. The .Mac member name field in the System Preferences DOES NOT take your whole e-mail address. It only takes your user name or whatever comes BEFORE the "@" symbol. There was absolutely nothing wrong with my MacBook Pro (other than ther brain dead user).
    Sorry for wasting your time...
    If we learn from our mistakes, then I obtained my PhD years ago,
    Dr. Z.

  • How to replace the email address of Apple ID?

    My Apple ID to be an icloud email address, but I wish to use my own email address to replace this icloud email address.. How?

    You cannot change an iCloud.com apple id email.
    You can add your own email as a secondary email.

  • How to perform authentication on proxy using utl_http package?

    Hi,
    I am using Oracle 8i database (ver:8.1.7). I want to use the utl_http package to perform http requests. Within my company, I am forced to use a proxy and I have to be authenticated on that proxy. How can I authenticate myself on the proxy using utl_http.request function on Oracle 8i?
    Thanks a lot.
    Paulo.

    UTL_HTTP
    The UTL_HTTP package makes Hypertext Transfer Protocol (HTTP) callouts from SQL and PL/SQL. You can use it to access data on the Internet over HTTP.
    With UTL_HTTP, you can write PL/SQL programs that communicate with Web (HTTP) servers. UTL_HTTP also contains a function that can be used in SQL queries. The package also supports HTTP over the Secured Socket Layer protocol (SSL), also known as HTTPS, directly or through an HTTP proxy. Other Internet-related data-access protocols (such as the File Transfer Protocol (FTP) or the Gopher protocol) are also supported using an HTTP proxy server that supports those protocols.
    When the package fetches data from a Web site using HTTPS, it requires Oracle Wallet Manager to set up an Oracle wallet. Non-HTTPS fetches do not require an Oracle wallet.
    See Also:
    Chapter 102, "UTL_URL"
    Chapter 100, "UTL_SMTP"
    Oracle Advanced Security Administrator's Guide for more information on Wallet Manager
    This chapter discusses the following topics:
    UTL_HTTP Constants, Types and Flow
    UTL_HTTP Exceptions
    UTL_HTTP Examples
    Summary of UTL_HTTP Subprograms
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_http.htm#ARPLS070
    Joel P�rez

  • How to Create a Dynamic http address that opens the Explorer Window for a List Item When a Button Is Clicked--Currently Trying to Make this Work with Javascript

    I have created a button (via Content Editor) that uses JavaScript to open the Attachments folder of a list item in the Explorer Window in SharePoint 2010. The purpose is to have drag and drop functionality for each list item, having multiple attachments.
    The button works but opens the "Attachments" folder containing all of the other folders for each list item (one folder per item). It seems that when you add an attachment to a list item, SharePoint numbers the folder based on the item's ID. What
    I'm trying to do is take the JavaScript I have and have it run when a button is clicked in a custom form. When it runs, I'm trying to get it to open the "specific" folder for the list item. I have had success creating a hyperlink in the list that
    does this; however, the link WILL NOT work until I use the Content Editor created button that runs JavaScript, that prompts me to click OK to my profile certificate, and then opens the Attachment folder. After that occurs, I can use my hyperlinks without issue
    because I'm no longer prompted to click OK for my cert.
    So I'm trying to take the JavaScript I have and place it in a list item form (custom form) and have it run when a form button is clicked. The problem is I have very little knowledge of JavaScript (did I mention little?) and
    "don't know how to take the "http:" address I have in the script and append to it the list item ID, according to the record I have open."
    So that for any record I open, the script will grab the corresponding record ID (or list item ID) and append it.
    Here's the script I'm working with (which I didn't create but am grateful for):
    <style>
    .httpFolder {behavior:url(#default#httpFolder);}
    </style>
    <script text = "javascript">
       function fnOpenFolderView(){
       oDAV.navigateFrame("https://server/collection/site/subsite/Lists/Sublist/Attachments","_self");
    </script>
    <div id = "oDAV" class = "httpFolder"/>
    <input type = "button" value = "Open Attachment Folder" onclick = "fnOpenFolderView()"/>
    The above script, in the Content Editor, creates a button that opens the Attachments folder for the corresponding SharePoint list.
    JackSki123

    Hello Thriggle,
    Thank you for pointing that out. I appended your "GetUrlKeyValue" to the end and it worked. That said, I noticed it doesn't run as smoothly as when I simply click on the Content Editor button I created that resides on the SharePoint List
    ASPX page (not the form). The Content Editor button has the same code, minus the "GetUrlKeyValue". I click it; I get prompted to choose my cert; it opens right up.
    Now go to the ASPX Display form where I dump the code in a table cell. Button appears in cell; I click it; wait; wait; I get prompted for cert; it opens. Do I need some sort of "throttle" for the JavaScript? For instance, I thought before running
    JavaScript, you reference the library first. This code doesn't do that. I'm wondering if there's something more I need to make this run smoothly. Thank you both for getting me this far. 
    JackSki123

  • Customers using service requests

    Hi all,
    please clarify my following doubts:
    1. I want to know who are all the customers who are using service requests, how?
    2. Are all the customers in ar_customers eligible for using service requests?
    if not ,
    (A) what is the criteria?
    (B) where are we specifying the criteria in crm?
    kindly reply soon
    --regards
    --raj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Thanq Sudeep
    --reg
    --RAJ                                                                                                                                                                                                                                       

  • How to send a https request using jsf

    hi
    Can anybody tell a sample how to send a https request using JSF ...
    thanks

    Prefix the request URI with the https protocol.
    The answer is too easy and straightforward that I guess that you mean something else. If you just want to know how to configure an SSL environment for your own webapplication, refer to the Java EE tutorial chapter 28: http://java.sun.com/javaee/5/docs/tutorial/doc/

  • How to send XML using UTL_HTTP

    I am trying to workout how to send XML data to a webserver using UTL_HTTP but am not getting any reply
    I need to submit the following XML document to a server "http://api.fastsms.co.uk/api/xmlapi.php"  Their instructions are "The XML Document should be posted unencoded, with a UTF-8 character set as parameter 'xml'"
    If I submit the following XML on their test form
    <?xml version="1.0"?>
    <apirequest version="1">
    <user>
      <username>**USER**</username>
      <password>**PASSWORD**</password>
    </user>
    <application>
      <name>Example Application</name>
      <version>1.0</version>
    </application>
    <inboundcheck lastid="10711399"/>
    </apirequest>
    I get an XML response back with the messages in my inbox. 
    This is the code I am trying to use to accomplish the same from PL/SQL : I know a response is coming back as there is header information - just no content.  What am I doing wrong ?
      l_xml VARCHAR2(5000);
      req utl_http.req;
      resp utl_http.resp;
      header_name VARCHAR2(256); -- Response header name
      header_value VARCHAR2(1024); -- Response header value
      response_text VARCHAR2(4000); -- Response body
      l_url VARCHAR2(100);
    BEGIN
      l_xml := 'xml=<?xml version="1.0"?>';
      l_xml := '<apirequest version="1">';
      l_xml := '<user>';
      l_xml := '<username>**USER**</username>';
      l_xml := '<password>**PASSWORD**</password>';
      l_xml := '</user>';
      l_xml := '<application>';
      l_xml := '<name>Example Application</name>';
      l_xml := '<version>1.0</version>';
      l_xml := '</application>';
      l_xml := '<inboundcheck lastid="10711399"/>';
      l_xml := '</apirequest>';
      -- Open HTTP connection
      l_url := 'http://api.fastsms.co.uk/api/xmlapi.php';
      req := utl_http.begin_request(l_url,'POST',utl_http.HTTP_VERSION_1_1);
      -- Set headers for type and length
      utl_http.set_header(req,'Content-Type','application/x-www-form-urlencoded');
      utl_http.set_header(req,'Content-Length',to_char(length(l_xml)));
      -- Write parameter
      utl_http.write_text(req,l_xml);
      -- Read response file
      resp := utl_http.get_response(req);
      -- Print out the response headers
      FOR i IN 1 .. utl_http.get_header_count(resp) LOOP
        utl_http.get_header(resp,i,header_name,header_value);
        logging_pkg.info(header_name || ': ' || header_value);
      END LOOP;
      -- Print out the response body
      BEGIN
        LOOP
          utl_http.read_text(resp,response_text);
          logging_pkg.info(response_text);
        END LOOP;
      EXCEPTION
        WHEN utl_http.end_of_body THEN
          logging_pkg.info('End of body');
      END;
      -- close http connection
      utl_http.end_response(resp);
      EXCEPTION
        WHEN utl_http.end_of_body THEN
          utl_http.end_response(resp);
    END;
    Cheers,
    Brent

    Hi Billy
    Yikes - how embarassing !  Thanks for pointing out my beginners mistake there.  I've fixed my code - and also implemented the substitutions of parameters like you suggested - I like that approach.
    Unfortunately the end result is no better - the line
    utl_http.read_text(resp,response_text);
    Still returns nothing back
    The headers that are coming back are
    Date: Thu, 04 Jul 2013 08:31:56 GMT
    Server: Apache/2.2.16 (Ubuntu)
    X-Powered-By: PHP/5.3.3-1ubuntu9.3
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Vary: Accept-Encoding
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Connection: close
    I guess I will need to try chasing it with the fastsms vendor so see if they can check my incoming request and see if there are any glaring problems. I know the xml is correct as I am now logging the xml string just before I send it and when I take that string and put it in their test form it works perfectly - something else in the puzzle is missing. I've had no experience using utl_http before - perhaps it's no possible to read the xml repsonse using this ?
    Anyway, thanks for your help Billy.
    ps - How do you paste your code into your message to get that formatting ?
    Cheers,
    Brent

  • Error using UTL_HTTP over HTTPS

    Hello,
    I am trying to simply connect to an HTTPS web site. I used this query to test the connection :
    select utl_http.request('https://subdomain.maindomain.com/webservice.wsdl',null, 'file:C:\MyWalletDirectory','WalletPassword') from dual;
    and I always got the following error :
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1577
    ORA-29268: HTTP client error
    ORA-06512: at line 1
    Can anybody help me with this issue ? Is it possible to have a more meaningfull message ?
    Thanks...
    LIB

    I've written a basic PL/SQL web browser template. It looks/works as follows:
    SQL> select * from TABLE( webbrowser('https://metalink.oracle.com') ) where rownum < 11;
    COLUMN_VALUE
    Setting browser configuration
    Wallet set to file:/etc/ORACLE/WALLETS/oracle/
    Proxy Server is 198.54.206.99
    Proxy URL modified to include proxy user name and password
    Proxy URL is http://verreyb:*****@198.54.206.99
    HTTP: GET https://metalink.oracle.com
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Welcome to Oracle MetaLink</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK
    href="oracle.htm" rel=stylesheet>
    10 rows selected.
    The source code:
    create or replace type TStrings is table of varchar2(4000);
    create or replace function WebBrowser( url varchar2 ) return TStrings pipelined is
    -- BASIC PL/SQL WEB BROWSER TEMPLATE
    -- supports http, https and proxy servers
            -- fixed constants
            C_NO_PROXY_FOR  constant varchar2(4000) := 'localhost';
            C_WALLET        constant varchar2(4000) := 'file:/etc/ORACLE/WALLETS/oracle/';
            C_WALLET_PASS   constant varchar2(4000) := '<wallet password goes here>';
            -- Proxy settings that can be made arguments in the WebBrowser() call
            proxyServer     varchar2(20) := '198.54.206.99';
            -- not all proxy servers use authentication, but many corporate proxies do, in
            -- which case you need to specify your auth details here
            -- (make it nulls if not applicable)
            proxyUser       varchar2(50) := '<proxy username goes here>';
            proxyPass       varchar2(50) := '<proxy password goes here>';
            -- our local variables
            proxyURL        varchar2(4000);
            request         UTL_HTTP.req;
            response        UTL_HTTP.resp;
            buffer          varchar2(4000);
            endLoop         boolean;
    begin
            -- our "browser" settings
            PIPE ROW( 'Setting browser configuration' );
            UTL_HTTP.set_response_error_check( TRUE );
            UTL_HTTP.set_detailed_excp_support( TRUE );
            UTL_HTTP.set_cookie_support( TRUE );
            UTL_HTTP.set_transfer_timeout( 30 );
            UTL_HTTP.set_follow_redirect( 3 );
            UTL_HTTP.set_persistent_conn_support( TRUE );
            -- set wallet for HTTPS access
            PIPE ROW( 'Wallet set to '||C_WALLET );
            UTL_HTTP.set_wallet( C_WALLET, C_WALLET_PASS );
            -- configure for proxy access
            if proxyServer is not NULL then
                    PIPE ROW( 'Proxy Server is '||proxyServer );
                    proxyURL := 'http://'||proxyServer;
                    if (proxyUser is not NULL) and (proxyPass is not NULL) then
                            proxyURL := REPLACE( proxyURL, 'http://',  'http://'||proxyUser||':'||proxyPass||'@' );
                            PIPE ROW( 'Proxy URL modified to include proxy user name and password' );
                    end if;
                    PIPE ROW( 'Proxy URL is '|| REPLACE(proxyURL,proxyPass,'*****') );
                    UTL_HTTP.set_proxy( proxyURL, C_NO_PROXY_FOR );
            end if;
            PIPE ROW( 'HTTP: GET '||url );
            request := UTL_HTTP.begin_request( url, 'GET', UTL_HTTP.HTTP_VERSION_1_1 );
            -- set HTTP header for the GET
            UTL_HTTP.set_header( request, 'User-Agent', 'Mozilla/4.0 (compatible)' );
            -- get response to the GET from web server
            response := UTL_HTTP.get_response( request );
            -- pipe the response as rows
            endLoop := false;
            loop
                    exit when endLoop;
                    begin
                            UTL_HTTP.read_line( response, buffer, TRUE );
                            if (buffer is not null) and length(buffer)>0 then
                                    PIPE ROW( buffer );
                            end if;
                    exception when UTL_HTTP.END_OF_BODY then
                            endLoop := true;
                    end;
            end loop;
            UTL_HTTP.end_response( response );
            return;
    exception when OTHERS then
            PIPE ROW( SQLERRM );
    end;
    show errorsEdited by: Billy Verreynne on Sep 4, 2008 7:47 AM (old forum tags poorly supported by new Jive forum s/w)

  • How to add WebService authentication in pl/sql using UTL_HTTP

    Hi,
    I am passing SOAP request and getting output as a soap response from WebService using UTL_HTTP.
    Calling Web service client call from the PL/SQL procedure.
    Java web service is a service producer.
    Now we needs to add security to the application we are planing to add some of the userid/pwd credientials.
    So what needs to be add sql code in the sq/sql for making client call.
    i checked from the few of the articles. it shown like
    UTL_HTTP.set_authentication(http_req, 'username', 'password' );
    is it enough for making clent call or any other changes are required.
    Please let me know and any code to be implemented in the jave side aslo(if you knows) :-)
    Thanks,
    Pradeep.

    Okay, backtrack.
    A web server can deliver all kinds of content. From static HTML pages, to XML files and videos and dynamic content. Including reports.
    The communication language (protocol) used to talk to a web server is HTTP.
    UTL_HTTP is an Oracle PL/SQL library that implements the client side of this communication. It allows the developer to write code that acts like a web browser and communicates with a web server.
    Now what do you not understand and cannot use?
    HTTP is not simple and easy. You need to understand the basics of this communication language in order to communicate successfully with the web server. Like knowing the difference between GET and PUT and POST commands, how the URL query string works and so on.
    Once you know that, you can look at how the web server provides reports. How do you authenticate as a web browser with the web reporting system? What URLs do you use to access which reports? How do you pass name-values to the web server as report parameters? What HTTP response formats (MIME types) does the web report server provide? Which one do you plan to use and how do you parse that response into a meaning structured data format?
    If you're thinking it is "easy", think again. Sure, someone here can provide sample code that for example grabs a CSV report file from a web server and (using a pipeline table function), turn that into rows and columns. But that will not teach you the fundamentals you need to know and not equip you with dealing with the problem with your own brains, hands and keyboard.
    PS. In other words, learn to crawl and walk before trying to run. Get to grips with how HTTP works before diving into the deep end of web report integration.

  • Utl_http.request for https site

    Hello
    I am running the following using sqlplus login in as sys as sysdba (also tried login as the end user)
    SELECT utl_http.request('https://www.accestochina.com', 'null', 'file:C:\wallets', 'XXX - Password has been entered here - XXX') FROM dual;
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1722
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at line 1
    The platform I using is
    CORE 11.2.0.1.0 Production
    NLSRTL Version 11.2.0.1.0 - Production
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    Having spent a while looking into the problem without success any ideas / solution very welocome
    Thanks for looking, Pete

    The wallet needs to be stored on the Oracle server.
    Using +$ORACLE_HOME/bin/owm+ you create a wallet file and import (copy-and-paste) the web server's certificate in PEM format.
    PL/SQL code then needs to use the wallet on the server:
    SQL> create or replace function WebBrowser( url varchar2 ) return TStrings pipelined is
      2          WALLET_FILE     constant varchar2(4000) := 'file:///<oracle_home_goes_here>/owm/wallets/oracle'; --// default 11gr2 wallet location
      3          WALLET_PASSW    constant varchar2(4000) := 'wallet_password_here;
      4 
      5          -- our local variables
      6          proxyURL        varchar2(4000)   := 'http://username:[email protected]:80';
      7          request         UTL_HTTP.req;
      8          response        UTL_HTTP.resp;
      9          buffer          varchar2(4000);
    10          endLoop         boolean;
    11  begin
    12          UTL_HTTP.set_response_error_check( true );
    13          UTL_HTTP.set_detailed_excp_support( true );
    14          UTL_HTTP.set_wallet( WALLET_FILE, WALLET_PASSW );
    15          UTL_HTTP.set_proxy( proxyURL, null );  --// comment out if proxy access is not used
    16 
    17          request := UTL_HTTP.begin_request( url, 'GET', UTL_HTTP.HTTP_VERSION_1_1 );
    18          UTL_HTTP.set_header( request, 'User-Agent', 'Mozilla/4.0 (compatible)' );
    19          response := UTL_HTTP.get_response( request );
    20 
    21          endLoop := false;
    22          while not endLoop loop
    23                  begin
    24                          UTL_HTTP.read_line( response, buffer, true );
    25                          if (buffer is not null) and length(buffer)>0 then
    26                                  pipe row( buffer );
    27                          end if;
    28                  exception when UTL_HTTP.END_OF_BODY then
    29                          endLoop := true;
    30                  end;
    31          end loop;
    32          UTL_HTTP.end_response( response );
    33          return;
    34 
    35  exception when OTHERS then
    36          pipe row( SQLERRM );
    37  end;
    38  /
    Function created.
    SQL>  --// wallet contains OTN certificate
    SQL> select * from TABLE(webbrowser('https://forums.oracle.com'));
    COLUMN_VALUE
    <html>
    <SCRIPT LANGUAGE="JavaScript">
    window.location="https://forums.oracle.com/forums/index.jspa";
    </script>
    <noscript>
    </html>
    6 rows selected.
    SQL>

  • How to make a http request from a pl/sql procedure(URGENT)

    I need to make a http request from a pl/sql procedure, can any one tell me which built-in package and which procedure/function we serve my need?
    Thanks in advance.
    Ram Prasad.

    You should use UTL_HTTP package, but before it install the JVM into DB

Maybe you are looking for

  • While Loading Master data from BW Info Object

    Hi, What is the difference between the two options "set filters by Attributes AND Hierarchies" and "set filters by Attributes OR Hierarchies" when we load master data attributes/texts from BW Info Object. can someone please explain in detail with exa

  • Optical Drive not burning DVD's

    I keep posting a similar discussion but nothing is working. I have this ASUS optical drive for burning DVDs. I was told it doesn't need to be installed because you only need to install it if it's windows. I've tried burning through the disc utility a

  • Pros and cons Lightroom vs Photoshop printing

    Greetings, I'm only recently learning the details of Lightrooms Printing module. And I really like it. In fact I have a workflow of saving a PS file in an Auto Import folder so I can use LRs Print module in place of PS CS6. A couple of questions. In

  • Wont open files -- again.

    When I double-click a file on my server, or right-click and select Open, DW only gives me the LIST command and then says File activity complete. This is the same site that I've been using for the last few weeks, and it was working perfectly up until

  • How to open PI sheets in ECC 6.0

    i just start working in ECC 6.0 as ABAP programmer. please send me any type of material that is helpful for thsi version. PLease send me the study material of PI sheets.and how we can open PI sheets