SlideShare a Scribd company logo
1 of 17
Download to read offline
Service Enabler




Accessing Web Sites
  as Web Services
   Andreas Hubmer, 0525780
   Computational Intelligence
 Vienna University of Technolgy
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

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
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 values of web pages



    exposes functionality as web service (SOAP)





    needs description of the web applications





                                                  6/17
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
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
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
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
WSDL mapping

    Service → WSDL service



    Method → SOAP operation



    Action with variable argument → operation


    parameter
    GetValue, GetTable → Part of result message





                                                11/17
Further Features

    Can handle incorrect HTML



    Session management: cached login method



    Caching of method results



    JavaScript is supported





                                              12/17
Live Demo




            13/17
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
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
Outlook

    Tool to create configurations



    Integration into servlet container



    Type checking



    Template engine, scripting support





                                         16/17
Service Enabler




                     Thank you!

                   Any questions?




Andreas Hubmer                      17/17

More Related Content

What's hot (8)

Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
Ajax
AjaxAjax
Ajax
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
 
Riding Apache Camel
Riding Apache CamelRiding Apache Camel
Riding Apache Camel
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorial
 

Similar to JSUG - Java Service Enabler by Andreas Hubmer

Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshop
James Pearce
 
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
Carles Farré
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
Chamnap Chhorn
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
dominion
 
JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.js
Ben Combee
 

Similar to JSUG - Java Service Enabler by Andreas Hubmer (20)

Bd conf sencha touch workshop
Bd conf sencha touch workshopBd conf sencha touch workshop
Bd conf sencha touch workshop
 
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
[DSBW Spring 2009] Unit 02: Web Technologies (2/2)
 
Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
PPT
PPTPPT
PPT
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
 
Atlas Php
Atlas PhpAtlas Php
Atlas Php
 
cross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecturecross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecture
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Ajax
AjaxAjax
Ajax
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Integrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePointIntegrating ASP.NET AJAX with SharePoint
Integrating ASP.NET AJAX with SharePoint
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 
JavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.jsJavaScript on HP webOS: Enyo and Node.js
JavaScript on HP webOS: Enyo and Node.js
 
C# Unit5 Notes
C# Unit5 NotesC# Unit5 Notes
C# Unit5 Notes
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Ajax
AjaxAjax
Ajax
 

More from Christoph Pickl

More from Christoph Pickl (20)

JSUG - AS3 vs Java by Christoph Pickl
JSUG - AS3 vs Java by Christoph PicklJSUG - AS3 vs Java by Christoph Pickl
JSUG - AS3 vs Java by Christoph Pickl
 
JSUG - Layouting TeX documents with the Memoir class
JSUG - Layouting TeX documents with the Memoir classJSUG - Layouting TeX documents with the Memoir class
JSUG - Layouting TeX documents with the Memoir class
 
JSUG - Cocoon3 Student Project Idea by Reinhard Poetz and Steven Dolg
JSUG - Cocoon3 Student Project Idea by Reinhard Poetz and Steven DolgJSUG - Cocoon3 Student Project Idea by Reinhard Poetz and Steven Dolg
JSUG - Cocoon3 Student Project Idea by Reinhard Poetz and Steven Dolg
 
JSUG - ActionScript 3 vs Java by Christoph Pickl
JSUG - ActionScript 3 vs Java by Christoph PicklJSUG - ActionScript 3 vs Java by Christoph Pickl
JSUG - ActionScript 3 vs Java by Christoph Pickl
 
JSUG - TeX, LaTeX und der Rest by Norbert Preining
JSUG - TeX, LaTeX und der Rest by Norbert PreiningJSUG - TeX, LaTeX und der Rest by Norbert Preining
JSUG - TeX, LaTeX und der Rest by Norbert Preining
 
JSUG - TeX Day by Christoph Pickl
JSUG - TeX Day by Christoph PicklJSUG - TeX Day by Christoph Pickl
JSUG - TeX Day by Christoph Pickl
 
JSUG - The Sound of Shopping by Christoph Pickl
JSUG - The Sound of Shopping by Christoph PicklJSUG - The Sound of Shopping by Christoph Pickl
JSUG - The Sound of Shopping by Christoph Pickl
 
JSUG - Tim aka EPROG2 by Martin Schuerrer
JSUG - Tim aka EPROG2 by Martin SchuerrerJSUG - Tim aka EPROG2 by Martin Schuerrer
JSUG - Tim aka EPROG2 by Martin Schuerrer
 
JSUG - Hoppla by Florian Motlik and Petar Petrov
JSUG - Hoppla by Florian Motlik and Petar PetrovJSUG - Hoppla by Florian Motlik and Petar Petrov
JSUG - Hoppla by Florian Motlik and Petar Petrov
 
JSUG - Google Web Toolkit by Hans Sowa
JSUG - Google Web Toolkit by Hans SowaJSUG - Google Web Toolkit by Hans Sowa
JSUG - Google Web Toolkit by Hans Sowa
 
JSUG - TU Wien Cocoon Project by Andreas Pieber
JSUG - TU Wien Cocoon Project by Andreas PieberJSUG - TU Wien Cocoon Project by Andreas Pieber
JSUG - TU Wien Cocoon Project by Andreas Pieber
 
JSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas LangJSUG - TU Wien Castor Project by Lukas Lang
JSUG - TU Wien Castor Project by Lukas Lang
 
JSUG - LaTeX Introduction by Christoph Pickl
JSUG - LaTeX Introduction by Christoph PicklJSUG - LaTeX Introduction by Christoph Pickl
JSUG - LaTeX Introduction by Christoph Pickl
 
JSUG - OSGi by Michael Greifeneder
JSUG - OSGi by Michael GreifenederJSUG - OSGi by Michael Greifeneder
JSUG - OSGi by Michael Greifeneder
 
JSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph PicklJSUG - Filthy Flex by Christoph Pickl
JSUG - Filthy Flex by Christoph Pickl
 
JSUG - Seam by Florian Motlik
JSUG - Seam by Florian MotlikJSUG - Seam by Florian Motlik
JSUG - Seam by Florian Motlik
 
JSUG - Google Guice by Jan Zarnikov
JSUG - Google Guice by Jan ZarnikovJSUG - Google Guice by Jan Zarnikov
JSUG - Google Guice by Jan Zarnikov
 
JSUG - Java FX by Christoph Pickl
JSUG - Java FX by Christoph PicklJSUG - Java FX by Christoph Pickl
JSUG - Java FX by Christoph Pickl
 
JSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph PicklJSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph Pickl
 
JSUG - Inversion Of Control by Florian Motlik
JSUG - Inversion Of Control by Florian MotlikJSUG - Inversion Of Control by Florian Motlik
JSUG - Inversion Of Control by Florian Motlik
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

JSUG - Java Service Enabler by Andreas Hubmer

  • 1. Service Enabler Accessing Web Sites as Web Services Andreas Hubmer, 0525780 Computational Intelligence Vienna University of Technolgy
  • 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. 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
  • 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. 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. 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. 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. 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. WSDL mapping Service → WSDL service  Method → SOAP operation  Action with variable argument → operation  parameter GetValue, GetTable → Part of result message  11/17
  • 12. Further Features Can handle incorrect HTML  Session management: cached login method  Caching of method results  JavaScript is supported  12/17
  • 13. Live Demo 13/17
  • 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. 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. Outlook Tool to create configurations  Integration into servlet container  Type checking  Template engine, scripting support  16/17
  • 17. Service Enabler Thank you! Any questions? Andreas Hubmer 17/17