SlideShare a Scribd company logo
(ATS4-DEV04) Protocols as RESTful
 Services and RESTful URL Routing
                                   Jon Hurley
                Senior Manager, Platform R&D
                     Jon.Hurley@accelrys.com
The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.
Summary

•   Configuring Protocols as Service Endpoints
•   REST
•   Protocols as RESTful services
•   Long Running Jobs
Pipeline Pilot Integration Points
                                                                                                     Client Integration
                                                                                                     Build clients that connect to Pipeline Pilot
                                                                                                     and run protocol services.
                                                       Web Browser
                          Run Protocol                                                      .NET Client               Java Client
  Professional                                                       JavaScript Client
                         Command Line         Web Port                                                                                SOAP Client    HTTP Client
     Client
                             Client
                                                                                            .NET Client
                                                      JavaScript Client SDK                                         Java Client SDK
                                                                                               SDK
                                                      Pipeline Pilot Enterprise Server

                 Web Apps                     Web Services API                           Admin Portal                                  Help Portal
                                                            Protocol Runtime Environment

  VB Script        VB Script
                                   Run                                                                SOAP &              Telnet /                   ODBC /
    (On               (On                   Java            Perl           Python        .NET                                         SSH / SCP
                                 Program                                                               HTTP                 FTP                       JDBC
   Client)          Server)


                                   Java      Perl           .NET
  VB Script        Cmd Line
                                  Classes   Scripts        Classes



Server Integration                                                                                         REST             SOAP
                                                                                                                                       Cmd Line
Extend pipelines with new                                                                                 Service          Service                     DBs

components that integrate
your code, data and services.
Web Services API & Client SDKs

                                  Client   Server

  .NET Applications      .NET SDK                            Pipeline Pilot
                                                                Server
  Java Servlets, JSP
  Java Applications      Java SDK

  Web Applications     JavaScript SDK
                                                                 XML
  Perl SOAP::Lite &
                                                     SOAP      Protocol
                                                     APIs      Database
   other SOAP libs
   Browsers, Http                                   Http
      Clients
                                            Authentication
                                            Layer



      Allows cross-platform access to Pipeline Pilot services
Protocols as Web Services

• Mapping protocols to Web Services
   – “Visual” Services
   – Parameter Style
   – Document Style
RESTful Services

• Representational State Transfer
• Typically pass documents (eg XML, JSON) between client
  & server that represent state of a resource
• Uses existing verbs rather than creating arbitrary function
  names – GET, PUT, POST, DELETE
• Resources identified by URI, so URI mapping required to
  underlying functions
RESTful URIs

RESTful URIS refer to resources
Two types of URIs
Collection - http://example.com/compounds/
Element - http://example.com/compounds/acc123456
5 Common Methods
   Method      Purpose
   GET         For retrieving a data resource or a resource collection
   POST        For creating a new resource
   PUT         For replacing a resource
   PATCH       For updating resource content
   DELETE      For removing a resource
Zoo Examples

• Collection of animals
  • Stored in a cache loaded from ‘data/Tables/zoo.txt’
  • List, edit, delete animal records
  • Set of protocols that are exposed as RESTful services
• Demonstrated using the Chrome Browser ‘Advanced Rest
  Client’
Demo
 • Accessing a protocol service from REST
   browser plugin
List Service

  http://{server}/zoology/animals/

  [
  {"id":1,"animalname":"aardvark"},
  {"id":2,"animalname":"antelope"},
  {"id":3,"animalname":"bass"},
  {"id":4,"animalname":"bear"},
  …
Individual Animal Service

  http://{server}/zoology/animals/1

  [
  {"id":"1","animalname":"aardvark","type
  ":"mammal","milk":"1","legs":"4","tail"
  :"0","eggs":"0","feathers":"0"}
  ]
List the ‘B’ Animals

  http://{server}/zoology/banimals/

  [
  {"id":3,"animalname":"bass"},
  {"id":4,"animalname":"bear"},
  {"id":5,"animalname":"boar"},
  {"id":6,"animalname":"buffalo"}
  ]
List the Animals with an XML format
  http://{server}/zoology/canimals/xml

  <?xml version="1.0" encoding="UTF-8"?>
  <animals>
    <animal id="7" animalname="calf" />
    <animal id="8" animalname="carp" />
    <animal id="9" animalname="catfish" />
    <animal id="10" animalname="cavy" />
  </animals>
Defining URL Routes

• URL Route definitions are provided in package files
   • In your package define the routes in a urls.conf file
   • Include a reference to this file in package.conf:

     …
     # URL routing configuration
     Include $(package)/urls.conf
Defining URL Routes
<url REST AUTH>
   method GET
   request /zoology/animals/
   protocol Protocols/Web Services/AcclDev/zoo/Actions/animal/List
   summary       List all animals in the zoo.

   <url>
       request /zoology/banimals/
       param NameFilter B
       querystring Off
       summary     List all animals whose name starts with the letter B.
   </url>
</url>
Reviewing RESTful service protocols
List Protocol
Some Edit URLs
• Add new animals
   • POST: {root}/zoology/animals/
   • Header: Content-type: application/json
   • By default the body is stored in the first parameter on the
     protocol (override with _bodyParam in URL route)
• Edit an existing animal
   • PUT: http://meteorbs:9944/zoology/animals/
      • With full data record
   • PATCH: http://meteorbs:9944/zoology/animals/
      • With partial data record
Specifying the return format

• Services can use these methods to control the return
  format
   • Accept Header
      •       Accept: application/json
  • Format Query String argument
     •    http://{server}/zoology/formanimals/1
     •    OR
     •    http://{server}/zoology/formanimals/1?format=xml
          •     Overrides the format from the Accept header
A Long Running Job
If the action may take more than a few seconds to run then make it a long running
    job so it can be polled from the client.
In package.conf
…
<url>
  method GET
  request /myapp/slowjob
  protocol Protocols/Examples/My Protocol
  param _blocking 0
</url>
…
Running Job RESTful URLs

Method   URL path               Description
GET      /jobs/                 List of the current user’s jobs
GET      /jobs/job-id           Details for the specified job
GET      /jobs/job-id/status    Status code for the job (e.g. running)
GET      /jobs/job-id/files     List of links to job directory files
GET      /jobs/job-id/results   Results of the job
DELETE   /jobs/job-id           Release the job (terminate if still running)
DELETE   /jobs/job-id/stop      Stop the current job
Accessing RESTful services from Protocols

• Use JSON Reader (or XML Reader) or HTTP Connector
   • E.g. $(ServerRoot)/zoology/animals/
Summary

• Package developers can configure RESTful endpoints for
  protocols
• Next Steps
   – Get the demo package with which to experiment
      • testpkg-svc1
   – aep_restful_web_services.pdf

More Related Content

PPTX
(ATS3-PLAT01) Recent developments in Pipeline Pilot
PPTX
(ATS3-DEV05) Coding up Pipeline Pilot Components
PDF
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
PPTX
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
PDF
(ATS4-DEV05) Pipeline Pilot 9.0 Advanced Protocol Development Topics
PDF
Plongée en eaux profondes dans l'architecture du nouvel Exchange 2013
PDF
Architecture and tools
PPTX
Exchange Server 2013 Architecture Deep Dive, Part 2
(ATS3-PLAT01) Recent developments in Pipeline Pilot
(ATS3-DEV05) Coding up Pipeline Pilot Components
(ATS4-DEV10) Creating Pipeline Pilot Components by Wrapping Third-Party Tools
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
(ATS4-DEV05) Pipeline Pilot 9.0 Advanced Protocol Development Topics
Plongée en eaux profondes dans l'architecture du nouvel Exchange 2013
Architecture and tools
Exchange Server 2013 Architecture Deep Dive, Part 2

What's hot (20)

PDF
SAP NetWeaver Gateway - RFC & BOR Generators
PDF
HTML5 Refresher
PDF
BlazeDS
PDF
Lecture 7 Web Services JAX-WS & JAX-RS
PPTX
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
PPTX
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
PPTX
OpenDaylight and YANG
PPTX
Copper: A high performance workflow engine
PDF
Blaze Ds Slides
PDF
JAX-RS 2.0: RESTful Web Services
PDF
Confoo2013 make your java-app rest enabled
PPT
Was 5.1 To 6.1 Updated
PPT
Servlet
PDF
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
PPT
Tech_Implementation of Complex ITIM Workflows
PDF
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
PDF
NetWeaver Gateway- Service Builder
PDF
Building Asynchronous Services With Sca
PPTX
Where and when to use the Oracle Service Bus (OSB)
PDF
Developing Voice Applications in the Cloud
SAP NetWeaver Gateway - RFC & BOR Generators
HTML5 Refresher
BlazeDS
Lecture 7 Web Services JAX-WS & JAX-RS
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
OpenDaylight and YANG
Copper: A high performance workflow engine
Blaze Ds Slides
JAX-RS 2.0: RESTful Web Services
Confoo2013 make your java-app rest enabled
Was 5.1 To 6.1 Updated
Servlet
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Tech_Implementation of Complex ITIM Workflows
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
NetWeaver Gateway- Service Builder
Building Asynchronous Services With Sca
Where and when to use the Oracle Service Bus (OSB)
Developing Voice Applications in the Cloud
Ad

Similar to (ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing (20)

PPTX
(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
PPTX
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
PDF
Writing & Using Web Services
PDF
Making Things Work Together
PDF
Oop2008 RESTful services with GWT and Apache CXF
PPTX
WebClient Overview and 1.8 Roadmap
PDF
GlassFish v3 Prelude Aquarium Paris
PDF
Make easier Integration of your services with Fuse Solutions - RedHat 2013
PDF
Domino OSGi Development
PDF
Google App Engine At A Glance
PPTX
CM WebClient for CA Plex
PDF
Restful Web Services
PDF
Does REST Change the Game for IAM?
PDF
On being RESTful
PPTX
Open in the Cloud Java &amp; Windows Azure
PDF
appengine ja night #24 Google Cloud Endpoints and BigQuery (English)
PDF
Sail Fin Webinar Overview
PDF
Project Zero Php Quebec
PDF
Developer’s intro to the alfresco platform
PDF
New Ways To Engage With Tiempo 2011
(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
Writing & Using Web Services
Making Things Work Together
Oop2008 RESTful services with GWT and Apache CXF
WebClient Overview and 1.8 Roadmap
GlassFish v3 Prelude Aquarium Paris
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Domino OSGi Development
Google App Engine At A Glance
CM WebClient for CA Plex
Restful Web Services
Does REST Change the Game for IAM?
On being RESTful
Open in the Cloud Java &amp; Windows Azure
appengine ja night #24 Google Cloud Endpoints and BigQuery (English)
Sail Fin Webinar Overview
Project Zero Php Quebec
Developer’s intro to the alfresco platform
New Ways To Engage With Tiempo 2011
Ad

More from BIOVIA (20)

PPTX
ScienceCloud: Collaborative Workflows in Biologics R&D
PDF
(ATS6-PLAT03) What's behind Discngine collections
PDF
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
PDF
(ATS6-PLAT07) Managing AEP in an enterprise environment
PDF
(ATS6-PLAT06) Maximizing AEP Performance
PDF
(ATS6-PLAT05) Security enhancements in AEP 9
PDF
(ATS6-PLAT04) Query service
PDF
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
PDF
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
PDF
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
PDF
(ATS6-GS02) Integrating Contur and HEOS
PDF
(ATS6-GS01) Welcome
PDF
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
PDF
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
PDF
(ATS6-DEV07) Building widgets for ELN home page
PDF
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
PDF
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
PDF
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
PDF
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
PDF
(ATS6-DEV02) Web Application Strategies
ScienceCloud: Collaborative Workflows in Biologics R&D
(ATS6-PLAT03) What's behind Discngine collections
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT07) Managing AEP in an enterprise environment
(ATS6-PLAT06) Maximizing AEP Performance
(ATS6-PLAT05) Security enhancements in AEP 9
(ATS6-PLAT04) Query service
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS01) Welcome
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
(ATS6-DEV07) Building widgets for ELN home page
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV02) Web Application Strategies

(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing

  • 1. (ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing Jon Hurley Senior Manager, Platform R&D [email protected]
  • 2. The information on the roadmap and future software development efforts are intended to outline general product direction and should not be relied on in making a purchasing decision.
  • 3. Summary • Configuring Protocols as Service Endpoints • REST • Protocols as RESTful services • Long Running Jobs
  • 4. Pipeline Pilot Integration Points Client Integration Build clients that connect to Pipeline Pilot and run protocol services. Web Browser Run Protocol .NET Client Java Client Professional JavaScript Client Command Line Web Port SOAP Client HTTP Client Client Client .NET Client JavaScript Client SDK Java Client SDK SDK Pipeline Pilot Enterprise Server Web Apps Web Services API Admin Portal Help Portal Protocol Runtime Environment VB Script VB Script Run SOAP & Telnet / ODBC / (On (On Java Perl Python .NET SSH / SCP Program HTTP FTP JDBC Client) Server) Java Perl .NET VB Script Cmd Line Classes Scripts Classes Server Integration REST SOAP Cmd Line Extend pipelines with new Service Service DBs components that integrate your code, data and services.
  • 5. Web Services API & Client SDKs Client Server .NET Applications .NET SDK Pipeline Pilot Server Java Servlets, JSP Java Applications Java SDK Web Applications JavaScript SDK XML Perl SOAP::Lite & SOAP Protocol APIs Database other SOAP libs Browsers, Http Http Clients Authentication Layer Allows cross-platform access to Pipeline Pilot services
  • 6. Protocols as Web Services • Mapping protocols to Web Services – “Visual” Services – Parameter Style – Document Style
  • 7. RESTful Services • Representational State Transfer • Typically pass documents (eg XML, JSON) between client & server that represent state of a resource • Uses existing verbs rather than creating arbitrary function names – GET, PUT, POST, DELETE • Resources identified by URI, so URI mapping required to underlying functions
  • 8. RESTful URIs RESTful URIS refer to resources Two types of URIs Collection - http://example.com/compounds/ Element - http://example.com/compounds/acc123456 5 Common Methods Method Purpose GET For retrieving a data resource or a resource collection POST For creating a new resource PUT For replacing a resource PATCH For updating resource content DELETE For removing a resource
  • 9. Zoo Examples • Collection of animals • Stored in a cache loaded from ‘data/Tables/zoo.txt’ • List, edit, delete animal records • Set of protocols that are exposed as RESTful services • Demonstrated using the Chrome Browser ‘Advanced Rest Client’
  • 10. Demo • Accessing a protocol service from REST browser plugin
  • 11. List Service http://{server}/zoology/animals/ [ {"id":1,"animalname":"aardvark"}, {"id":2,"animalname":"antelope"}, {"id":3,"animalname":"bass"}, {"id":4,"animalname":"bear"}, …
  • 12. Individual Animal Service http://{server}/zoology/animals/1 [ {"id":"1","animalname":"aardvark","type ":"mammal","milk":"1","legs":"4","tail" :"0","eggs":"0","feathers":"0"} ]
  • 13. List the ‘B’ Animals http://{server}/zoology/banimals/ [ {"id":3,"animalname":"bass"}, {"id":4,"animalname":"bear"}, {"id":5,"animalname":"boar"}, {"id":6,"animalname":"buffalo"} ]
  • 14. List the Animals with an XML format http://{server}/zoology/canimals/xml <?xml version="1.0" encoding="UTF-8"?> <animals> <animal id="7" animalname="calf" /> <animal id="8" animalname="carp" /> <animal id="9" animalname="catfish" /> <animal id="10" animalname="cavy" /> </animals>
  • 15. Defining URL Routes • URL Route definitions are provided in package files • In your package define the routes in a urls.conf file • Include a reference to this file in package.conf: … # URL routing configuration Include $(package)/urls.conf
  • 16. Defining URL Routes <url REST AUTH> method GET request /zoology/animals/ protocol Protocols/Web Services/AcclDev/zoo/Actions/animal/List summary List all animals in the zoo. <url> request /zoology/banimals/ param NameFilter B querystring Off summary List all animals whose name starts with the letter B. </url> </url>
  • 17. Reviewing RESTful service protocols List Protocol
  • 18. Some Edit URLs • Add new animals • POST: {root}/zoology/animals/ • Header: Content-type: application/json • By default the body is stored in the first parameter on the protocol (override with _bodyParam in URL route) • Edit an existing animal • PUT: http://meteorbs:9944/zoology/animals/ • With full data record • PATCH: http://meteorbs:9944/zoology/animals/ • With partial data record
  • 19. Specifying the return format • Services can use these methods to control the return format • Accept Header • Accept: application/json • Format Query String argument • http://{server}/zoology/formanimals/1 • OR • http://{server}/zoology/formanimals/1?format=xml • Overrides the format from the Accept header
  • 20. A Long Running Job If the action may take more than a few seconds to run then make it a long running job so it can be polled from the client. In package.conf … <url> method GET request /myapp/slowjob protocol Protocols/Examples/My Protocol param _blocking 0 </url> …
  • 21. Running Job RESTful URLs Method URL path Description GET /jobs/ List of the current user’s jobs GET /jobs/job-id Details for the specified job GET /jobs/job-id/status Status code for the job (e.g. running) GET /jobs/job-id/files List of links to job directory files GET /jobs/job-id/results Results of the job DELETE /jobs/job-id Release the job (terminate if still running) DELETE /jobs/job-id/stop Stop the current job
  • 22. Accessing RESTful services from Protocols • Use JSON Reader (or XML Reader) or HTTP Connector • E.g. $(ServerRoot)/zoology/animals/
  • 23. Summary • Package developers can configure RESTful endpoints for protocols • Next Steps – Get the demo package with which to experiment • testpkg-svc1 – aep_restful_web_services.pdf