Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi Prism/Database/DataSnap    [ Add a report in this area ]  
Report #:  88815   Status: Open
Delphi Prism ASP.NET clients for Delphi DataSnap Servers
Project:  Embarcadero Prism Build #:  XE
Version:    1.1 Submitted By:   Bob Swart
Report Type:  Crash / Data loss / Total failure Date Reported:  10/10/2010 7:23:51 AM
Severity:    Serious / Highly visible problem Last Updated: 10/11/2010 6:08:23 AM
Platform:    All platforms Internal Tracking #:  
Resolution: Duplicate  Resolved in Build: : None
Duplicate of:  87938
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I experience problems writing a Delphi Prism XE ASP.NET client for DataSnap Servers (while Delphi Prism 2010 works fine).
Given an existing Delphi DataSnap Server, my client is available on the web at http://www.bobswart.nl/webchat/DataSnap.aspx to show the error message (click on the Button).

An exceptions occurs at runtime: Could not load file or assembly 'Borland.Data.DbxCommonDriver, Version=15.0.0.0, Culture=neutral, PublicKeyToken=a91a7c5705831a4f' or one of its dependencies. The system cannot find the file specified.
If I set the property of the DbxCommonDriver reference to copy to the local output directory another exception is triggered instead: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).
Steps to Reproduce:
Steps to reproduce:

- Start Delphi Prism XE
- File | New - Project, select Delphi Prism ASP.NET Web Project

Then, use the Server Explorer to create a new connection to the DataSnap Server (which is up-and-running).
- Right Click in Server Explorer, Add new Connection
- Select DataSnap, click Continue,
- Specify protocol, host, port, path if needed, authentication details, etc.
- Click on Test Connection to verify that a connection could be made.

Right-click on the new node in the Data Connections list, and generate client proxy.
This should produce the Delphi Prism Proxy (in ClientProxy.pas), and add the Borland.Data.AdoDbxClient as well as Borland.Data.DbxClientDriver to the References list.

I can now compile the ASP.NET project, without errors.

Then, add a button and the following code to actually use the DataSnap Client Proxy:

method _Default.Button1_Click(sender: System.Object; e: System.EventArgs);
var
  Client: ClientProxy.TMyServerMethodsClient;
  Connection: Borland.Data.TAdoDbxDatasnapConnection;
begin
  Connection := new Borland.Data.TAdoDbxDatasnapConnection();
  Connection.ConnectionString := 'communicationprotocol=tcp/ip;hostname=127.0.0.1;port=211';
  Connection.Open;
  try
    Client := ClientProxy.TMyServerMethodsClient.Create(Connection);
  finally
    Connection.Close;
  end;
end;

While it compiles in Delphi XE without errors, at runtime it still gives an exception on opening the connection about failing to find Borland.Data.DbxCommonDriver.

Note that the DataSnap Server is running as TCP/IP port 211 server on the same machine. And a client compiled with Delphi Prism 2011 works just fine.

I hate to say it, but it works fine with Delphi Prism 2010 (August release) on my old machine, but it fails when I rebuild the ASP.NET example from scratch using Delphi Prism 2011 or Delphi Prism XE.
Somewhere along the line, something was broken... :-(
Workarounds
None
Attachment
88815.zip
Comments

Bob Swart at 10/10/2010 7:30:44 AM -
I can't seem to add an attachment for this case, but you can download the example source code for the Delphi Prism 2010 and Delphi Prism XE DataSnap clients from http://www.bobswart.nl/webchat/88815.zip

Tomohiro Takahashi at 10/11/2010 6:06:45 AM -
Your issue same as QC#87938 I reproted.
Please see my workaround in it.

Server Response from: ETNACODE01