0% found this document useful (0 votes)
37 views9 pages

Chapter16 Web Services - Publish

The document discusses consuming web services from Android apps using SOAP and REST. It covers the basics of web services, how to call them from Android including examples of SOAP with .NET and REST with PHP. It also compares REST and SOAP approaches.

Uploaded by

Linh Linh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views9 pages

Chapter16 Web Services - Publish

The document discusses consuming web services from Android apps using SOAP and REST. It covers the basics of web services, how to call them from Android including examples of SOAP with .NET and REST with PHP. It also compares REST and SOAP approaches.

Uploaded by

Linh Linh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

CONTENTS

OVERVIEW
CLIENT SIDE – CONSUMING WEBSERVICES
EXAMPLES

MOBILE DEVELOPMENT
CONSUMING WEB SERVICES USING SOAP AND REST APPS

OVERVIEW
OVERVIEW (Advantages of using the webService architecture)
A WebService is a Consumer_Machine-to-Provider_Machine collaboration schema that operates
over a computer network.
Under the WebService strategy the invoked functions
The data exchanges occur independently of the OS, browser, platform, and programming
are implemented once (in the server) and called many
languages used by the provider and the consumers. times (by the remote users).
A provider may expose multiple EndPoints (sets of WebServices), each offering any number of
typically related functions. Some advantages of this organization are:
WebServices expect the computer network to support standard Web protocols such as XML, ◦Elimination of redundant code,
HTTP, HTTPS, FTP, and SMTP. ◦Ability to transparently make changes on the server to
Example: Weather information, money exchange rates, world news, stock market quotation are update a particular service function without clients having
examples of applications that can be modeled around the notion of a remote data-services
provider surrounded by countless consumers tapping on the server’s resources.
to be informed.
◦Reduced maintenance and production costs.

OVERVIEW
(Why should Android developer learn how to
create a WebService?) OVERVIEW (WEBSERVICE ARCHITECTURE)
Simple apps are usually self-contained and do not need to collaborate with other parties to An ideal Webservice provider is designed around four logical layers which define the ways in
obtain additional data or services (for instance, think of a scientific calculator) which data is to be transported, encoded, exposed and discovered by the users.
However, there are many cases in which the data needed to work with is very extensive, or Layers Responsibility
changes very often and cannot (should not) be hard-coded into the app. Instead, this kind of data
should be requested from a reliable external source (for instance, what is the Euro-to-Dollar rate Transport Move messages through the network, using HTTP, SMTP, FTP, …
of change right now?) Messaging Encoding of data to be exchanged (XML)

Another class of apps requires a very high computing power perhaps not available in the mobile Description WSDL (Web Service Desc. Lang) used for describing public methods available from the
device (think of problems such as finding the shortest/fastest route between to mapped endpoint
locations, or best air-fare & route selection for a traveler) Discovery UDDI (Universal Description & Discovery Integration) facilitates location and publishing of
services through a common registry
It is wise for an Android developer to learn how to solve typical problems that exceed the
capacities of the handheld devices. Understanding the possibilities offered by the client-server
computing model will make the developer be a more complete and better professional.
CLIENT SIDE – CONSUMING WEBSERVICES CLIENT SIDE – CONSUMING WEBSERVICES
There are two widely used forms of invoking and consuming Example: Using REST. The following URL is used to make a call to the Google Search service
WebServices: asking to provide links to the subject “Cleveland State University”
◦ Representational State Transfer (REST): Closely tie to the HTTP protocol by https://www.google.com/search?q=cleveland+state+university
associating its operation to the common methods: GET, POST, PUT, DELETE for
HTTP/HTTPS. This model has a simple invocation mode and little overhead. Transport Provider Action Arguments
Service calls rely on a URL which may also carry arguments. Sender & receiver
must have an understanding of how they pass data items from one another. As
an example: Google Maps API uses the REST model.
◦ Remote Procedure Call (RPC): Remote services are seen as coherent
collections of discoverable functions (or method calls) stored and exposed by
EndPoint providers. Some implementations of this category include: Simple
Object Access Protocol (SOAP), Common Object Request Broker Architecture
(CORBA), Microsoft's Distributed Component Object Model (DCOM) and Sun
Microsystems's Java/Remote Method Invocation (RMI).

CLIENT SIDE – CONSUMING WEBSERVICES CLIENT SIDE – CONSUMING WEBSERVICES


(REST vs. SOAP) (WebClient consuming services using REST & SOAP)
Although SOAP and REST technologies accomplish the same final
goal, that is request and receive a service, there are various
SOAP
differences between them. Android Request: XML envelope holding

◦ REST users refer to their remote services through a conventional URL that
function-name, arguments.
Web-Client Response: XML formatted results WSDL Exploration Tool
commonly includes the location of the (stateless ) server, the service name, REST
Using common URL
the function to be executed and the parameters needed by the function to Request
http://provider.org?op=function& arg1=val1& arg2=val2
operate (if any). Data is transported using HTTP/HTTPS. Response
Free format. Options include: Plain-text, HTML, XML, JSON…
◦ SOAP requires some scripting effort to create an XML envelop in which data
travels. An additional overhead on the receiving end is needed to extract data
from the XML envelope. SOAP accepts a variety of transport mechanisms,
among them HTTP, HTTPS, FTP, SMTP, etc.
◦ SOAP uses WSDL (WebService Description Language) for exposing the format and operation of the
services. REST lacks an equivalent exploratory tool.

EXAMPLES OF ANDROID APPS USING REST & SOAP WINDOWS COMMUNICATION FOUNDATION (WCF)
In the next sections we will present three examples showing how an WCF is a Microsoft technology that provides a framework for writing
Android web-client typically interacts with a remote server code to communicate across heterogeneous platforms [1, 2].
requesting and consuming WebServices. ◦ 1. An IIS WebServer may host various EndPoints (WebServices).
◦ Example 1. SOAP client / .NET provider: An Android app uses a XML KSOAP
envelope to call a Windows IIS server. WebServices are implemented as a set ◦ 2. Each of those EndPoints uses WSDL to provide a way of exposing its
of C#.NET functions. composition and behavior to clients wishing to find and
◦ Example 2. REST client / PHP provider: A REST Android client invokes remote communicate with the services.
PHP services which consult a database on behalf of the client. The response is
formatted using JSON. ◦ 3. Each endpoint includes:
◦ Example 3. REST client / Servlet provider: Our Android app communicates with ◦ address (URL - where to send messages), WCF ASMX
an Tomcat Server in which its WebServices are implemented as Java Servlets. ◦ binding (how to send messages ), and a
As in the previous example, the results of a database query are returned as a ◦ contract (an explanation of what messages contain)
JSON string.
https://docs.microsoft.com/en-us/archive/msdn-magazine/2006/february/learn-the-abcs-of-programming-windows-communication-foundation
https://docs.microsoft.com/en-us/dotnet/framework/wcf/getting-started-tutorial?redirectedfrom=MSDN
WINDOWS COMMUNICATION FOUNDATION
(WSDL service contracts) WINDOWS COMMUNICATION FOUNDATION (WCF)
Example: Removing “?WSDL” from the links will exposes endpoint service functions

ASMX WCF ASMX WCF

WINDOWS COMMUNICATION FOUNDATION


WINDOWS COMMUNICATION FOUNDATION (WCF) (Example 1: Java HttpUrlConnection web-client)
Figures shows WSDL Service Contracts & SOAP Envelopes (ASMX) This example consists of two parts. Firstly we construct a server-side EndPoint offering a set of
Windows IIS web-services, in the second part we build an Android HttpUrlConnection client that
requests and consumes the previous web-services.
◦ Server-side software: provide a step-by-step tutorial describing how to create a web-service running on
a Windows IIS-Server. We will create additional one methods: add2Integer.
◦ Client-side: HttpUrlConnection facilitates sending requests and receiving results to/from an IIS server.

Android Envelope holding REQUEST Windows Machine


XML Package containing URL, Namespace, IIS Server
Outgoing Envelop
Client Method, <Argument, Value> set
+ C#.NET

SOAP
(Request) Envelope with RESPONSE
HttpUrlConnection XML <tag>…..</tag> Web-
DATA
Services BASE
Incoming Envelop
(Response)

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
1. Create webservice application project 1. Create webservice application project
WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION
(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
1. Create webservice application project 1. Create webservice application project

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy webservice application project in IIS 2. Deploy webservice application project in IIS

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy webservice application project in IIS 2. Deploy webservice application project in IIS
WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION
(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy webservice application project in IIS 2. Deploy webservice application project in IIS

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
3. Run webservice application project in IIS 4. Create Android application (XML layout)
<?xml version=“1.0” encoding=“utf-8”?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app=“http://schemas.android.com/apk/res-auto”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
tools:context=“.MainActivity”>
<TextView android:id=“@+id/txtResult”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“Hello World!”
app:layout_constraintBottom_toBottomOf=“parent”
app:layout_constraintLeft_toLeftOf=“parent”
app:layout_constraintRight_toRightOf=“parent”
app:layout_constraintTop_toTopOf=“parent” />
</androidx.constraintlayout.widget.ConstraintLayout>

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
4. Create Android application (MainActivity.java) 4. Create Android application (MainActivity.java)
public class MainActivity extends Activity { con.setRequestProperty(“Host”, “localhost”);
TextView result; con.setRequestProperty(“Content-Type”, “text/xml; charset=utf-8”); String reqXML = “…” + “<a>” +
Handler handler = new Handler() { con.setRequestProperty(“Content-Length”, String.valueOf(reqXML.length()));
@Override con.addRequestProperty(“SOAPAction”, “http://tempuri.org/Add2Integer”); 5 + “</a><b>” + 4 + “</b>…”
public void handleMessage(Message msg) { con.setRequestMethod(“POST”); con.setDoInput(true); con.setDoOutput(true);
super.handleMessage(msg); //Xml message
result.setText((String) msg.obj); OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream(), StandardCharsets.UTF_8);
} writer.write(reqXML);
}; writer.flush();
@Override if(con.getResponseCode() == HttpURLConnection.HTTP_OK) {
protected void onCreate(Bundle savedInstanceState) { byte[] byteBuf = new byte[1024];
super.onCreate(savedInstanceState); InputStream resStream = con.getInputStream();
setContentView(R.layout.activity_main); int resLen = 0, len = resStream.read(byteBuf);
result = (TextView) findViewById(R.id.txtResult); while (len > -1) {
Thread slowJob = new Thread() { resLen += len; resultValue += new String(byteBuf); len = resStream.read(byteBuf);
@Override }
public void run() { }
String resultValue = “”; HttpURLConnection con = null; }
try { catch (Exception ex){ resultValue = “\nERROR: ” + ex.getMessage(); }
String reqXML = “…”; note // send message to handler so it updates GUI
// Creating the HttpURLConnection object Message msg = handler.obtainMessage(); msg.obj = (String) resultValue; handler.sendMessage(msg);
URL oURL = new URL(“http://192.168.1.9/DemoWebService/WebService1.asmx”); if(con != null) con.disconnect();
con = (HttpURLConnection) oURL.openConnection(); }
};
slowJob.start();
}
}
WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION
(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
1. Create wcf-service application project 1. Create wcf-service application project

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
1. Create wcf-service application project 1. Create wcf-service application project

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy wcf-service application project in IIS 2. Deploy wcf-service application project in IIS
WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION
(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy wcf-service application project in IIS 2. Deploy wcf-service application project in IIS

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy wcf-service application project in IIS 2. Deploy wcf-service application project in IIS

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
2. Deploy wcf-service application project in IIS 2. Deploy wcf-service application project in IIS
WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION
(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
3. Run wcf-service application project in IIS 4. Create Android application (XML layout)
<?xml version=“1.0” encoding=“utf-8”?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:app=“http://schemas.android.com/apk/res-auto”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
tools:context=“.MainActivity”>
<TextView android:id=“@+id/txtResult”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text=“Hello World!”
app:layout_constraintBottom_toBottomOf=“parent”
app:layout_constraintLeft_toLeftOf=“parent”
app:layout_constraintRight_toRightOf=“parent”
app:layout_constraintTop_toTopOf=“parent” />
</androidx.constraintlayout.widget.ConstraintLayout>

WINDOWS COMMUNICATION FOUNDATION WINDOWS COMMUNICATION FOUNDATION


(Example 1: Java HttpUrlConnection web-client) (Example 1: Java HttpUrlConnection web-client)
4. Create Android application (MainActivity.java) 4. Create Android application (MainActivity.java)
public class MainActivity extends Activity { con.setRequestProperty(“Host”, “localhost”);
TextView result; con.setRequestProperty(“Content-Type”, “text/xml; charset=utf-8”); String reqXML = “<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
Handler handler = new Handler() { con.setRequestProperty(“Content-Length”, String.valueOf(reqXML.length()));
con.addRequestProperty(“SOAPAction”, “http://tempuri.org/IService1/GetData”);
@Override
public void handleMessage(Message msg) { con.setRequestMethod(“POST”); con.setDoInput(true); con.setDoOutput(true); “ <s:Header/>\n” +
super.handleMessage(msg); //Xml message

}
result.setText((String) msg.obj); OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream(), StandardCharsets.UTF_8);
writer.write(reqXML);
“ <s:Body>\n” +
}; writer.flush();
@Override if(con.getResponseCode() == HttpURLConnection.HTTP_OK) { “ <GetData xmlns=\“http://tempuri.org/\”>\n” +
protected void onCreate(Bundle savedInstanceState) { byte[] byteBuf = new byte[1024];

“ <value>” + 2 + “</value>\n” +
super.onCreate(savedInstanceState); InputStream resStream = con.getInputStream();
setContentView(R.layout.activity_main); int resLen = 0, len = resStream.read(byteBuf);
result = (TextView) findViewById(R.id.txtResult); while (len > -1) {
Thread slowJob = new Thread() {
@Override }
resLen += len; resultValue += new String(byteBuf); len = resStream.read(byteBuf);
“ </GetData>\n” +
public void run() { }
String resultValue = “”; HttpURLConnection con = null; } “ </s:Body>\n” +
try { catch (Exception ex){ resultValue = “\nERROR: ” + ex.getMessage(); }
String reqXML = “…”; note
“</s:Envelope>”;
// send message to handler so it updates GUI
// Creating the HttpURLConnection object Message msg = handler.obtainMessage(); msg.obj = (String) resultValue; handler.sendMessage(msg);
URL oURL = new URL(“http://192.168.1.9/WcfService/Service1.svc”); if(con != null) con.disconnect();
con = (HttpURLConnection) oURL.openConnection(); }
};
slowJob.start();
}
}

REPRESENTATIONAL STATE TRANSFER


REPRESENTATIONAL STATE TRANSFER (REST) (Example 2: Java HttpUrlConnection web-client)
In this second example an Android client uses REST protocol to interact with a WAMP Server. 1. Create webservice application project
WebServices are implemented as a set of PHP programs. We use JSON encoding for the client- ◦ Install Wamp server
server data exchange. ◦ Start Webserver (Maybe there is some errors when starting PHP engines)
◦ Open location: C:\wamp64\www and create a folder called myRestService (any names you want)
◦ Go into that folder, and create 2 files: rest_services.php and restful_api.php
Android REQUEST string (Post/Get)
WAMP ◦ restful_api.php: code to handle REST request/response
http://www.abc.com?key1=value1&key2=value2
Client ◦ rest_services.php: code of api you want to provide (ex: add2Integer function)
+
JSON

RESPONSE formatted as:


JSON API JSON {……} PHP MySql
XML <tag>…..</tag>
HTML<html>….</html>
CSV “aaa”,111,,333
Plain-Text …
REPRESENTATIONAL STATE TRANSFER REPRESENTATIONAL STATE TRANSFER
(Example 2: Java HttpUrlConnection web-client) (Example 2: Java HttpUrlConnection web-client)
1. Create webservice application project (restful_api.php) 1. Create webservice application project (rest_services.php)
<?php // Thực hiện xử lý request <?php
class restful_api { private function _process_api(){ require ‘restful_api.php’;
protected $method = ‘’; if (method_exists($this, $this->endpoint)) $this->{$this->endpoint}(); class rest_services extends restful_api {
// Name of function called else $this->response(500, “Unknown endpoint”); function __construct(){ parent::__construct();}
protected $endpoint = ‘’; } function Add2Integer(){
// parameters, ex: /<endpoint>/<param1>/<param2> protected function response($status_code, $data = NULL){ if ($this->method == ‘GET’){
protected $params = array(); header($this->_build_http_header_string($status_code)); $data = intval($this->params[0]) + intval($this->params[1]);
// file stored by PUT header(“Content-Type: application/json”); $this->response(200, $data);
protected $file = null; echo json_encode($data); }
public function __construct(){ $this->_input(); $this->_process_api(); } } elseif ($this->method == ‘POST’){ // body: a=1&b=2
private function _input(){ private function _build_http_header_string($status_code){ $data = intval($this->params[‘a’]) + intval($this->params[‘b’]);
header(“Access-Control-Allow-Orgin: *”); header(“Access-Control-Allow-Methods: *”); $status = array(200 => ‘OK’, 404 => ‘Not Found’, 405 => ‘Method Not Allowed’, 500 => ‘Internal Server Error’); $this->response(200, $data);
$this->params = explode(‘/’, trim($_SERVER[‘PATH_INFO’], ‘/’)); return “HTTP/1.1 ” . $status_code . “ ” . $status[$status_code]; }
$this->endpoint = array_shift($this->params); } elseif ($this->method == ‘PUT’){ //body: a=1&b=2
$method = $_SERVER[‘REQUEST_METHOD’]; } $p = explode(“&”, $this->file);
$allow_method = array(‘GET’, ‘POST’, ‘PUT’, ‘DELETE’); ?> $str = explode(“=”, $p[0])[1] . “ + ” . explode(“=”, $p[1])[1] . “ = ” . (intval(explode(“=”, $p[0])[1]) + intval(explode(“=”, $p[1])[1])); // 1 + 2 = 3
if (in_array($method, $allow_method))$this->method = $method; $data = “successfully updated”;
switch ($this->method) { file_put_contents(“smile.txt”, $str);
case ‘POST’: $this->params = $_POST; break; $this->response(200, $data);
case ‘GET’: // Không cần nhận, bởi params đã được lấy từ url }
break; elseif ($this->method == ‘DELETE’){ // code to delete data
case ‘PUT’: $this->file = file_get_contents(“php://input”); break; // return data by calling: $this->response(200, $data)
case ‘DELETE’: // Không cần nhận, bởi params đã được lấy từ url }
break; }
default: $this->response(500, “Invalid Method”); break; }
}} $user_rest_services = new rest_services(); ?>

REPRESENTATIONAL STATE TRANSFER


(Example 2: Java HttpUrlConnection web-client)
2. Create Android application (MainActivity.java)
public class MainActivity extends Activity { con.setDoInput(true);
TextView result; con.setDoOutput(true);
Handler handler = new Handler() { BufferedWriter writer = new BufferedWriter(
@Override new OutputStreamWriter(con.getOutputStream(), “UTF-8”));
public void handleMessage(Message msg) { writer.write(query);
super.handleMessage(msg); writer.flush();
result.setText((String) msg.obj); if(con.getResponseCode() == HttpURLConnection.HTTP_OK) {
} byte[] byteBuf = new byte[1024];
}; InputStream resStream = con.getInputStream();
@Override int resLen = 0, len = resStream.read(byteBuf);
protected void onCreate(Bundle savedInstanceState) { while (len > -1) {
super.onCreate(savedInstanceState); resLen += len; resultValue += new String(byteBuf); len = resStream.read(byteBuf);
setContentView(R.layout.activity_main); }
result = (TextView) findViewById(R.id.txtResult); }
Thread slowJob = new Thread() { }
@Override catch (Exception ex){ resultValue = “\nERROR: ” + ex.getMessage(); }
public void run() { // send message to handler so it updates GUI
String resultValue = “”; HttpURLConnection con = null; Message msg = handler.obtainMessage(); msg.obj = (String) resultValue;
try { handler.sendMessage(msg);
Uri.Builder builder = new Uri.Builder().appendQueryParameter(“a”, “1”).appendQueryParameter(“b”, “2”); if(con != null) con.disconnect();
String query = builder.build().getEncodedQuery(); }
URL oURL = new URL(“http://192.168.1.9/myRestService/rest_services.php/Add2Integer”); };
con = (HttpURLConnection) oURL.openConnection(); slowJob.start();
con.setRequestMethod(“PUT”); //con.setRequestMethod(“POST”); }
}

You might also like