Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTL_HTTP REQUEST Error

sanDec 9 2011 — edited Dec 13 2011
Hi all,

I have executed the below block but i am getting error.
DECLARE
V_RCV_SMS_STR VARCHAR2(5000);
REQ    UTL_HTTP.REQ;
RESP   UTL_HTTP.RESP;
VALUE  VARCHAR2(32000); 
V_RESPONSE_SMS     VARCHAR2(4000);
BEGIN
V_RCV_SMS_STR :='http://www.meru.co.in/wip/sendsms?username=asda'||'&'||'password=asas'||'&'||'to='|| 1111111||'&'||'message='||'Test%20Message%20from%20Shanmugam';
REQ := UTL_HTTP.BEGIN_REQUEST(RCV_SMS_STR);
   UTL_HTTP.SET_HEADER(REQ, 'User-Agent', 'Mozilla/4.0');
  RESP := UTL_HTTP.GET_RESPONSE(REQ);
  UTL_HTTP.READ_LINE(RESP, VALUE, TRUE);
  V_RESPONSE_SMS := VALUE;
  UTL_HTTP.END_RESPONSE(RESP);
  UTL_HTTP.END_REQUEST(REQ);

EXCEPTION 
  WHEN OTHERS THEN
  dbms_output.put_line('Request Failed: ' || utl_http.get_detailed_sqlerrm);
  V_RESPONSE_SMS := NULL;
   UTL_HTTP.END_RESPONSE(RESP);
     utl_http.end_request(req);   
END;
I am getting error like
Error report:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1389
ORA-29261: bad argument
ORA-06512: at line 23
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1029
ORA-12545: Connect failed because target host or object does not exist
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.
Can anyone help me out to fix this error.


Cheers,
San
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2012
Added on Dec 9 2011
3 comments
5,716 views