Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Webservices advice needed
Thu, Dec 6 2018 9:25 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi All,

For a project i need web services to present data from a dataset
(assets/user table - backend dbisam/ewb server) in json format. The
client is another (server) fetching data from my server. Second web
service should allow client to put information which starts a  dataset
update. So 1 service for showing the dataset contents in json format to
client, another for reading json from client and updating dataset.

Service 1 -> List all contents in json format.
I think i can use TBrowser component with URL as dataset:
Browser1.URL :=
'databases?method=rows&database=myDatabase&dataset=myDataset'.
Alternative i need to use TServerRequest. Any advices here which could
be the right thing to do?

Service 2 -> Read json data from client and update dbisam dataset with
incoming info.
Can I parse the incoming data and update my dataset directly in ewb app
or i need to use another TServerRequest?

Currently i am thinking of getting the service to be run by fetching
parameter from server like:
http://myserver/myapp?service1 or http://myserver/myapp?service2
Or should i create a ewb app for each service?

Thanks in advance,
Regards,
Hüseyin

Mon, Jan 7 2019 3:29 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

No one on this?

Tim?

Regards,
Hüseyin

Den 06-12-2018 kl. 15:25 skrev Hüseyin Aliz:
> Hi All,
>
> For a project i need web services to present data from a dataset
> (assets/user table - backend dbisam/ewb server) in json format. The
> client is another (server) fetching data from my server. Second web
> service should allow client to put information which starts a  dataset
> update. So 1 service for showing the dataset contents in json format
> to client, another for reading json from client and updating dataset.
>
> Service 1 -> List all contents in json format.
> I think i can use TBrowser component with URL as dataset:
> Browser1.URL :=
> 'databases?method=rows&database=myDatabase&dataset=myDataset'.
> Alternative i need to use TServerRequest. Any advices here which could
> be the right thing to do?
>
> Service 2 -> Read json data from client and update dbisam dataset with
> incoming info.
> Can I parse the incoming data and update my dataset directly in ewb
> app or i need to use another TServerRequest?
>
> Currently i am thinking of getting the service to be run by fetching
> parameter from server like:
> http://myserver/myapp?service1 or http://myserver/myapp?service2
> Or should i create a ewb app for each service?
>
> Thanks in advance,
> Regards,
> Hüseyin
>
Mon, Jan 7 2019 4:38 AMPermanent Link

ooptimum

The EWB server itself conforms to your description of needed services, as it provides you with data from DB in json and takes updates to DB in json as well, so all you need you already have in place. Another question if your client can work with the data in EWB json format. I guess it can't, thus you ask for advice here. The answer is quite simple - you need to develop a data-proxy service, which would convert data between formats of your client and EWB back and forth. How we can help you in this with zero knowledge about your data format?
Mon, Jan 7 2019 5:02 AMPermanent Link

ooptimum

If your question is about how to write web service in EWB, the first choice you must do is a platform to run your service. Since, I guess, this will be a non-visual EWB javascript application, I recommend Node.js to be used as such platform. I think it's the only viable solution today to run javascript on a server. However, my personal belief is that it's much simpler to develop such a proxy NOT in EWB. The only thing which ties you with EWB in this project is data json format, but it's very simle and could be handled in any language of your choice. So you can use any language and tools you used to, like Delphi etc.
Wed, Jan 16 2019 8:31 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Ooptimum,

Thanks for your input, and sorry for the late reply. I was hoping i
could use EWB webserver for this kind of json web service(s). Displaying
output (json) could be simple i think, i was more thinking of how to
deal with incoming (to update dataset) json with parameters. So my
wishes to tools to use for this task:

- EWB web server
- EWB module from delphi.

Thanks,
Hüseyin

Den 07-01-2019 kl. 11:02 skrev ooptimum:
> If your question is about how to write web service in EWB, the first choice you must do is a platform to run your service. Since, I guess, this will be a non-visual EWB javascript application, I recommend Node.js to be used as such platform. I think it's the only viable solution today to run javascript on a server. However, my personal belief is that it's much simpler to develop such a proxy NOT in EWB. The only thing which ties you with EWB in this project is data json format, but it's very simle and could be handled in any language of your choice. So you can use any language and tools you used to, like Delphi etc.
>
Thu, Jan 17 2019 11:57 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Huseyin,

<< Tim? >>

I'm pretty busy trying to get EWB 3 finished, so my presence will be sporadic here until it's out into beta.

<< For a project i need web services to present data from a dataset (assets/user table - backend dbisam/ewb server) in json format. The client is another (server) fetching data from my server. Second web service should allow client to put information which starts a  dataset update. So 1 service for showing the dataset contents in json format to client, another for reading json from client and updating dataset. >>

If the JSON that is provided from the TEWBDataSetAdapter component is sufficient for the clients, then you can just use it in a web server module with the EWB Web Server:

https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2mod&product=rsdelphiwin32&version=10R&comp=TEWBDataSetAdapter

If you need a custom JSON format, then you can use this component to write out the data in the desired format, using the source dataset:

https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2mod&product=rsdelphiwin32&version=10R&comp=TEWBJSONWriter

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 27 2019 11:56 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi Tim,

Can I use TServerRequest without a module to produce the json output
like this:

http://server/databases?method=rows&database=myDatabase&dataset=myDataset

This is pure json and something the client can use. The client can also
use the url directly but it would look more nice if i could call
something like this:

http://server/myServerRequest

making same output - > pure json from dataset?

Thanks.
Hüseyin

Den 17-01-2019 kl. 17:57 skrev Tim Young [Elevate Software]:
> Huseyin,
>
> << Tim? >>
>
> I'm pretty busy trying to get EWB 3 finished, so my presence will be sporadic here until it's out into beta.
>
> << For a project i need web services to present data from a dataset (assets/user table - backend dbisam/ewb server) in json format. The client is another (server) fetching data from my server. Second web service should allow client to put information which starts a  dataset update. So 1 service for showing the dataset contents in json format to client, another for reading json from client and updating dataset. >>
>
> If the JSON that is provided from the TEWBDataSetAdapter component is sufficient for the clients, then you can just use it in a web server module with the EWB Web Server:
>
> https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2mod&product=rsdelphiwin32&version=10R&comp=TEWBDataSetAdapter
>
> If you need a custom JSON format, then you can use this component to write out the data in the desired format, using the source dataset:
>
> https://www.elevatesoft.com/manual?action=viewcomp&id=ewb2mod&product=rsdelphiwin32&version=10R&comp=TEWBJSONWriter
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
Wed, Feb 27 2019 12:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Huseyin,

<< Can I use TServerRequest without a module to produce the json output like this: >>

You're mixing up the client-side code with the server-side code: the TServerRequest component is a component that is used in the browser.

<< This is pure json and something the client can use. The client can also use the url directly but it would look more nice if i could call something like this:

http://server/myServerRequest

making same output - > pure json from dataset? >>

You can do that, but again, you'll need to write your own web server module (for the EWB Web Server) or use some other type of server-side code to handle the request and return the proper JSON content.

Tim Young
Elevate Software
www.elevatesoft.com
Image