views:

132

answers:

5

I need to write a SOAP service for Linux (CentOS).

I need to do this using Lazarus/FreePascal. The service needs to be a binary (daemon) that runs in the background.

Questions: 1. Is this possible (as a standalone executable)? 2. If not, what are the alternatives? 3. How do I start? 4. What additional tools/libraries do I need?

A: 

Is Pascal really a requirement??

Otherwise, you could write a SOAP service in Java, then your service would be platform agnostic. The only requirement would be a JRE, and JRE are available for any platform, so it would run perfectly on all Linux flavors, WIndows, Mac OsS, Solaris, etc

There are also plenty of frameworks for doing SOAP in Java.

Pascal would also be able to run on Linux and Windows with minor adjustments, but I have no knowledge of existing good SOAP frameworks for Pascal.

nkr1pt
1. It is imperative for performance reasons that I have to write it in FreePascal. 2. I have been asked to make it a binary ie. not running behind a webserver. Is this possible?
SamS
-1 not answering the question.
Marco van de Voort
A: 

This looks promising, at least as a start.

SOAP is a language neutral specification so in theory you could code in any language. But for your purposes if you can't find a library in pascal that does the grunt work you would be better off using any other language that does. Unless you are specifically looking for a long detour down the rabbit hole of WSDL and such, don't go there.

Duck
Yes I have seen that page. But I still have the question - is it possible to create an executable that will run in the background listening for SOAP requests ? What library is good? Indy? Synapse?
SamS
@SamS - I am not at all familiar with Pascal world these days and actually rather impressed it is as robust as it appears. You can certainly write a standalone executable that runs in the background. It looks to me like this has most of what you need. See the sections on server-side service creation. It appears to have socket classes, etc., ready to use.
Duck
[See the sections on server-side service creation. It appears to have socket classes, etc., ready to use]Where can I find this?
SamS
@SamS - You might be better served by inquiring at the google groups discussion board listed on that page. Apparently you need something called Synapse. If you download the package and unzip it you will see in the "samples" directory some small examples of various kinds of servers.
Duck
Duck - I will try Synapse. Thanks!
SamS
A: 

I would just use Indy, and whatever Delphi soap lib a google search yielded. I would be surprised if there weren't a dozen.

Marco van de Voort
A: 

This is possible with wst and either synapse or indy. wst is alsready included in your Freepascal download. There are some samples included as well, have a look at them.

I have created several soap services with wst + freepascal. You can choose to have them use their own webserver (so they just listen on a certain port, allows for simple debugging) or create an cgi module that you can use in Apache or IIS. You can also create a windows service or linux daemon, all by switching some parameters or including some other files.

It is not easy if you do it for the first time, but certainly possible.

birger