在 Linux 上编写 SOAP 服务 - 需要工具和帮助
我需要为 Linux (CentOS) 编写 SOAP 服务。
我需要使用 Lazarus/FreePascal 来完成此操作。该服务需要是在后台运行的二进制文件(守护进程)。
问题: 1. 这可能吗(作为独立的可执行文件)? 2. 如果没有,有哪些替代方案? 3. 我该如何开始? 4. 我还需要哪些额外的工具/库?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这对于 wst 和 synapse 或 indy 是可能的。 wst 已包含在您的 Freepascal 下载中。还有一些示例,请看一下。
我用 wst + freepascal 创建了几个肥皂服务。您可以选择让他们使用自己的网络服务器(这样他们只侦听某个端口,允许进行简单的调试)或创建一个可以在 Apache 或 IIS 中使用的 cgi 模块。您还可以通过切换一些参数或包含一些其他文件来创建 Windows 服务或 Linux 守护程序。
如果你是第一次这样做,这并不容易,但肯定是可能的。
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.
我可以回答你的一些观点,因为我自己在做:
[fpc-source-dir] 下有示例/packages/fcl-base/example/daemon.pp
和[lazarus-dir]/examples/cleandir/*
下有帮助。
I can answer some of your points since I'm doing it myself:
[fpc-source-dir]/packages/fcl-base/example/daemon.pp
and under[lazarus-dir]/examples/cleandir/*
Hope it helps.
这看起来很有希望,至少作为一个开始。
SOAP 是一种语言中立的规范,因此理论上您可以使用任何语言进行编码。但出于您的目的,如果您找不到 pascal 中的库来完成繁重的工作,那么您最好使用任何其他语言。除非您专门想绕道 WSDL 之类的兔子洞,否则不要去那里。
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.
帕斯卡真的有要求吗?
否则,您可以用 Java 编写 SOAP 服务,那么您的服务将与平台无关。
唯一的要求是 JRE,并且 JRE 可用于任何平台,因此它可以在所有 Linux 版本、WIndows、Mac OsS、Solaris 等上完美运行。
还有很多用于在 Java 中执行 SOAP 的框架。
Pascal 也可以在 Linux 和 Windows 上运行,只需进行一些小的调整,但我不知道 Pascal 现有的良好 SOAP 框架。
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.
我只会使用 Indy,以及谷歌搜索产生的任何 Delphi 肥皂库。如果没有十几个我会感到惊讶。
I would just use Indy, and whatever Delphi soap lib a google search yielded. I would be surprised if there weren't a dozen.