Board index » delphi » D2006 SP1 and SockApp

D2006 SP1 and SockApp


2006-02-08 08:23:09 AM
delphi246
I have to develop a complex web service client (i.e. exchanging XML via
https) to interface with a web service server to be developed by
another company, but (typically!) there will not be enough time between
the time they deploy the server and when it is in production, so I need
to temporarily hack a web service server from the high-level specs to
allow me start developing a client. The server is causing me problems,
rather than the client (the client will need to be a VCL Win32 app
because of other technologies it has to implement, but that is
presumably irrelevant).
I would prefer not to have to set up IIS or Apache. I looked at the
Cassani ASP.NET option, and while I may end up going back to it, I am
bothered about the learning curve and whether it will work for me, such
as SSL support, so I tried the Soap Server Application wizard with the
"Web App De{*word*81} executable" option, which in theory seems to fit my
needs best.
However, it won't compile because "Unit SockApp was compiled with a
different version of IdTCPServer.TIdTCPServer". I installed D2006 with
Indy 10: is this error because it needs Indy 9 (the D2006 installer
warned about installing Indy 10 because of CBuilder incompatibilities,
but I noticed nothing about Delphi apps)? If so, are there plans to
update SockApp (and possibly other units that it uses) so it can run
with Indy 10?
Alternatively, maybe I need to check out a different server technology
(I have read a lot, particularly on Borland Developer Network, but many
end up apparently needing hacks to get them working, such as getting
Apache modules to work with different Apache versions). Am I going in
the wrong direction, and maybe should be looking at a different
approach?
Ciaran, confused.
 
 

Re:D2006 SP1 and SockApp

Ciaran Costelloe writes:
Quote
However, it won't compile because "Unit SockApp was compiled with a
different version of IdTCPServer.TIdTCPServer". I installed D2006
with Indy 10: is this error because it needs Indy 9 (the D2006
installer warned about installing Indy 10 because of CBuilder
incompatibilities, but I noticed nothing about Delphi apps)? If so,
are there plans to update SockApp (and possibly other units that it
uses) so it can run with Indy 10?
Can you locate SockAPP.pas in the Source folder? If so you can just add
that path to your project search path and the file should get compiled
(if not, add some spaces and save sockapp.pas, then it will recompile).
The "compiled with a different version" is only because the source file
is not on the search path. (Delphi tries to use the DCU to link in)
--
Deepak Shenoy (TeamB)
shenoyatwork.blogspot.com
 

Re:D2006 SP1 and SockApp

Deepak Shenoy (TeamB) writes:
Quote
Can you locate SockAPP.pas in the Source folder? If so you can just
add that path to your project search path and the file should get
compiled (if not, add some spaces and save sockapp.pas, then it will
recompile).
I tried that, but then get errors in IndySockTransport with
FSocket.ReadBuffer and .WriteBuffer. I previously tried editing these
in Delphi 7 but eventually got stuck on "procedure
ServerExecute(AThread: TIdPeerThread);" because I know nothing about
the server threading in either Indy 9 or 10. I had hoped these issues
would be resolved in BDS 2006, guess I will just have to try again.
Ciaran
 

Re:D2006 SP1 and SockApp

Deepak Shenoy (TeamB) writes:
Quote
Can you locate SockAPP.pas in the Source folder? If so you can just
add that path to your project search path and the file should get
compiled (if not, add some spaces and save sockapp.pas, then it will
recompile).
I tried porting this again to Indy 10, and this time I succeeded (I
know a bit about Indy). The units SockApp, IndySockTransport and
SockAppNotify needed to be ported. I have recoded them using $IFDEFs
so that they compile and run under both Indy 9 and Indy 10. Borland
should put them in their next service pack, and they can have them with
no copyright retained by me, but if they don't, I can both post them
here and put them on the web.
The only issue is the units detecting what version of Indy is
installed. The "normal" Indy way is to put {$I IdCompilerDefines.inc}
at the start of the units, BUT the problem here is that BDS 2006 (at
least with Indy 10) does not have the relevant path set to the Indy 10
source directory. Since I only got BDS 2006 yesterday, I don't know
where you need to specify the correct directory: if I knew this, I
could add a comment after the $I directive telling the user that if
they got a "file not found" error, they should set the path in X to the
correct location. Where is the correct location X? I set it in
Project ->Options ->Directories/Conditionals ->Search path, but I
don't know if that is correct.
Ciaran
 

Re:D2006 SP1 and SockApp

Ciaran Costelloe schreef:
Quote
I would prefer not to have to set up IIS or Apache.
Both are so easy to set up that I don't understand the reasoning behind
this. Why jump through hoops if you can have everything working right
out of the box?
D2006 and IIS on XP work much better than Cassini or whatever you will
try, just the win32 ISAPI debugging takes a bit of fiddling that Borland
chose not to document properly, but debugging Asp.Net is no problem with
IIS. For enabling SSL you will need a (either proper or self-signed with
Openssl) server certificate but once you have the certificate enabling
ssl with IIS takes 5 seconds.
Danny
---
 

Re:D2006 SP1 and SockApp

danny heijl writes:
Quote
Ciaran Costelloe schreef:

>I would prefer not to have to set up IIS or Apache.

Both are so easy to set up that I don't understand the reasoning
behind this. Why jump through hoops if you can have everything
working right out of the box?
Hi Danny, that is exactly the information I was looking for. I had not
looked at IIS for a long time (when it was horrid) and not on XP, you
have given me the confidence to check it out again.
I was put off Apache by articles describing different hacks to get it
to work, but these may have been in a different context or just old
issues.
Thanks again!
Ciaran
 

Re:D2006 SP1 and SockApp

Ciaran Costelloe schreef:
Quote
I was put off Apache by articles describing different hacks to get it
to work, but these may have been in a different context or just old
issues.
I used to build my own Apache for unsupported platforms (but that's
years ago now) so perhaps I am not entirely unprejudiced here. But a
binary distribution on Windows should not take more than 5 minutes to
get up and running. However, I'd not use it for Delphi projects. If
I wanted to use Apache I'd go for PHP.
I had the same kind of situation a couple of years ago where I had to
write a client app (Delphi win32) that talked xml (custom, not soap) and
https to a web server (Java, Bea Weblogic) but I only had the specs and
no test server but they expected me to be ready when they had the test
server running anyway, so I simulated their server using plain asp
(vbscript, horror) and IIS so that I could test, and I still use it when
they plan changes (and they still expect me to be up and running by the
time their test version is up).
If I had to do it again I'd use Asp.Net and Delphi.Net instead as it
would make debugging the simulation server much easier than it was
debugging asp.
What you should know: if you didn't let the Delphi installer modify your
.Net machine.config file during the install, you will have to
uncomment the Delphi de{*word*81} lines in the web.config (they are present
but commented out in every new asp.net project created by the new
asp.net project wizard), otherwise IIS debugging will not work.
Danny
---
 

Re:D2006 SP1 and SockApp

danny heijl writes:
Quote
Ciaran Costelloe schreef:

>I was put off Apache by articles describing different hacks to get
>it to work, but these may have been in a different context or just
>old issues.

I used to build my own Apache for unsupported platforms (but that's
years ago now) so perhaps I am not entirely unprejudiced here. But a
binary distribution on Windows should not take more than 5 minutes to
get up and running.
Sorry Danny - on re-reading my reply, I totally gave the wrong
impression: I have _never_ had any difficulty installing Apache since
Corel Linux 1, which is not exactly recently, and I have used it ever
since for our internal webserver. What I was (incorrectly) referring
to was different articles I had come across referring to having to hack
the Delphi code to make it run on different Apache releases (and for
all I know, those articles may now be outdated and irrelevant). In any
event, I will follow your hint and try IIS, thanks again.
Ciaran
 

Re:D2006 SP1 and SockApp

Ciaran Costelloe schreef:
Quote
on re-reading my reply, I totally gave the wrong
impression: I have _never_ had any difficulty installing Apache since
Corel Linux 1, which is not exactly recently,
I admit I didn't read it like that.
Still, I wouldn't use Delphi with Apache voluntarily after my
experiences with Kylix on both supported and unsupported linux (mainly
red hat) platforms.
Never had much trouble with delphi and IIS (webbroker, websnap, asp.net).
Danny
---