Jump to content


Photo

DataSnap proxy generator problem

datasnap proxy generator widestring; TDBXStreamValue delphi xe5

  • Please log in to reply
6 replies to this topic

#1 JBS

JBS
  • Members
  • 4 posts

Posted 19 December 2014 - 12:06 PM

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

 


  • Ekbergket, Danielfem, HowardtorY and 5 others like this

#2 gabr42

gabr42

    Boss

  • Administrators
  • 192 posts

Posted 19 December 2014 - 12:47 PM

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.



#3 JBS

JBS
  • Members
  • 4 posts

Posted 19 December 2014 - 01:37 PM

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...



#4 JBS

JBS
  • Members
  • 4 posts

Posted 19 December 2014 - 02:35 PM

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.



#5 gabr42

gabr42

    Boss

  • Administrators
  • 192 posts

Posted 20 December 2014 - 07:35 PM

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/.



#6 gabr42

gabr42

    Boss

  • Administrators
  • 192 posts

Posted 20 December 2014 - 11:04 PM

I have created a tutorial on that topic: http://smartmobilest...ector-importer/.



#7 JBS

JBS
  • Members
  • 4 posts

Posted 09 January 2015 - 06:29 PM

thanks gabr42! it works right away when i follow the tutorial.







Also tagged with one or more of these keywords: datasnap, proxy generator, widestring;, TDBXStreamValue, delphi, xe5

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users