sending sms through site way2sms
Hello experts,
I am trying to send sms through a site i.e. www.way2sms.com but i am getting an error. Can someone please have a look at this procedure and tell me where i am wrong.
CREATE OR REPLACE PROCEDURE sendSMS
( pRecipient IN VARCHAR2
, pBody IN VARCHAR2
)
IS
username CONSTANT VARCHAR2(40) := 'username';
password CONSTANT VARCHAR2(40) := 'password';
--
vRequest Utl_Http.req;
vPostText long;
vResponse Utl_Http.resp;
vResponseText long;
vErrorText long;
BEGIN
----------------------------------------------------------------------------
-- Build text for the post action.
-- For a field description, see
----------------------------------------------------------------------------
vPostText :=
'PlainText=YES' ||CHR(38)||
'username=' ||Utl_Url.escape(USERNAME, TRUE)||CHR(38)||
'Password=' ||Utl_Url.escape(PASSWORD, TRUE)||CHR(38)||
'MobNo='||Utl_Url.escape(pRecipient, TRUE)||CHR(38)||
'textArea=' ||Utl_Url.escape(pBody, TRUE);
----------------------------------------------------------------------------
-- if you need to set a proxy, uncomment next line.
----------------------------------------------------------------------------
/* Utl_Http.set_proxy('proxy.it.my-company.com', 'my-company.com'); */
----------------------------------------------------------------------------
-- Send SMS through the Esendex SMS service.
----------------------------------------------------------------------------
vRequest := Utl_Http.begin_request
( url => 'http://wwwh.way2sms.com/content/index.html?'
, method => 'POST'
);
Utl_Http.set_header
( r => vRequest
, name => 'Content-Length'
, value => LENGTH(vPostText)
);
Utl_Http.write_text
( r => vRequest
, data => vPostText
);
vResponse := Utl_Http.get_response(vRequest);
IF vResponse.status_code = '200'
THEN
Utl_Http.read_text(vResponse, vResponseText);
--
IF vResponseText NOT LIKE 'Result=OK%'
THEN
vErrorText := vResponseText;
END IF;
ELSE
vErrorText := 'HTTP status: '||vResponse.status_code||'-'||vResponse.reason_phrase;
END IF;
--
Utl_Http.end_response(vResponse);
--
IF vErrorText IS NOT NULL
THEN
RAISE_APPLICATION_ERROR(-20001, 'Sending SMS failed with '||vErrorText);
END IF;
END sendSMS;
/
Error is ::-
ERROR at line 1:
ORA-20001: Sending SMS failed with <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Way2SMS</title>
<script>
function serc()
{
window.open("../jsp/searchpage.jsp?id="+document.getElementById('q').value);
}
function password()
{
window.open("../jsp/ForgotPassword.jsp?text=3","","resizable=0,width=450,height=420,scrollbars=0");
}
function forgot()
{
window.open("../jsp/ForgotPassword.jsp?text=3","","resizable=0,width=450,height=420,scrollbars=0");
}
function IsNumeric(sText)
{
var ValidChars = "0123456789";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
Thanks in advance,
Edited by: Uttam Singh on Feb 27, 2009 4:44 AM
Edited by: Uttam Singh on Feb 27, 2009 4:44 AM