Jump to content
JBS

DataSnap proxy generator problem

Recommended Posts

hi everyone,

 

i am trying to do my first datasnap connection between a delphi xe5 datatsnap server and a sms-client.

 

after generating the connection unit with the "DataSnap Smart" proxy generator i am confronted with tow compiling errors and a warning.

 

.warning with uses w3system: no problem easyly solved by using SmartCL.System

 

.2 errors "unknown name" TDBXStreamValue and WideString:

  TResult_TServerMethods1_AS_Execute = class external
    ParamReader: TDBXStreamValue;
    OwnerDataStream: TDBXStreamValue;
  end;

and

    procedure AS_Execute(ProviderName: WideString; CommandText: WideString; ParamReader: TDBXStreamValue; OwnerDataStream: TDBXStreamValue);

please help!

 

cheers,

JBS

 

Share this post


Link to post
Share on other sites

Sorry about the w3system problem, we forgot to change this in the template 

 

TDBXStreamValue problem occurs because our DataSnap doesn't yet know how to handle streams. We'll look into that problem in the next few days and I'll report the findings here. Can you show us the server side definition of this service?

 

The WideString problem is caused by the flaw in the code generator which 'forgets' to replace WideString with string. Just change WideString to string and everything should work.

Share this post


Link to post
Share on other sites

thanks for the fast reply!

 

i am rather new to the datatsnap topic.

 

i built a datasnap server using the wizzard and the sample methods.

function TServerMethods1.EchoString(Value: string): string;
begin
  Result := Value;
end;

function TServerMethods1.ReverseString(Value: string): string;
begin
  Result := System.StrUtils.ReverseString(Value);
end;

i guess that i can query the interface definition via webbrowser somehow...

Share this post


Link to post
Share on other sites

short update: i deleted the "AS_Execute" class and procedure definition from my genereted unit and was able to call the "ReverseString" method :-)

 

i will continue testing more complex methods...

 

what i am aiming at is to connect to a TDataSetProvider somehow.

Share this post


Link to post
Share on other sites

I tested DataSnap functionality with XE2 DataSnap server and with a XE7 DataSnap server and it works fine. At the moment I don't have an option to test XE5, but I'll do that in few days.

 

In the meantime, please check that you are creating DataSnap service in a "correct" manner (i.e. in a manner that creates a service, compatible with Smart).

 

1. Create a _REST_ server, not the "old one".

2. On a page where features are selected, check "Mobile Connectors". This is important!

3. Start the server. If you are hosting it in a VCL/FireMonkey application, click the Start button.

 

On a client, import datasnap service from http://yourmachine:datasnapport/.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×