Receiving a returned memory stream in WEB Core

Hello,

I have the following service on a XDATA server:

[HttpGet]
 function GetUserList: TStream;
....
**Implemented as** 
function TUserDataService.VerifyUserNamePassword(UserName: string; Password: string): integer;
begin
  Result := dmUserData.VerifyUserNamePassword(UserName, Password);
end;

This is returning a JSON dataset representing a user list

This is being called from a Web Core application and I cannot figure how to receive the data being requested by the call.

Using Postman I can see the server is returning the expected data:

From the web client I issue the following request:

xdGetUserList.RawInvoke('IUserDataService.GetUserList', []);

However, When I try to retrieve the response using the something like the following snippet :

procedure TfDashboard.xdGetUserListLoad(Response: TXDataClientResponse);
begin
  ShowMessage(Response.ResponseText);
end;

I get an exception about the returned type being a blob instead of text. So, how do I retrieve the Blob?

Thanks,

Alan

I solved it by changing the result from TStreamData to a simple string.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.