0
Service Enabler




Accessing Web Sites
  as Web Services
   Andreas Hubmer, 0525780
   Computational Intelligence
 Vienna...
Definition: Web Services

    “A software system designed to support


    interoperable machine-to-machine interaction
 ...
Motivation

    Web services provide interoperable machine-


    to-machine interaction over a network
    Many legacy w...
Example: Currency Converter




                              4/17
Example: Currency Converter




                              5/17
Basics

Service Enabler ...
    behaves like a web browser



    simulates a user and his actions



    retrieves valu...
Definitions

    Action: a task like typing, clicking or reading text



    Method: a sequence of actions



    Servic...
Actions

    PutText: enters text into input field or textarea



    Select: dropdown lists, check boxes and radio


  ...
Actions (2)

    Actions operate on the DOM of an HTML page



    XPath is used to determine HTML elements



        /...
XML Configuration

<service name=quot;CurrencyConverterquot;>
 <login startUrl=quot;http://...waehrungsrechnerquot; validT...
WSDL mapping

    Service → WSDL service



    Method → SOAP operation



    Action with variable argument → operation...
Further Features

    Can handle incorrect HTML



    Session management: cached login method



    Caching of method ...
Live Demo




            13/17
Architecture

                                                                  Legacy web
 ehCache
                      ...
Used Tools

    Apache Axis2



    ehCache



    HtmlUnit



        List<?> nodes = page.getByXPath(xpath);
    


...
Outlook

    Tool to create configurations



    Integration into servlet container



    Type checking



    Templa...
Service Enabler




                     Thank you!

                   Any questions?




Andreas Hubmer                 ...
Upcoming SlideShare
Loading in...5
×

JSUG - Java Service Enabler by Andreas Hubmer

610

Published on

visit www.jsug.at for more stuff

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
610
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "JSUG - Java Service Enabler by Andreas Hubmer"

  1. 1. Service Enabler Accessing Web Sites as Web Services Andreas Hubmer, 0525780 Computational Intelligence Vienna University of Technolgy
  2. 2. Definition: Web Services “A software system designed to support  interoperable machine-to-machine interaction over a network.” Successor of network technologies like CORBA  XML  SOAP  WSDL 
  3. 3. Motivation Web services provide interoperable machine-  to-machine interaction over a network Many legacy web applications are only exposed  as html pages and not easily usable by computer programs Service Enabler connects these two worlds  and provides an infrastructure to access legacy web applications as web services 3/17
  4. 4. Example: Currency Converter 4/17
  5. 5. Example: Currency Converter 5/17
  6. 6. Basics Service Enabler ... behaves like a web browser  simulates a user and his actions  retrieves values of web pages  exposes functionality as web service (SOAP)  needs description of the web applications  6/17
  7. 7. Definitions Action: a task like typing, clicking or reading text  Method: a sequence of actions  Service: groups methods of one web site  Login: Starting point of all methods of a service  7/17
  8. 8. Actions PutText: enters text into input field or textarea  Select: dropdown lists, check boxes and radio  buttons Click: simulates a click on a clickable element  GetValue: retrieves a single value  GetTable: retrieves multiple records of values  Repeat: repeats a list of actions  Verify: allows to verify the content of an HTML  element 8/17
  9. 9. Actions (2) Actions operate on the DOM of an HTML page  XPath is used to determine HTML elements  /html/body/center/form/table/tbody/tr[1]/td[2]/input[2]  //input[@name=quot;amountquot;]  Constant and variable values possible  9/17
  10. 10. XML Configuration <service name=quot;CurrencyConverterquot;> <login startUrl=quot;http://...waehrungsrechnerquot; validTime=quot;604800quot;> </login> <method name=quot;convertquot;>     <actions>       <puttext>         <xpath>//input[@name=quot;amtquot;]</xpath>         <argname>amount</argname>       </puttext>       <select>         <xpath>//select[@name=quot;fromquot;]</xpath>         <argname>from</argname>       </select> .............     <actions>   </method> </service> 10/17
  11. 11. WSDL mapping Service → WSDL service  Method → SOAP operation  Action with variable argument → operation  parameter GetValue, GetTable → Part of result message  11/17
  12. 12. Further Features Can handle incorrect HTML  Session management: cached login method  Caching of method results  JavaScript is supported  12/17
  13. 13. Live Demo 13/17
  14. 14. Architecture Legacy web ehCache applications (Mem, Disk) request web pages retrieve information Actions HtmlUnit Methods XML Services configuration define call define Axis2 Web Services Client applications call WSDL SOAP Web Server 14/17
  15. 15. Used Tools Apache Axis2  ehCache  HtmlUnit  List<?> nodes = page.getByXPath(xpath);  nodes.get(0).click();  XStream: XML (De-)Serialization  InputStream in = new BufferedInputStream(new FileInputStream(xmlFile));  Object o = xstream.fromXML(in);  15/17
  16. 16. Outlook Tool to create configurations  Integration into servlet container  Type checking  Template engine, scripting support  16/17
  17. 17. Service Enabler Thank you! Any questions? Andreas Hubmer 17/17
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×