用于Delphi XE的SOAP服务器和客户端应用程序VCL + indy演示? [英] SOAP server and client application VCL+indy demo for Delphi XE?

查看:296
本文介绍了用于Delphi XE的SOAP服务器和客户端应用程序VCL + indy演示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi曾经包含一个用于Web服务的演示文件夹,但似乎不再包含它。

Delphi used to include a demos folder for web Services, but no longer seems to include this.

我刚刚尝试了Delphi 7演示项目( SOAPDMServerWAD ,几乎完全没有UI的服务器, SOAPDMClient ),即使在Delphi 7中也无法使它们正常运行。

I just tried the Delphi 7 demo projects (SOAPDMServerWAD, a server with almost no UI at all, and SOAPDMClient) and was unable to get them to function, even in Delphi 7.

如果有人曾经在Delphi XE或Delphi 2010中进行过类似的演示工作,则与旧的 SOAPDMServerWAD + SoapDMClient 演示,可以在Delphi XE中工作,并且至少具有来自Delphi SOAP Server应用程序向导的最小UI,这将是完美的。

If anybody has ever made a similar demo work in Delphi XE, or Delphi 2010, identical to the old SOAPDMServerWAD+SoapDMClient demos, working in Delphi XE, and with at least the minimal UI that comes from the Delphi SOAP Server application wizard, that would be perfect.

更新:该演示在Delphi 2010之前一直出现,但是使用了已经过时的WAD(web-app-debugger),我试图将其移植到新的Indy runtime / web-app -development-harnessing-code ,但我似乎无法正常工作。该演示正在运行,但是该服务器没有用户界面,并且似乎没有运行任何HTTP服务器(已通过 http:// localhost:port / 网址。顺便说一句,尝试谷歌搜索一个演示,然后出现这个网址,我不到一个小时前问了。谷歌,这很吓人。

Update: The demo appears all the way up to Delphi 2010 but uses the now-obsoleted WAD (web-app-debugger), I tried to port it to the new Indy runtime/web-app-development-harnessing-code, but I can't seem to get it working. The demo runs, but the server has no User interface, and does not appear to be running any HTTP server (tested using a regular web browser, via http://localhost:port/ urls. By the way, try googling for a demo, and this url comes up, and I asked less than an hour ago. That's scary, google.

Update2 参见下面我自己的回答,一个链接即将包含工作代码。

Update2 See my own answer below, a link is coming soon with working code.

推荐答案

我已经发布了 CodeCentral项目28789上的完整SOAP演示

其中包含 WebServices 文件夹中的每一个Delphi 2007时代的SOAP演示,现已针对Delphi XE和XE2更新,包括转换旧的WAD。将服务器添加到新的INDY VCL服务器中,您会认为这是令人印象深刻的,除非不是,这确实很简单,只需使用向导创建一个新项目,然后添加Web服务接口并实现离子单元以及旧演示中的任何其他单元,都属于该项目。将它们添加到项目后,它们就可以工作。 基本演示SOAP Servers确实很容易在Delphi中构建,一旦有了有效的演示,您将发现修改和扩展它非常容易。

These contain every single one of the Delphi 2007 era SOAP demos from the WebServices folder, now updated for Delphi XE and XE2, including converting the old WAD servers into new INDY VCL servers. You'd think that was impressive, except it's not. It's really easy. Just use the wizard to create a new project, and then add the web service interface and implementation units, and any other units that belong in the old demo, to the project. Once they're added to the project, they just work. Basic demo SOAP Servers are really easy to build in Delp once you have a working demo, you'll find it's pretty easy to modify and extend it.

最能回答我上述问题的演示位于 SOAPDataModule 子文件夹中。

The demo that best answers the question I asked above is in the SOAPDataModule sub-folder.

从2007年时代开始的演示的基本问题是两个:

The basic problems with the demo from the 2007 era are two:


  1. WAD(Web应用程序调试器)已经消失了。您必须使用Indy服务器来制作新服务器,以实现最佳演示目的,从而避免在IIS下使用WAD(已不可用)或设置ISAPI环境,而这对于演示目的而言并不理想。我创建的新演示项目称为 SoapDMServerINDY ,它包含一个数据模块(datamod_u.pas),一个VCL表单用户界面单元( IndyServerVCLFormUnit.pas $ c>)和一个名为 IndyServerWebModule.pas 的I​​ndy Server Web模块。

  1. The WAD (web app debugger) is gone. you have to make a new server using the Indy server, for optimal demo purposes, saving you from using WAD (which is gone) or setting up ISAPI environment, under IIS, which is hardly ideal for demo purposes. The new demo project I made is called SoapDMServerINDY, and it consists of a data module (datamod_u.pas), a VCL form User Interface unit (IndyServerVCLFormUnit.pas) and an Indy Server web module, called IndyServerWebModule.pas.

The Delphi 2007演示由于采用了可执行演示文件的Debug / Win32子文件夹的新做法而中断,您需要进一步进行研究。我已修复了演示服务器,以便在找不到数据文件时向您发出错误消息警告您,从而使您摆脱了神秘的 XML解析错误。我还在一些演示中添加了一些错误检查,以便告诉您需要安装interbase才能运行此演示,因为一些演示需要安装并运行Interbase,而一个存在一个名为IBLOCAL的别名,并且最好存在一个名为 EMPLOYEE 的表。

The Delphi 2007 demo broke thanks to the new practice of having a Debug/Win32 subfolder that the demo executable is now in, you need to go up further. I fixed the demo server so that it warns you with an error message if the data files cannot be located, saving you from the mysterious "XML parsing error". I also added some error checking in a few of the demos so that it tells you that you need to install interbase for this demo to work, since some of the demos require Interbase installed and running, and one requires an alias called IBLOCAL to exist, and preferably a table called EMPLOYEE to exist.

此演示的元素包括服务器( SoapDMServerINDY ,基于SOAPDMServerWAD的代码)和客户端 SOAPDMClient ,该客户端连接到演示并具有两页,一页将显示通过DBGrid +数据集远程处理的基本数据访问,第二页显示如何调用自定义SOAP方法。

The elements of this demo are a server (SoapDMServerINDY, based on the code from SOAPDMServerWAD), and the client SOAPDMClient which connects to the demo and has two pages, one page will show basic data access via a DBGrid + dataset remoting, and the second page shows how to invoke a custom SOAP method.

要使用该演示,您必须启动服务器,单击开始按钮,然后启动客户端,然后单击连接。

To use the demo: You have to start the server, click the start button, then start the client and click Connect.

这篇关于用于Delphi XE的SOAP服务器和客户端应用程序VCL + indy演示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆