Webservice php without using Soap?

Asked

Viewed 92 times

2

I have no familiarity with Webservice and wanted to know how to make one without the need to use Soap (to take data from the database and consume in Android Studio).

  • Of course! php is not my thing, but you can use the REST architecture in your project. here are some examples: http://answall.com/questions/127929/cria-servi%C3%A7o-Rest-php

  • Face uses json besides being easy any language interprets.

1 answer

0


Use JSON as a return... There on Android you receive with the aid of some library and create the objects using Gson

Simple example in php that returns a JSON array:

$result = $this->con->query("SELECT * FROM usuario");

    if ($result->num_rows > 0) {

        while ($obj = mysqli_fetch_object($result)) {
            $lista[] = $obj;                
        }
    }

    return $lista;

Browser other questions tagged

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