14
Asynchronous Web Services Approach Enrique de Andrés Saiz

Asynchronous Web Services Approach Enrique de Andrés Saiz

Embed Size (px)

Citation preview

Page 1: Asynchronous Web Services Approach Enrique de Andrés Saiz

Asynchronous Web Services Approach

Enrique de Andrés Saiz

Page 2: Asynchronous Web Services Approach Enrique de Andrés Saiz

Motivation

Web Services have a inherent synchronous operation mode.

Synchronous operations are done in one step.

Synchronous behavior limits the maximum execution time of the tasks achieved by Web Services.

Many services exceeds the limitations imposed by the synchronous behavior.

Page 3: Asynchronous Web Services Approach Enrique de Andrés Saiz

Asynchronous behavior (i)

Asynchronous operations are done in two basic steps: Client requests a service. Client obtains the results.

Two approaches to do it: Polling Notification

Page 4: Asynchronous Web Services Approach Enrique de Andrés Saiz

Asynchronous behavior (ii)Polling

Client Provider

Request for service Accepted

request

Request for results Results not

available

Request for results

Results

(repeat periodically)

Page 5: Asynchronous Web Services Approach Enrique de Andrés Saiz

Asynchronous behavior (iii) Notification

Client Provider

Request for service Accepted

request

Results available

Provider starts the communicationClient waits until

results are available

Page 6: Asynchronous Web Services Approach Enrique de Andrés Saiz

Polling (i)

Tasks to achieve by asynchronous Web Services: Service request Polling Obtaining results

It’s necessary to associate a service request with subsequent polling and obtaining results messages. Unique identifiers generated by service providers EGEE job identifiers in case of launching jobs to the grid.

Page 7: Asynchronous Web Services Approach Enrique de Andrés Saiz

OBTAIN RESULTS

Polling (ii)

POLLING

SERVICE REQUEST

Client Provider

Request for service Accepted

request

Request for results Results not

available

Request for results

Results

(repeat periodically)

Task ID

Task ID

Task ID

Page 8: Asynchronous Web Services Approach Enrique de Andrés Saiz

Implementation (i)

Split the main method of the Web Service into three methods:

Submit: Input: parameters of the web service Output: unique identifier

Polling: Input: identifier provided during submission Output: status

Fetch: Input: identifier provided during submission Output: results

Page 9: Asynchronous Web Services Approach Enrique de Andrés Saiz

Implementation (ii)

Synchronous

Web ServiceInput Output

Asynchronous

Web Service

(submit method)

Asynchronous

Web Service

(fetching method)Input

Task ID

Output

Asynchronous

Web Service

(polling method)

Page 10: Asynchronous Web Services Approach Enrique de Andrés Saiz

Implementation (iii)

Another approach… split the main method of the Web Service into two methods:

Submit: Input: parameters of the web service Output: unique identifier

Fetch: Input: identifier provided during submission Output:

If execution has not finished yet, method fails If execution has already finished, method returns output results

Page 11: Asynchronous Web Services Approach Enrique de Andrés Saiz

Implementation (iv)

Asynchronous

Web Service

(submit method)

Asynchronous

Web Service

(fetching method)

Input

Task ID

Output

Synchronous

Web ServiceInput Output

Page 12: Asynchronous Web Services Approach Enrique de Andrés Saiz

Another topics involved in EGEE Web Services (i) Web Services which launch jobs to the EGEE Grid

through a LCG-2 User Interface.

Authentication:

If web service uses a static UI, it’s necessary to add the UI user name and the password as input parameters.

If there are no default UI, UI must also be an input parameter. Additionally, and if we want to avoid enter manually in the UI the

certificate password, it’s necessary it as input parameter.

Page 13: Asynchronous Web Services Approach Enrique de Andrés Saiz

Another topics involved in EGEE Web Services (ii)

Asynchronous

Web Service

(submit method)

Asynchronous

Web Service

(fetching method)

Input

Task ID

Output

UI

User name

Password

Cert. Pass.

Page 14: Asynchronous Web Services Approach Enrique de Andrés Saiz

Another topics involved in EGEE Web Services (iii)

Security:

Need to preserve the confidentiality of the data exchanged (passwords)

Hosting Web Services on secure web servers