Page 1 of 1

Connecting to an IIS web server using Jades TCIPIP class

Posted: Fri Aug 07, 2009 12:02 pm
by ConvertFromOldNGs
by Joseph O'Dwyer >> Fri, 25 May 2001 0:55:29 GMT

Has anyone tried to communicate to a web server running IIS using the JadeInternetTCPIPConnection class.

I am trying to get the following code to work so that I can write a jade program to load test another jade program
that runs as a web application.

The code successfully opens a connection to the IIS server and I can then write a message to the server ( I am not
sure about the format this message should be). When I try to read from the pipe the read causes jade to lockup and
I have to use the Task manager to terminate the Jade process.

Any suggestion would be much appreciated.

Thanks In Advance

Joseph


testWebServerConnection();
vars

lbin_Reply : Binary;
lbin_Request : Binary;
lInternetTCPIPPipe : JadeInternetTCPIPConnection;
begin


create lInternetTCPIPPipe transient;

lInternetTCPIPPipe.name := "pisces";
lInternetTCPIPPipe.port := 80; //The IIS port
lInternetTCPIPPipe.open(); //this is successful

if lInternetTCPIPPipe.state <> JadeInternetTCPIPConnection.Connected then write lInternetTCPIPPipe.name & " is not opened";
return;
endif;

write lInternetTCPIPPipe.name & " is opened";

lbin_Request := ("default.htm" & #'00').Binary;

write "Writing - " & lbin_Request.String;
lInternetTCPIPPipe.writeBinary(lbin_Request); //the write is successful
write "write complete";

//the read causes jade to lockup and I have to use the Task manager to terminate the Jade process.
lbin_Reply := lInternetTCPIPPipe.readBinary(4000);

write lbin_Reply.String;

epilog

lInternetTCPIPPipe.close();
if lInternetTCPIPPipe.state <> JadeInternetTCPIPConnection.Connected then write lInternetTCPIPPipe.name & " is closed";
endif;
delete lInternetTCPIPPipe;

end;

Re: Connecting to an IIS web server using Jades TCIPIP class

Posted: Fri Aug 07, 2009 12:02 pm
by ConvertFromOldNGs
by Robert Barr >> Fri, 25 May 2001 5:33:10 GMT

Joseph, the readBinary() method is synchronous, so will 'hang' the JADE thread until data arrives. Try using the asynchronous calls (openAsynch, listenAsynch or listenContinuousAsynch and readBinaryAsynch). To use these, you must define a callback method - this is described in the online help for each method. Cheers,
Rob

Re: Connecting to an IIS web server using Jades TCIPIP class

Posted: Fri Aug 07, 2009 12:02 pm
by ConvertFromOldNGs
by Wilfred Verkley >> Fri, 15 Jun 2001 3:34:49 GMT

Another way to do HTTP GET's and POST's is to use the MS XML API. The IHTTPRequest object makes this job quite easy since it encaptulates all the things you are trying to do and more. Also, doesnt CardSchema have a similar HTTP Request function?

The only catch with Jade, if your using blocking calls and because jade is not multi-threaded, is that you will need to run several stress test applications at once to really put the web server under a heavy load.

Out of curiousity, how are you handling the jade sessions in your stress test simulation?

Wilfred.