converting web forms into php- based web services with

22
Converting Web Forms into PHP- based Web Services with form2webservice generator The Tool formerly known as FaSTer Tobias Vogel

Upload: others

Post on 03-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Converting Web Forms into PHP-based Web Serviceswith form2webservice generator

The Tool formerly known as FaSTer

Tobias Vogel

Good for Humans, bad for Computers

■ Web pages are intended for human use

□ Human-oriented interfaces

■ Computer programs cannot access them (unless they have APIs)

■ Much valuable functionality hidden

□ TinyURL, yellow pages, your application :-)

API

17

Create!

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Wrapper

Encapsulation

HTTP

ClientSOAP

J-RMI

CORBA

Generator

Web application

Log human

interaction

1 Monitor human interaction

2 Save each step/form

3 Consolidate input parameters

4 Analyze output schema

5 Generate Web Service

6 (Deploy Web Service)

19

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Home-brewn API

Analysis and Generation Workflow

1 Monitor human interaction

2 Save each step/form

3 Consolidate input parameters

4 Analyze output schema

5 Generate Web Service

6 (Deploy Web Service)

20

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Demo

Demo

Demo

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

21

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

22

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

23

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

24

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

25

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

26

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

27

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

28

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

29

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Page B

Fname

Email

Model

John Doe

XYZ

Web Applications Have HTML GUIs

■ Web applications :=

applications with

an HTML GUI

□ Internal variables

□ Partly visible as

Form Elements

■ Mapping required

Page A

Name

Age

Model …

Name

Age

Model

Model XYZ

Email

Fname John Doe

…Name, Fname

Email

Model

Age

Integrated Schema

(Model)

30

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Analysis and Generation Workflow

1 Monitor human interaction

2 Save each step/form

3 Consolidate input parameters

4 Analyze output schema

5 Generate Web Service

6 (Deploy Web Service)

31

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Demo

Demo

Demo

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

32

FASTER | Tobias Vogel | 05.01.2010

33

Output

■ XPath to specify parts

■ Response types

□ simple: return direct XPath result

□ list: <ol>, <ul>

□ table: create row objects using column descriptions

Job Command Runtime

backup disk backup.bat 30 s

find temp files find /tmp | wc -l

90 s

turn off shutdown -s 45 s

result1 {

job: "backup disk",

command: "backup.bat",

runtime: "30 s"

},

result2 {

job: "find temp files",

Analysis and Generation Workflow

1 Monitor human interaction

2 Save each step/form

3 Consolidate input parameters

4 Analyze output schema

5 Generate Web Service

6 (Deploy Web Service)

34

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Demo

Demo

Demo

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

35

PHP Classes to Web Services

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

36

Generator

PHP class

InstantSVC(auto-

generator)

InstantSVCSOAP Server

Web Service

WSDL

http://instantsvc.svn.sourceforge.net/viewvc/instantsvc/

branches/form2ws-converter/

Summary

1 Monitor human interaction

2 Save each step/form

3 Consolidate input parameters

4 Analyze output schema

5 Generate Web Service

6 (Deploy Web Service)

37

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

Demo

Demo

Encapsulating Multi-Stepped Web Forms

Tobias Vogel, Frank Kaufer, and Felix Naumann, WESOA09 at ICSOC 2009,

Stockholm

Posr: A Comprehensive System for Aggregating and Using Web Services

Mohammed AbuJarour, Mircea Craculeac, Falko Menge, Tobias Vogel, and Jan-

Felix Schwarz. IEEE Services Cup at SERVICES 2009, Los Angeles, USA.

The End

Form2WebService-Generator | BePHPUG | Tobias Vogel | 05.01.2010

38