TcpIpConnection to Web Server
Posted: Fri Aug 07, 2009 12:51 pm
by Manjit >> Tue, 28 Jun 2005 4:43:21 GMT
Hi,
I am trying to open a TcpIpConnection to WebServer and get a response. I am able to open the Connection but not able to read the response.
My code is:
vars
oTCPConnection :TcpIpConnection;
begin
beginTransientTransaction;
create oTCPConnection sharedTransient;
oTCPConnection.name := "127.0.0.1";
oTCPConnection.port := 80;
oTCPConnection.localPort := 7777;
oTCPConnection.open();
sMessage := "GET /jade/jadehttp.dll?CRMWebService HTTP/1.1" &
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*" & "Accept-Language: en-au" &
"Accept-Encoding: ____, _______" &
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)" &
"Host:127.0.0.1" &
"Connection: Keep-Alive" & CrLf;
if oTCPConnection.state = Connection.Connected then oTCPConnection.writeBinary(sMessage.Binary);
endif;
if oTCPConnection.state = Connection.Connected then
write oTCPConnection.readBinary(200000).String; //this part never happens ??
commitTransientTransaction;
Any help much appriciated.
endif;
Hi,
I am trying to open a TcpIpConnection to WebServer and get a response. I am able to open the Connection but not able to read the response.
My code is:
vars
oTCPConnection :TcpIpConnection;
begin
beginTransientTransaction;
create oTCPConnection sharedTransient;
oTCPConnection.name := "127.0.0.1";
oTCPConnection.port := 80;
oTCPConnection.localPort := 7777;
oTCPConnection.open();
sMessage := "GET /jade/jadehttp.dll?CRMWebService HTTP/1.1" &
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*" & "Accept-Language: en-au" &
"Accept-Encoding: ____, _______" &
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)" &
"Host:127.0.0.1" &
"Connection: Keep-Alive" & CrLf;
if oTCPConnection.state = Connection.Connected then oTCPConnection.writeBinary(sMessage.Binary);
endif;
if oTCPConnection.state = Connection.Connected then
write oTCPConnection.readBinary(200000).String; //this part never happens ??
commitTransientTransaction;
Any help much appriciated.
endif;