datasnap

Upload file to DataSnap REST server via TStream

让人想犯罪 __ 提交于 2019-12-01 12:24:52
I've built a DataSnap REST server using Delphi XE2 and I've added a server method for uploading files via TStream : function TServerMethods.updateUploadFile(sFilename: string; UploadStream: TStream): string; I want to be able to call this from a number of different clients (Android, iOS etc) and I've been testing the method using various REST clients such as Postman (Chrome plugin). However so far I cannot get it to accept the content for the HTTP POST body. Whenever I send the POST command I always get the following response : {"error":"Message content is not a valid JSON value."} I've tried

How to Modify Field Values in TDataSetProvider.OnUpdateData

早过忘川 提交于 2019-12-01 12:22:29
After reading the Delphi help file about TDataSetProvider.OnUpdateData event explanation: Examine data (for example, for values or data changes that should not permitted), and raise exceptions that cancel applying of updates before they occur. Change data (for example encrypting or decrypting values) before it is sent on to the source dataset or database server. I am looking for a sample code of how to change data for OnUpdateData. I have tried my best to look for solution. This is what I can achieve: Example 1 : procedure TDBNextDocNo.DSPUpdateData(Sender: TObject; DataSet:

IPv6 connection with DataSnap

淺唱寂寞╮ 提交于 2019-12-01 09:10:24
At WWDC 2015 Apple announced the transition to IPv6-only network services in iOS 9. Starting June 1, 2016 all apps submitted to the App Store must support IPv6-only networking. My Delphi IOS App have a IPv4 IP, im using a TDSRestConnection now in the Host property i set 2112:d8ac:64c4::d8bc:64c4 and say "error is socket error11004" if i use the IPv4 format all is fine. How i make my IOS app use IPv6. I'm Using XE8, Rest DataSnap Server 来源: https://stackoverflow.com/questions/37691084/ipv6-connection-with-datasnap

IPv6 connection with DataSnap

回眸只為那壹抹淺笑 提交于 2019-12-01 06:50:08
问题 At WWDC 2015 Apple announced the transition to IPv6-only network services in iOS 9. Starting June 1, 2016 all apps submitted to the App Store must support IPv6-only networking. My Delphi IOS App have a IPv4 IP, im using a TDSRestConnection now in the Host property i set 2112:d8ac:64c4::d8bc:64c4 and say "error is socket error11004" if i use the IPv4 format all is fine. How i make my IOS app use IPv6. I'm Using XE8, Rest DataSnap Server 来源: https://stackoverflow.com/questions/37691084/ipv6

How to skip field serialization at JSON marshalling in DataSnap?

不打扰是莪最后的温柔 提交于 2019-12-01 05:44:02
Is there a generic way to skip field serialization at JSON marshalling in Delphi XE2 DataSnap ? TBizObjects = class DataObject: TDataObject; -- skip this field on serializaing descendants end; Model = class(TBizObject); The solution is quite easy but very well hidden. You should set the JSONMarshalled class attribute to False for fields you don't want to serialize or deserialize. Assume you have declared the following class you want to marshal: type TPerson = class private FName: string; FSurname: string; FHeight: Integer; public constructor Create; destructor Destroy; override; end; In this

How to skip field serialization at JSON marshalling in DataSnap?

别说谁变了你拦得住时间么 提交于 2019-12-01 02:22:57
问题 Is there a generic way to skip field serialization at JSON marshalling in Delphi XE2 DataSnap ? TBizObjects = class DataObject: TDataObject; -- skip this field on serializaing descendants end; Model = class(TBizObject); 回答1: The solution is quite easy but very well hidden. You should set the JSONMarshalled class attribute to False for fields you don't want to serialize or deserialize. Assume you have declared the following class you want to marshal: type TPerson = class private FName: string;

big streams with DataSnap

别来无恙 提交于 2019-11-30 22:51:26
I'm trying to transfer some big streams (~1Mb) between DataSnap server/client but to no avail. I'm trying to understand the code of Jim Tierney ( http://blogs.embarcadero.com/jimtierney/2009/04/06/31461 ) with no luck and i can't even compile the code because of a missing library, anyway ... The max size of a stream i`m able to receive is 64k, so any tips/ideas/code samples you can provide for a weekend programmer like me will be very welcomed. Thank you! my server code: function TsrvMethods.getStream(iCount: integer): TStream; begin Result := dummyStream('0123456789', iCount); end; function

Reconcile Error: Has anyone had problems with truncated error messages?

泄露秘密 提交于 2019-11-30 19:41:43
I'm here again to ask for a help to you. This time I believe that few will respond given the great particularity of the problem which I will relate. I'm starting in the world of DataSnap, and still have things I do not understand how this error I will relate. My Delphi is XE (version 1, Update1). I am using Postgres which generates error messages in Portuguese (Portuguese Brazil) and for this reason the error messages have accents. The connection components are ZeosLib package. I am using a dialog box "reconcile error" to display errors arising from the application of updates and to test, I

Is it possible to recompile the DataSnap packages in Delphi XE with a new/different version of Indy?

匆匆过客 提交于 2019-11-30 18:47:36
Okay -- we have an interesting problem. Some background: Our main application uses Indy 10. However, we take the Indy 10 source and fix bugs in it, recompile, and install our own set of Indy components. We are migrating to Delphi XE and want to start using DataSnap. DataSnap requires the "official, shipping" version of Indy which is incompatible with our customized version of Indy. Our DataSnap servers will be separate applications, but since we have our own Indy installed in the IDE, we can't "cross the streams". Okay, therefore, we are unable to use Delphi XE's DataSnap out of the box

Android开发数据库三层应用-DataSnap

喜欢而已 提交于 2019-11-30 18:32:08
Android开发数据库三层应用-DataSnap 时间:2013-10-24 13:41:54 点击:4988   核心提示: 我觉得Delphi最强大的的功能之一就是开发数据库三层应用的DataSnap,在Android上的实现,首先是完成服务器的设计:(1)利用向导完成DataSnap服务器的框架,如下图:由于是实验,所以选择VCL程序,如果是实际应用,建议Service程序我习惯使用TCP/IP作为通讯协议,简单且速度... 我觉得 Delphi 最强大的的功能之一就是开发数据库三层应用的 DataSnap ,在 Android 上的实现,首先是完成服务器的设计: ( 1 )利用向导完成 DataSnap 服务器的框架,如下图: <!--[if !vml]--> <!--[endif]--> 由于是实验,所以选择 VCL 程序,如果是实际应用,建议 Service 程序 <!--[if !vml]--> <!--[endif]--> 我习惯使用 TCP/IP 作为通讯协议,简单且速度快, Sample Methods 是演示和测试用 <!--[if !vml]--> <!--[endif]--> 缺省 211 端口 <!--[if !vml]--> <!--[endif]--> 使用 TDSServerModule 作为数据服务提供主体,非常方便变更为 Service