SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
(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

Mais conteúdo relacionado

Mais procurados

Lecture 7 Web Services JAX-WS & JAX-RS
Lecture 7   Web Services JAX-WS & JAX-RSLecture 7   Web Services JAX-WS & JAX-RS
Lecture 7 Web Services JAX-WS & JAX-RSFahad Golra
 
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSPTechCon
 
OpenDaylight and YANG
OpenDaylight and YANGOpenDaylight and YANG
OpenDaylight and YANGCoreStack
 
Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow enginedmoebius
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesArun Gupta
 
Confoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabledConfoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabledAnthony Dahanne
 
Was 5.1 To 6.1 Updated
Was 5.1 To 6.1 UpdatedWas 5.1 To 6.1 Updated
Was 5.1 To 6.1 Updatedtsmanyam
 
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...
Augmenting Flow Operations and Feedback on the Model Driven MD_SAL Approach i...Brent Salisbury
 
Tech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM WorkflowsTech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM Workflows51 lecture
 
Building Asynchronous Services With Sca
Building Asynchronous Services With ScaBuilding Asynchronous Services With Sca
Building Asynchronous Services With ScaLuciano Resende
 
Where and when to use the Oracle Service Bus (OSB)
Where and when to use the Oracle Service Bus (OSB)Where and when to use the Oracle Service Bus (OSB)
Where and when to use the Oracle Service Bus (OSB)Guido Schmutz
 
Developing Voice Applications in the Cloud
Developing Voice Applications in the CloudDeveloping Voice Applications in the Cloud
Developing Voice Applications in the CloudVoxeo Corp
 

Mais procurados (20)

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

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

(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
(ATS3-GS03) Accelrys Enterprise Platform Deeper DiveBIOVIA
 
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise ArchitecturesBIOVIA
 
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol AuthorsBIOVIA
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Alexandre Morgaut
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesIMC Institute
 
Windows Azure架构探析
Windows Azure架构探析Windows Azure架构探析
Windows Azure架构探析George Ang
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)Sascha Wenninger
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web ServicesRajarshi Guha
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworksukdpe
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
Introduction to ServiceStack
Introduction to ServiceStackIntroduction to ServiceStack
Introduction to ServiceStackmobiweave
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Peter R. Egli
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End TestingErika Barron
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIServlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIPRIYADARSINISK
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A GlanceStefan Christoph
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptmartinlippert
 

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

(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
(ATS3-GS03) Accelrys Enterprise Platform Deeper Dive
 
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
(ATS3-GS02) Accelrys Enterprise Platform in Enterprise Architectures
 
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
 
Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29Wakanda - apps.berlin.js - 2012-11-29
Wakanda - apps.berlin.js - 2012-11-29
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
 
Windows Azure架构探析
Windows Azure架构探析Windows Azure架构探析
Windows Azure架构探析
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web Services
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
Introduction to ServiceStack
Introduction to ServiceStackIntroduction to ServiceStack
Introduction to ServiceStack
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End Testing
 
Rest web service
Rest web serviceRest web service
Rest web service
 
Servlets
ServletsServlets
Servlets
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIServlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, API
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
 
Modern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScriptModern Architectures with Spring and JavaScript
Modern Architectures with Spring and JavaScript
 

Mais de BIOVIA

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

Mais de BIOVIA (20)

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

(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 Jon.Hurley@accelrys.com
  • 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