Apache Giving HTTP 505 Error While Contacting it through Oracle database

2015-10-08 Thread Ankur Gupta
This is my SMS sending procedure where mobile number and body of msg is
passed.

Then concatenating all these values a URL is formed .

URL hit to apache server where .jsp page is made to send SMS via third
vendor.

This apache server is just a mediator between database and third vendor

Problem is that when the same URL is accessed through browser then page
runs but when same thing is accessed by the procedure then
*DBMS_OUTPUT.PUT_LINE*('HTTP response status CODE: ' || resp.status_code);
gives ‘505’ error and UTL_HTTP.READ_TEXT(resp,v_msg,null);

Gives end of body reached.



Ex of url :-
http://10.xxx.xx.xx:/examples/trysms.jsp?mobileNumber=99=HELLO

WORLD



CREATE OR REPLACE Procedure CHANNELG.SMS_headers_V1

(

mob in varchar2,

msgg in varchar2

)

AS

req UTL_HTTP.REQ;

resp UTL_HTTP.RESP;

name varchar2(256);

value varchar2(5000);

value1 varchar2(1024);

v_msg varchar2(32767);

output_table *DBMS_OUTPUT.CHARARR*;

num_lines number := 500;

URL varchar2(500):='http://10.xxx.xx.xx:
/examples/.jsp?mobileNumber='||mob||'='||msgg;

l_clob clob;

id number;

BEGIN

 select nvl(max(ID),0)+1 into id from SMS_STATUS;

 insert into SMS_STATUS(ID,MOBILE_NUMBER,SENT_STATUS) values(id,mob,'Y'
);

*DBMS_LOB.CREATETEMPORARY*(l_clob,false);

UTL_HTTP.SET_PROXY('http://10.xxx.xx.xx:);

req := UTL_HTTP.BEGIN_REQUEST(URL,'POST','HTTP/1.1');


*--UTL_HTTP.SET_HEADER(req,'Content-Type','text/html;charset=ISO-8859-1');*

UTL_HTTP.SET_HEADER(req,'User-Agent', 'Mozilla/4.76');

 UTL_HTTP.SET_HEADER(req,'Content-Length','0');

resp:= UTL_HTTP.GET_RESPONSE(req);

*DBMS_OUTPUT.PUT_LINE*('HTTP response status CODE: ' || resp.status_code
);

*DBMS_OUTPUT.PUT_LINE*('HTTP RESPONSE reason Pharse: ' || resp.
reason_phrase);

for i in 1..UTL_HTTP.GET_HEADER_COUNT(resp)

 LOOP

UTL_HTTP.GET_HEADER(resp,i,name,value);

*DBMS_OUTPUT.PUT_LINE*(name || ':' || value);

END LOOP;

UTL_HTTP.READ_TEXT(resp,v_msg,null);

*DBMS_OUTPUT.PUT_LINE*('v_msg-' || v_msg);

*DBMS_LOB.WRITEAPPEND*(l_clob,length(v_msg),v_msg);

*DBMS_OUTPUT.GET_LINES*(output_table,num_lines);

DELETE FROM CLOB_TEST;

insert into clob_test values(l_clob);

select regexp_substr(substr(data,108,35),'[^,]+',1,3) INTO value1 from
clob_test;

update SMS_STATUS set DELIVERY_STATUS= value1 where ID=id and mobile_number
= mob  ;

*--DBMS_OUTPUT.PUT_LINE('LENGTH OF MSG ' || length(v_msg));*

*--value1 := UTL_HTTP.REQUEST(URL);*

*--DBMS_OUTPUT.PUT_LINE('value' || value1);*

UTL_HTTP.END_RESPONSE(resp);

END;

/


Re: redirect to website not working

2015-06-18 Thread Ankur Gupta
Thank you for your help...
xx.xxx.xx.81 server through which iam using ie is not accessed to public
website.This might be the problem.

I want to ask a noob question that is there any method , as 81 server is
not accessed to public websites but Linux server has access , so any
method,way so that request can be sent to public website through Linux
server . Linux server can be accessed through 81 server only.
I have to use 81 server ie to request public website SMS sender vendor
through Linux server.


Re: redirect to website not working

2015-06-17 Thread Ankur Gupta
*Fiddler Error:*

#   Result  Protocol   HostURL BodyCaching
Content-Type   Process CommentsCustom



2   302 HTTPxx.xxx.xx.81:81/abc/abc/a.asp 191
privatetext/html  iexplore:6656

3   302 HTTPxx.xxx.xx.99:8080
/examples/smstrial.jsp?mobileNumber=01234567890
text/html;charset=ISO-8859-1  iexplore:6656

4   502 HTTP180.179.218.150
/sendurl.aspx?user=xxxpwd=xxxsenderid=xxxmobileno=0123456789msgtext=Hellosmstype=0
512 no-cache, must-revalidatetext/html; charset=UTF-8
iexplore:6656



Request Count:   1

Bytes Sent:  630  (headers:630; body:0)

Bytes Received:  719  (headers:207; body:512)



ACTUAL PERFORMANCE

--

ClientConnected:   11:07:26.500

ClientBeginRequest:11:07:26.734

GotRequestHeaders: 11:07:26.765

ClientDoneRequest: 11:07:26.765

Determine Gateway: 0ms

DNS Lookup:0ms

TCP/IP Connect:21025ms

HTTPS Handshake:   0ms

ServerConnected:   11:07:47.781

FiddlerBeginRequest:   00:00:00.000

ServerGotRequest:  00:00:00.000

ServerBeginResponse:   00:00:00.000

GotResponseHeaders:00:00:00.000

ServerDoneResponse:00:00:00.000

ClientBeginResponse:   11:07:47.812

ClientDoneResponse:11:07:47.812



Overall Elapsed:   00:00:21.0781250



RESPONSE BYTES (by Content-Type)

--

text/html: 512

~headers~: 207





ESTIMATED WORLDWIDE PERFORMANCE

--

The following are VERY rough estimates of download times when hitting
servers based in Seattle.



US West Coast (Modem - 6KB/sec)

RTT:   0.10s

Elapsed:   0.10s



Japan / Northern Europe (Modem)

RTT:   0.15s

Elapsed:   0.15s



China (Modem)

RTT:   0.45s

Elapsed:   0.45s



US West Coast (DSL - 30KB/sec)

RTT:   0.10s

Elapsed:   0.10s



Japan / Northern Europe (DSL)

RTT:   0.15s

Elapsed:   0.15s



China (DSL)

RTT:   0.45s

Elapsed:   0.45s







*IE giving error:*

[Fiddler] The connection to '180.179.218.150' failed.
Error: TimedOut (0x274c).
System.Net.Sockets.SocketException A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond
180.179.218.150:80


Re: redirect to website not working

2015-06-17 Thread Ankur Gupta
Sorry if I was unable to make you understand .
At my workplace we have one production server which have iis and classic
asp pages are deployed. Now as per the requirement , we have to send SMS to
the customers, so , a request from production server say A(having asp page)
is sent to Linux server having tomcat say B(having jsp page). B server has
jsp page which is called and a simple code is written to redirect to public
website which is responsible for sending SMS.


Re: redirect to website not working

2015-06-17 Thread Ankur Gupta
xx.xx.xx.81 has classic asp page sms.asp having code:

%@ language=vbscript%

%

   mobileNumber=0123456789

   Response.redirect(
http://xx.xxx.xx.99:8080/examples/smstrial.jsp?mobileNumber=; mobileNumber)

%



Linux server(xx.xxx.xx.99:8080) with apache tomcat and linux v6.1
Enterprise has jsp page named smstrial.jsp having jsp code:

%@ page import=java.io.*,java.util.*%

HTML

HEAD

TITLE New Document /TITLE

/HEAD

BODY

center

h1Page Redirection/h1

/center

%

   String mobile=request.getParameter(mobileNumber);

   String site=
http://180.179.218.150:80/sendurl.aspx?user=xyzpwd=xyzsen
derid=xyzmobileno=+mobile+msgtext=Hellosmstype=0;

   response.sendRedirect(site);

%

/BODY

/HTML







Now from xx.xx.xx.81 iam  calling sms.asp page from internet explorer and
 getting error.

If i change redirect webpage called in jsp code to some intranet server,e.g
xx.xx.xx.54 (which is not use for public website. It is used internally in
the organization and xx.xx.xx.81  server is connected to xx.xx.xx.54  )
then  xx.xx.xx.81 browser successfully redirects to it without any issue.



Linux server xx.xxx.xx.99:8080 is connected to internet.

When we use wget command like

Wget  http://180.179.218.150:80/sendurl.aspx?user=xyzpwd=xyzsen
derid=xyzmobileno=+mobile+msgtext=Hellosmstype=0  then it successfully
executes it.



I hope this helps . Thank you for giving you time.


Re: redirect to website not working

2015-06-17 Thread Ankur Gupta
Log says this:

xx.xxx.xx.81 - - [17/Jun/2015:12:51:47 -0400] GET
/examples/smstrial.jsp?mobileNumber=0123456789 HTTP/1.1 302 -

xx.xxx.xx.81 - - [17/Jun/2015:12:52:16 -0400] GET
/examples/smstrial.jsp?mobileNumber=0123456789 HTTP/1.1 302 -

xx.xxx.xx.81 - - [17/Jun/2015:12:53:05 -0400] GET /examples/smstrial.jsp
HTTP/1.1 302 -

xx.xxx.xx.81 - - [17/Jun/2015:12:53:17 -0400] GET /examples/smstrial.jsp
HTTP/1.1 302 -

xx.xxx.xx.81 - - [17/Jun/2015:12:53:32 -0400] GET /examples/smstrial.jsp
HTTP/1.1 302 -

xx.xxx.xx.81 - - [17/Jun/2015:12:54:39 -0400] GET /examples/smstrial.jsp
HTTP/1.1 302 139

xx.xxx.xx.81 - - [17/Jun/2015:12:55:16 -0400] GET /examples/smstrial.jsp
HTTP/1.1 302 139



Browser is Internet Explorer and it gives error

 [image: Inline image 1]


Re: redirect to website not working

2015-06-17 Thread Ankur Gupta
I had installed fiddler and deactivated ie stupid feature . how can I share
the result of fiddler to you if the system dosent allow attachments?


redirect to website not working

2015-06-16 Thread Ankur Gupta
I have apache tomacat 7.0.61 and linux server 6.1 enterprise.
There is a requirment of sending sms to the customers, but the request to
send sms to the vendor is throught this sftp linux server.
Now, when i redirect to the page it does not respond.But when i access the
same website through command line wget http://xyz.com; linux does execute
that and i can get sms.
one more information before wget i set http_proxy in command line like
$export http_proxy=xx.xx.xx.xx:yy/
so there is a need to set proxy in apache tomcat too in order to redirect
to public page?
Thank you


Tomcat not reading jsp code

2015-06-15 Thread Ankur Gupta
I have apache tomcat 7.0 and Linux 6.1 server.
I had written simple jsp code in a .jsp page which will redirect page and
deployed in tomcat .
When. Page is accessed then only html tags are shown and tomcat just skips
jsp code written under % % tag.
Plz help.


Vb script not running

2015-06-08 Thread Ankur Gupta
I have apache tomcat  7.0
linux 6.1 server

I want to deploy a .asp page which contains vb script. The problem is that
vb script is not executing. Even response.write() is not working. Is there
any alternative to run vb script?


Re: Vb script not running

2015-06-08 Thread Ankur Gupta
Thank you for your reply,
the vb script is normally running under windows server, i had checked it.
When i deploy it into apache tomacat server and try to access vb script
then it does nothing. Is there any alternative method?

On Mon, Jun 8, 2015 at 4:17 PM, André Warnier a...@ice-sa.com wrote:

 Ankur Gupta wrote:

 I have apache tomcat  7.0
 linux 6.1 server

 I want to deploy a .asp page which contains vb script. The problem is that
 vb script is not executing. Even response.write() is not working. Is there
 any alternative to run vb script?


 Assuming that this script should normally be running on the server side..

 VB (Visual Basic), as far as I know, is propietary technology of Microsoft
 Corporation.
 So without some additional help, it is unlikely to run under anything else
 than Microsoft Operating Systems and/or Microsoft webservers.

 This search in Google may point to some answers : apache vbscript linux


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org