Developing Web Service database program with Delphi

Source: Internet
Author: User
Tags soap web services

The first step: writing the server application

First in the Delphi IDE, select "file| new| Other ... ", and then select the SOAP Server application icon in the WebServices page.

Then select the Web App Debugger executable in the new Soap Server Application dialog box.

After clicking on the OK button, Delphi automatically generates a webmodule that contains three WebServices controls in this module.

Then select the SOAP Server Data module icon in the WebServices page, and after OK, Delphi pops up the Soap Data Module Wizard dialog box.

Enter the class name in class name: D6dbdatamodule1. Click OK, Delphi will automatically generate a SOAP data module, in the module to add Tdatabase, Tquery, Tdatasetprovider, three controls.

Setting the properties of each control is essentially the same as the previous Delphi database application, where Tdatasetprovider is a DataAccess control that provides support for remote calls.

Compile and execute the application so that it is registered. Complete the server-side application design.

Step two: Write the client application

Add a new Application project, add Tdbnavigator to the form, Tdbgrid control.

Then add a data module in which tsaopconnection, TClientDataSet, and Tdatasource controls are added.

The Tsaopconnection control is the interface that utilizes the SOAP protocol to connected with the remote server.

Http://WebServer Address/WebService name of the application name/soap/soapserverdatamodule

Then set the properties of the TClientDataSet control, set the RemoteServer property to the Tsaopconnection control's name, and click ProviderName.

Next, add the following code to the cell where the form is located:

unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids;
type
TForm4 = class(TForm)
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses Unit5,DB; //引用DataModule所在单元;
{$R *.dfm}
end.

The DataSource property of the Tdbnavigator,tdbgri control is set to Dmdemo1.dsdemo1, where DmDemo1 is the name of the data module, DsDemo1 as the name of the Tdatasource control in the data module.

Activates the active property of TClientDataSet to True, compiles the project group, and copies the client program to any computer on the network to perform. An example of a Web Services database application is completed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.