<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: HTTP POST from inside Oracle</title>
	<atom:link href="http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Thu, 18 Mar 2010 16:44:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Adam vonNieda</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52459</link>
		<dc:creator>Adam vonNieda</dc:creator>
		<pubDate>Thu, 20 Nov 2008 17:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52459</guid>
		<description>&lt;p&gt;Thanks very much for sharing that Eddie, it saved me a lot of time! &lt;br&gt;&lt;br&gt;   Best regards,&lt;br&gt;&lt;br&gt;      -Adam vonNieda&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks very much for sharing that Eddie, it saved me a lot of time! <br /><br />   Best regards,<br /><br />      -Adam vonNieda</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52441</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Mon, 10 Nov 2008 05:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52441</guid>
		<description>&lt;p&gt;@Ed: I tested your query and got the error: Certificate validation failure.&lt;/p&gt;

&lt;pre&gt;
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; set define off
SQL&gt; SELECT UTL_HTTP.REQUEST(&#039;https://realtime.gpcatalogue.com/servlet/GPCRealTi
me?Query=Logon&amp;Alias=GXSRETL&amp;Userid=GXSREAL&amp;Password=REALTIME&#039;) FROM DUAL;
SELECT UTL_HTTP.REQUEST(&#039;https://realtime.gpcatalogue.com/servlet/GPCRealTime?Qu
ery=Logon&amp;Alias=GXSRETL&amp;Userid=GXSREAL&amp;Password=REALTIME&#039;) FROM DUAL
       *
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at &quot;SYS.UTL_HTTP&quot;, line 1577
ORA-29024: Certificate validation failure
ORA-06512: at line 1
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>@Ed: I tested your query and got the error: Certificate validation failure.</p>

<pre>
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> set define off
SQL> SELECT UTL_HTTP.REQUEST('https://realtime.gpcatalogue.com/servlet/GPCRealTi
me?Query=Logon&#038;Alias=GXSRETL&#038;Userid=GXSREAL&#038;Password=REALTIME') FROM DUAL;
SELECT UTL_HTTP.REQUEST('https://realtime.gpcatalogue.com/servlet/GPCRealTime?Qu
ery=Logon&#038;Alias=GXSRETL&#038;Userid=GXSREAL&#038;Password=REALTIME') FROM DUAL
       *
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1577
ORA-29024: Certificate validation failure
ORA-06512: at line 1
</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Godalle</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52435</link>
		<dc:creator>Ed Godalle</dc:creator>
		<pubDate>Fri, 07 Nov 2008 21:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52435</guid>
		<description>&lt;p&gt;This information is great but I&#039;m having problems calling a url with several parameters.
SELECT UTL_HTTP.REQUEST(
https://realtime.gpcatalogue.com/servlet/GPCRealTime?Query=Logon&amp;Alias=GXSRETL&amp;Userid=GXSREAL&amp;Password=REALTIME) FROM DUAL&lt;/p&gt;

&lt;p&gt;The query returns session timed out but pasting it in the browser it says login successfully...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This information is great but I&#8217;m having problems calling a url with several parameters.
SELECT UTL_HTTP.REQUEST(
<a href="https://realtime.gpcatalogue.com/servlet/GPCRealTime?Query=Logon&amp;Alias=GXSRETL&amp;Userid=GXSREAL&amp;Password=REALTIME)" rel="nofollow">https://realtime.gpcatalogue.com/servlet/GPCRealTime?Query=Logon&amp;Alias=GXSRETL&amp;Userid=GXSREAL&amp;Password=REALTIME)</a> FROM DUAL</p>

<p>The query returns session timed out but pasting it in the browser it says login successfully&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52430</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Wed, 29 Oct 2008 13:37:05 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52430</guid>
		<description>&lt;p&gt;Great code example.  I ran into a problem however when I used this in a loop.  I got &quot;ORA-29270: too many open HTTP requests&quot; errors.  I finally found a fix that seemed to work...
   Exception
      When UTL_HTTP.END_OF_BODY Then
         UTL_HTTP.END_RESPONSE (l_http_resp);&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Great code example.  I ran into a problem however when I used this in a loop.  I got &#8220;ORA-29270: too many open HTTP requests&#8221; errors.  I finally found a fix that seemed to work&#8230;
   Exception
      When UTL_HTTP.END_OF_BODY Then
         UTL_HTTP.END_RESPONSE (l_http_resp);</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ariel</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52398</link>
		<dc:creator>Ariel</dc:creator>
		<pubDate>Thu, 02 Oct 2008 05:19:33 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52398</guid>
		<description>&lt;p&gt;For those of you who want to HTTP post some parameters to another site, use the following code:&lt;/p&gt;

&lt;p&gt;set serveroutput on;
exec dbms_output.enable(1000000000);&lt;/p&gt;

&lt;p&gt;set escape &#039;\&#039;&lt;/p&gt;

&lt;p&gt;DECLARE
  req   UTL_HTTP.REQ;
  resp  UTL_HTTP.RESP;
  value VARCHAR2(1024);&lt;/p&gt;

&lt;p&gt;-- URL to post to
  v_url VARCHAR2(200) := &#039;http://T97040476TA9000/core_dmt/withdraw_job.php&#039;;&lt;/p&gt;

&lt;p&gt;-- Post Parameters
  v_param VARCHAR2(500) := &#039;pwd=coredmt8567\&amp;core_id=12223\&amp;type=PK\&amp;reason=This is the test reason&#039;;
  v_param_length NUMBER := length(v_param);
BEGIN
  -- Set up proxy servers if required
  --  UTL_HTTP.SET_PROXY(&#039;proxy.my-company.com&#039;, &#039;corp.my-company.com&#039;);
  req := UTL_HTTP.BEGIN_REQUEST (url=&gt; v_url, method =&gt; &#039;POST&#039;);
  --  UTL_HTTP.SET_HEADER(req, &#039;User-Agent&#039;, &#039;Mozilla/4.0&#039;);
  UTL_HTTP.SET_HEADER (r      =&gt;  req, 
                       name   =&gt;  &#039;Content-Type&#039;,&lt;br /&gt;
                       value  =&gt;  &#039;application/x-www-form-urlencoded&#039;);
  UTL_HTTP.SET_HEADER (r      =&gt;   req, 
                       name   =&gt;   &#039;Content-Length&#039;, 
                       value  =&gt;   v_param_length);
  UTL_HTTP.WRITE_TEXT (r      =&gt;   req, 
                       data   =&gt;   v_param);&lt;/p&gt;

&lt;p&gt;resp := UTL_HTTP.GET_RESPONSE(req);
  LOOP
    UTL_HTTP.READ_LINE(resp, value, TRUE);
    DBMS_OUTPUT.PUT_LINE(value);
  END LOOP;
  UTL_HTTP.END_RESPONSE(resp);
EXCEPTION
  WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
END;
/&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For those of you who want to HTTP post some parameters to another site, use the following code:</p>

<p>set serveroutput on;
exec dbms_output.enable(1000000000);</p>

<p>set escape &#8216;\&#8217;</p>

<p>DECLARE
  req   UTL_HTTP.REQ;
  resp  UTL_HTTP.RESP;
  value VARCHAR2(1024);</p>

<p>&#8211; URL to post to
  v_url VARCHAR2(200) := &#8216;http://T97040476TA9000/core_dmt/withdraw_job.php&#8217;;</p>

<p>&#8211; Post Parameters
  v_param VARCHAR2(500) := &#8216;pwd=coredmt8567\&amp;core_id=12223\&amp;type=PK\&amp;reason=This is the test reason&#8217;;
  v_param_length NUMBER := length(v_param);
BEGIN
  &#8212; Set up proxy servers if required
  &#8212;  UTL_HTTP.SET_PROXY(&#8216;proxy.my-company.com&#8217;, &#8216;corp.my-company.com&#8217;);
  req := UTL_HTTP.BEGIN_REQUEST (url=&gt; v_url, method =&gt; &#8216;POST&#8217;);
  &#8212;  UTL_HTTP.SET_HEADER(req, &#8216;User-Agent&#8217;, &#8216;Mozilla/4.0&#8242;);
  UTL_HTTP.SET_HEADER (r      =&gt;  req, 
                       name   =&gt;  &#8216;Content-Type&#8217;,<br />
                       value  =&gt;  &#8216;application/x-www-form-urlencoded&#8217;);
  UTL_HTTP.SET_HEADER (r      =&gt;   req, 
                       name   =&gt;   &#8216;Content-Length&#8217;, 
                       value  =&gt;   v_param_length);
  UTL_HTTP.WRITE_TEXT (r      =&gt;   req, 
                       data   =&gt;   v_param);</p>

<p>resp := UTL_HTTP.GET_RESPONSE(req);
  LOOP
    UTL_HTTP.READ_LINE(resp, value, TRUE);
    DBMS_OUTPUT.PUT_LINE(value);
  END LOOP;
  UTL_HTTP.END_RESPONSE(resp);
EXCEPTION
  WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
END;
/</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ethan</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52331</link>
		<dc:creator>Ethan</dc:creator>
		<pubDate>Fri, 22 Aug 2008 18:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52331</guid>
		<description>&lt;p&gt;Very nice, saved me hours of work I am sure!&lt;/p&gt;

&lt;p&gt;It would be nice to know how to encode form elements into &quot;x-www-form-Urlencoded&quot; format and post. The examples I found using Oracle did it in Java, which I would rather avoid. XML will work however.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Very nice, saved me hours of work I am sure!</p>

<p>It would be nice to know how to encode form elements into &#8220;x-www-form-Urlencoded&#8221; format and post. The examples I found using Oracle did it in Java, which I would rather avoid. XML will work however.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: taneal</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52183</link>
		<dc:creator>taneal</dc:creator>
		<pubDate>Wed, 02 Jul 2008 00:10:35 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52183</guid>
		<description>&lt;p&gt;Hmmmm.  I was hoping that wouldn&#039;t be the answer :)&lt;/p&gt;

&lt;p&gt;Oh well, guess I have to figure something else out then for doing this.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hmmmm.  I was hoping that wouldn&#8217;t be the answer <img src='http://awads.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>Oh well, guess I have to figure something else out then for doing this.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52182</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 01 Jul 2008 22:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52182</guid>
		<description>&lt;p&gt;taneal, it seems that you need to decrypt the data on the other end.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>taneal, it seems that you need to decrypt the data on the other end.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: taneal</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52180</link>
		<dc:creator>taneal</dc:creator>
		<pubDate>Tue, 01 Jul 2008 17:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52180</guid>
		<description>&lt;p&gt;This is really interesting.  How would this work on a page that encrypts the names/ID&#039;s of form elements?  For instance, when a user creates a job post on our site, I then take them to a page that loads Craigslist into an IFRAME.  I want to be able to populate the fields with the information they entered on our site (so they don&#039;t have to re-type everything).  I&#039;ve been having problems with it though.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is really interesting.  How would this work on a page that encrypts the names/ID&#8217;s of form elements?  For instance, when a user creates a job post on our site, I then take them to a page that loads Craigslist into an IFRAME.  I want to be able to populate the fields with the information they entered on our site (so they don&#8217;t have to re-type everything).  I&#8217;ve been having problems with it though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Shaman</title>
		<link>http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/comment-page-1/#comment-52066</link>
		<dc:creator>Shaman</dc:creator>
		<pubDate>Fri, 11 Apr 2008 06:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=171#comment-52066</guid>
		<description>&lt;p&gt;Hi Eddie&lt;/p&gt;

&lt;p&gt;The procedure works, as in it posts to the URL with the parameters, but it also throws an error:&lt;/p&gt;

&lt;p&gt;SQL execution error, 
ORA-29273: HTTP request failed 
ORA-06512: at &quot;SYS.UTL_HTTP&quot;, line 1029 ORA-29261: bad argument 
ORA-06512: at &quot;HH.UTIL_PKG&quot;, line 101&lt;/p&gt;

&lt;p&gt;This is how im using the code (its in a trigger)&lt;/p&gt;

&lt;p&gt;DECLARE
v_url varchar2(200);
l_data clob := &#039;1&#039;;
....&lt;/p&gt;

&lt;p&gt;BEGIN
...
    select REPLACE(REPLACE(:new.input_value,&#039; &#039;,NULL),&#039;-&#039;,NULL) into v_phone_num from dual;
    -- select REPLACE(REPLACE(1234567,&#039; &#039;,NULL),&#039;-&#039;,NULL) into v_phone_num from dual;
    v_url := &#039;http://www.******.com/test.asp?pnum=12345&#039; &#124;&#124; &#039;&amp;&#039; &#124;&#124; &#039;phone=&#039; &#124;&#124; v_phone_num;&lt;/p&gt;

&lt;p&gt;util_pkg.http_post(p_url_in =&gt; v_url, p_data_in =&gt; l_data);&lt;/p&gt;

&lt;p&gt;Im only passing 2 arguments, p_url and p_data_in, what is the bad argument error about?
Any help would be greatly appreciated.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Eddie</p>

<p>The procedure works, as in it posts to the URL with the parameters, but it also throws an error:</p>

<p>SQL execution error, 
ORA-29273: HTTP request failed 
ORA-06512: at &#8220;SYS.UTL_HTTP&#8221;, line 1029 ORA-29261: bad argument 
ORA-06512: at &#8220;HH.UTIL_PKG&#8221;, line 101</p>

<p>This is how im using the code (its in a trigger)</p>

<p>DECLARE
v_url varchar2(200);
l_data clob := &#8216;1&#8242;;
&#8230;.</p>

<p>BEGIN
&#8230;
    select REPLACE(REPLACE(:new.input_value,&#8217; &#8216;,NULL),&#8217;-',NULL) into v_phone_num from dual;
    &#8212; select REPLACE(REPLACE(1234567,&#8217; &#8216;,NULL),&#8217;-',NULL) into v_phone_num from dual;
    v_url := &#8216;http://www.******.com/test.asp?pnum=12345&#8242; || &#8216;&amp;&#8217; || &#8216;phone=&#8217; || v_phone_num;</p>

<p>util_pkg.http_post(p_url_in =&gt; v_url, p_data_in =&gt; l_data);</p>

<p>Im only passing 2 arguments, p_url and p_data_in, what is the bad argument error about?
Any help would be greatly appreciated.</p>]]></content:encoded>
	</item>
</channel>
</rss>
