What Structure/Role of a Web Service?

Asked

Viewed 92 times

0

I have a project in which I should create a website and an application (Intel XDK) of the same, I thought it would be more ideal to have a 'core' of the application itself to make the database communication, so in the site only go ordering the data by PHP and in the application request by Ajax.

I know a little about the concept of Web Service, from what I understand, the Web Service could be this 'core', but I’ve never done one, I don’t know the structure of one and I don’t even know if that’s the purpose of a Web Service.

Would it really be ideal to use it? Or would it be better to share a Model?

I researched a lot about Web Service only that I could not understand how it is structured, someone could indicate or show a simple example so that I can start the base of my?

1 answer

1


I don’t know exactly what those requisitions would be, but I think a Webservice would suit your purpose.

As the name says a Webservice is a service that runs on the Web in order to provide information to all customers who request it. The structure is simple: a server with external access and connection to another database server. The service runs on the server that can be accessed externally by the specified address and ports. Webservice routines receive requests, query in the database, package the data - usually in JSON - and return to the client.

There are several examples on the web using SOAP or Restfull technology with PHP, JAVA and others.

See an example here.

https://trinitytuts.com/build-first-web-service-php/

  • From the research I did, I think I can leave as it is, the site will be done with MVC, so just change the Controller to return the json array according to the origin of the request.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.