SlideShare une entreprise Scribd logo
1  sur  60
REST: So What’s It All About?
Sascha Wenninger (@sufw)
What You Will See

As a paradigm for designing application integration and APIs,
REST now enjoys significantly greater popularity than SOA(P),
particularly for public, internet-facing APIs.
This presentation will give you a quick overview of the core principles
behind the architectural style known as REST.
You will also get a taste of two different approaches for implementing
interfaces according to REST principles in your SAP systems.

Mastering SAP Technologies
A Quick Definition

Architectural Style
  “An architectural style is a coordinated set of architectural
  constraints that restricts the roles/features of architectural elements
  and the allowed relationships among those elements within any
  architecture that conforms to that style.”
Roy Fielding, p. 13




Mastering SAP Technologies
Agenda



                             NetWeaver              Custom
       Concepts                                              Demo
                              Gateway               Coding



                                 Implementation Options



Mastering SAP Technologies
Agenda



                             NetWeaver              Custom
       Concepts                                              Demo
                              Gateway               Coding



                                 Implementation Options



Mastering SAP Technologies
REST



Mastering SAP Technologies
REpresentational
                             State
                             Transfer
Mastering SAP Technologies
What Does That Mean?



Mastering SAP Technologies
One Definition…

         The Client communicates with the Server
                 by modifying the state of Resources
                             through Representations


Mastering SAP Technologies
Another Definition…


                             It’s The Web

                             (for Machines)



Mastering SAP Technologies
A Different Approach

REST interfaces manipulate the state of resources
      “Process as a state machine/data flow diagram”
      Resource-oriented decomposition of business processes


SOA-style interfaces perform a specific task
      “Process as a flowchart/workflow”
      Functional decomposition of business processes

Mastering SAP Technologies
Representations?

A Representation is a serialised version of the server’s internal state

Provides abstraction from implementation (DB, frameworks, language)

Dynamically-created web pages are Representations!



Many different formats possible – not just XML!

Mastering SAP Technologies
Identifying Resources



                             Every Resource has an ID



Mastering SAP Technologies
Identifying Resources

URLs because everyone understands them:
http://saperp/accountcustomer/12345




URLs are cheap. Use lots of them!
http://api.netflix.com/catalog/titles/movies/60021896
http://api.netflix.com/catalog/titles/movies/60021896/cast
http://api.netflix.com/catalog/titles/movies/60021896/synopsis
Mastering SAP Technologies
HTTP?



                             Why the http://… URLs?



Mastering SAP Technologies
HTTP!

                                        Layer         Example

  HTTP is an Application Protocol    7 Application    DNS, FTP, HTTP...
                                     6 Presentation   SSL
                                     5 Session        L2TP, PPTP
  REST uses it as such
                                     4 Transport      TCP
                                     3 Network        IP
  SOAP uses it as a dumb transport   2 Data Link      PPP, ARP
                                     1 Physical       IEEE 802.11

Mastering SAP Technologies
This has a number of benefits…



Mastering SAP Technologies
Benefits

  Reliable Communication
  (The client must handle errors and retries)


  Free* Caching!


  *provided by commodity infrastructure!



Mastering SAP Technologies                      Thanks, Oliver Widder!
Benefits

Easy Metadata Exchange via HTTP Headers!

Accept
Content-Type
If-Modified-Since
Last-Modified
…

Mastering SAP Technologies
Benefits

                             …and last but definitely not least…


                  A Universally-Understood Protocol!



Mastering SAP Technologies
But How is that Better than SOAP?



Mastering SAP Technologies
No Special Tools Needed!




Mastering SAP Technologies   Thanks, Oliver Widder!
HTTP Has Standard Verbs…

                             GET
                             PUT
                             POST
                             DELETE
                             HEAD
                             OPTIONS
                             PATCH
                             TRACE
Mastering SAP Technologies
SOAP Doesn’t.

getAccountCustomerByInternalId
searchCustomerByBasicData
updateSalesProspectStatusByPartnerSalesRepresentativeBasicData_sync



And everything works via HTTP POST
(i.e. it uses HTTP as a dumb transport protocol)

Mastering SAP Technologies
Standard Verbs

Standard Meaning
 Constraints = scope for optimization
 HTTP GET probably the most optimised piece of code ever

Widely Implemented
 Everybody knows how to behave
 No need to code low-level, API-specific communication logic

Mastering SAP Technologies
HTTP Has Standard Responses…

                             200 OK
                             302 Moved Permanently
                             404 Not Found
                             406 Method Not Allowed
                             409 Conflict
                             418 I’m a Teapot
                             …

Mastering SAP Technologies
SOAP Doesn’t.




Mastering SAP Technologies
Benefits

One more:
HATEOAS




Mastering SAP Technologies
Benefits

One more:
Hypertext
As
The
Engine
Of
Application
State
Mastering SAP Technologies
HATEOAS for Humans

Client requests Shopping Cart

Server sends HTML page with items and links
Client’s move
Client clicks the “Check Out” link

Server sends HTML page with Total Amount
Client’s move
Client clicks the “Pay” link

Server sends HTML page with “Thank You” message
Mastering SAP Technologies
Things to Note

The Server guides the Client forward in the process
  (with ‘Check Out’, ‘Pay’ links, etc.)

The Client is responsible for moving forward
  If the client stops, the server doesn’t care




Mastering SAP Technologies
NetWeaver              Custom
       Concepts                                              Demo
                              Gateway               Coding



                                 Implementation Options



Mastering SAP Technologies
NetWeaver Gateway

REST-inspired OData API
Add-On to NetWeaver 7.02
Current version: 2.0 SP03    Web          Devices         Enterprise
                                                          Software
                                                                         Social


Strategic for SAP
                                         SAP NetWeaver Gateway



                                            SAP Business Suite



                                   CRM     SRM      SCM   PLM      ERP


Mastering SAP Technologies
The Good Things

• Quickly build very simple RESTful APIs
• Exposes BAPIs or custom ABAP classes via OData XML
• Core part of SAP’s roadmap (integration to SUP, Duet, etc.)
• SAP-delivered content with each SP release
• Detailed logging and performance analysis tools
My take: A productivity framework similar to the Web Services Runtime
  in ABAP
Mastering SAP Technologies
The Limitations

• Only supports OData (Open, but Microsoft-centric XML)
       – JSON-formatted OData available with SP04 (May 2012)
       – no custom representations (other XML, PDF, etc.)
• Limited support for complex input parameters (e.g. forms)
• Anything beyond really basic APIs will require custom code
       – …maybe even lots of code…
• Licensed separately


Mastering SAP Technologies
Mapping to BAPIs



            BAPI Field       Defaults   OData XML Field




Mastering SAP Technologies
OData Channel

Programmatic way of exposing OData from the backend
Much more flexible – full HATEOAS implementation possible!
Full feature set available in SP04 (May 2012)




Mastering SAP Technologies
Mastering SAP Technologies
Mastering SAP Technologies
NetWeaver              Custom
       Concepts                                              Demo
                              Gateway               Coding



                                 Implementation Options



Mastering SAP Technologies
DJ Adams Started It All…




Mastering SAP Technologies   DJ Adam’s SCN Blog
A Simple REST API for CRM

•    BusinessPartners everywhere
•    BPs have roles (e.g. Customer, Contact Person, Employee…)
•    BPs have relationships with other BPs
•    Relationships have attributes
•    Relationships lead to Opportunities

Target consumer: Mobile app built with HTML5 + jQuery Mobile

Mastering SAP Technologies
3 Resources

http://sapcrm:8000/auspost/businesspartner

http://sapcrm:8000/auspost/bprelationship

http://sapcrm:8000/auspost/opportunity




plus any sub-resources we need

Mastering SAP Technologies
Design Principles
JSON as the default format
Roles & Relationships via hyperlinks
Client must only know the ‘entry point’ URL to its own BP
All other client interaction driven by hyperlinks



There is a great ABAP  JSON library on CodeExchange!
Mastering SAP Technologies
ICF Configuration




                             Create a public class
Mastering SAP Technologies
ICF Configuration

Assign Interface IF_HTTP_EXTENSION




Mastering SAP Technologies
Insert Code Here.




Mastering SAP Technologies   Thanks, Oliver Widder!
NetWeaver              Custom
       Concepts                                              Demo
                              Gateway               Coding



                                 Implementation Options



Mastering SAP Technologies
Questions




Mastering SAP Technologies
Key Points to Take Home

• REST is an architectural style – not a protocol or product.
       – Applies web principles to A2A integration, including use of hyperlinks

• NetWeaver Gateway can quickly expose SAP data & functionality in a
  RESTful way.
• More specific requirements can be met via custom code, including
  the ADL (Alternative Dispatch Layer)
• Most mobile frameworks rely on RESTful integration
Mastering SAP Technologies
If You’d Like to Learn More
A free eBook on REST, by InfoQ: http://www.infoq.com/minibooks/emag-03-2010-rest
A Pragmatic Introduction to REST, by Stefan Tilkov
Teach a Dog to REST, by Apigee’s Brian Mulloy
REST: putting the web back in to web services, by Kerry Buckley
DJ Adams’ original blog on REST on SDN: Forget SOAP - build real web services with the ICF
Further blogs by DJ on implementing RESTful services via the ICF:
•    REpresentational State Transfer (REST) and SAP
•    A new REST handler / dispatcher for the ICF
•    REST-orientation: Controlling access to resources

The defining work on REST, by Roy FieldingArchitectural Styles and the Design of Network-based Software Architectures
A Simple Intro to JSON: http://json.org
Known Limitations of SAP NetWeaver Gateway: SAP Note 1574568
The Richardson Maturity Model, and explained by Martin Fowler.


Mastering SAP Technologies
watchKeynote();



Mastering SAP Technologies
watchKeynote();



Mastering SAP Technologies
We’re RESTful now




             GET /masteringsap/tech/keynote HTTP/1.1



Mastering SAP Technologies
Sascha Wenninger
                             Australia Post
                             sascha@wenninger.name
                                @sufw
                             +61 403 933 472




Mastering SAP Technologies                     Slide 59
REST: So What's It All About? (Mastering SAP Technologies 2012)

Contenu connexe

Plus de Sascha Wenninger

A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...
A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...
A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...Sascha Wenninger
 
A Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsA Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsSascha Wenninger
 
Recipes for the Perfect PI v2.0
Recipes for the Perfect PI v2.0Recipes for the Perfect PI v2.0
Recipes for the Perfect PI v2.0Sascha Wenninger
 
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Sascha Wenninger
 
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
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)Sascha Wenninger
 
Lessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PILessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PISascha Wenninger
 
REST - A Super Quick Intro
REST - A Super Quick IntroREST - A Super Quick Intro
REST - A Super Quick IntroSascha Wenninger
 
SAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSascha Wenninger
 

Plus de Sascha Wenninger (9)

A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...
A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...
A Look at the Performance of SAP UI Technologies - UXP212 at SAP TechEd && d-...
 
A Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsA Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIs
 
Recipes for the Perfect PI v2.0
Recipes for the Perfect PI v2.0Recipes for the Perfect PI v2.0
Recipes for the Perfect PI v2.0
 
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
Navigating SAP’s Integration Options (Mastering SAP Technologies 2013)
 
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)
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)
 
Lessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PILessons Learnt Implementing High-Performance Integration using SAP PI
Lessons Learnt Implementing High-Performance Integration using SAP PI
 
REST - A Super Quick Intro
REST - A Super Quick IntroREST - A Super Quick Intro
REST - A Super Quick Intro
 
SAP TechEd 2010 highlights
SAP TechEd 2010 highlightsSAP TechEd 2010 highlights
SAP TechEd 2010 highlights
 

Dernier

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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...Martijn de Jong
 
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 CVKhem
 
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.pdfUK Journal
 

Dernier (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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 Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
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
 
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
 

REST: So What's It All About? (Mastering SAP Technologies 2012)

  • 1. REST: So What’s It All About? Sascha Wenninger (@sufw)
  • 2. What You Will See As a paradigm for designing application integration and APIs, REST now enjoys significantly greater popularity than SOA(P), particularly for public, internet-facing APIs. This presentation will give you a quick overview of the core principles behind the architectural style known as REST. You will also get a taste of two different approaches for implementing interfaces according to REST principles in your SAP systems. Mastering SAP Technologies
  • 3. A Quick Definition Architectural Style “An architectural style is a coordinated set of architectural constraints that restricts the roles/features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style.” Roy Fielding, p. 13 Mastering SAP Technologies
  • 4. Agenda NetWeaver Custom Concepts Demo Gateway Coding Implementation Options Mastering SAP Technologies
  • 5. Agenda NetWeaver Custom Concepts Demo Gateway Coding Implementation Options Mastering SAP Technologies
  • 7. REpresentational State Transfer Mastering SAP Technologies
  • 8. What Does That Mean? Mastering SAP Technologies
  • 9. One Definition… The Client communicates with the Server by modifying the state of Resources through Representations Mastering SAP Technologies
  • 10. Another Definition… It’s The Web (for Machines) Mastering SAP Technologies
  • 11. A Different Approach REST interfaces manipulate the state of resources “Process as a state machine/data flow diagram” Resource-oriented decomposition of business processes SOA-style interfaces perform a specific task “Process as a flowchart/workflow” Functional decomposition of business processes Mastering SAP Technologies
  • 12. Representations? A Representation is a serialised version of the server’s internal state Provides abstraction from implementation (DB, frameworks, language) Dynamically-created web pages are Representations! Many different formats possible – not just XML! Mastering SAP Technologies
  • 13. Identifying Resources Every Resource has an ID Mastering SAP Technologies
  • 14. Identifying Resources URLs because everyone understands them: http://saperp/accountcustomer/12345 URLs are cheap. Use lots of them! http://api.netflix.com/catalog/titles/movies/60021896 http://api.netflix.com/catalog/titles/movies/60021896/cast http://api.netflix.com/catalog/titles/movies/60021896/synopsis Mastering SAP Technologies
  • 15. HTTP? Why the http://… URLs? Mastering SAP Technologies
  • 16. HTTP! Layer Example HTTP is an Application Protocol 7 Application DNS, FTP, HTTP... 6 Presentation SSL 5 Session L2TP, PPTP REST uses it as such 4 Transport TCP 3 Network IP SOAP uses it as a dumb transport 2 Data Link PPP, ARP 1 Physical IEEE 802.11 Mastering SAP Technologies
  • 17. This has a number of benefits… Mastering SAP Technologies
  • 18. Benefits Reliable Communication (The client must handle errors and retries) Free* Caching! *provided by commodity infrastructure! Mastering SAP Technologies Thanks, Oliver Widder!
  • 19. Benefits Easy Metadata Exchange via HTTP Headers! Accept Content-Type If-Modified-Since Last-Modified … Mastering SAP Technologies
  • 20. Benefits …and last but definitely not least… A Universally-Understood Protocol! Mastering SAP Technologies
  • 21. But How is that Better than SOAP? Mastering SAP Technologies
  • 22. No Special Tools Needed! Mastering SAP Technologies Thanks, Oliver Widder!
  • 23. HTTP Has Standard Verbs… GET PUT POST DELETE HEAD OPTIONS PATCH TRACE Mastering SAP Technologies
  • 25. Standard Verbs Standard Meaning  Constraints = scope for optimization  HTTP GET probably the most optimised piece of code ever Widely Implemented  Everybody knows how to behave  No need to code low-level, API-specific communication logic Mastering SAP Technologies
  • 26. HTTP Has Standard Responses… 200 OK 302 Moved Permanently 404 Not Found 406 Method Not Allowed 409 Conflict 418 I’m a Teapot … Mastering SAP Technologies
  • 30. HATEOAS for Humans Client requests Shopping Cart Server sends HTML page with items and links Client’s move Client clicks the “Check Out” link Server sends HTML page with Total Amount Client’s move Client clicks the “Pay” link Server sends HTML page with “Thank You” message Mastering SAP Technologies
  • 31. Things to Note The Server guides the Client forward in the process (with ‘Check Out’, ‘Pay’ links, etc.) The Client is responsible for moving forward If the client stops, the server doesn’t care Mastering SAP Technologies
  • 32. NetWeaver Custom Concepts Demo Gateway Coding Implementation Options Mastering SAP Technologies
  • 33. NetWeaver Gateway REST-inspired OData API Add-On to NetWeaver 7.02 Current version: 2.0 SP03 Web Devices Enterprise Software Social Strategic for SAP SAP NetWeaver Gateway SAP Business Suite CRM SRM SCM PLM ERP Mastering SAP Technologies
  • 34. The Good Things • Quickly build very simple RESTful APIs • Exposes BAPIs or custom ABAP classes via OData XML • Core part of SAP’s roadmap (integration to SUP, Duet, etc.) • SAP-delivered content with each SP release • Detailed logging and performance analysis tools My take: A productivity framework similar to the Web Services Runtime in ABAP Mastering SAP Technologies
  • 35. The Limitations • Only supports OData (Open, but Microsoft-centric XML) – JSON-formatted OData available with SP04 (May 2012) – no custom representations (other XML, PDF, etc.) • Limited support for complex input parameters (e.g. forms) • Anything beyond really basic APIs will require custom code – …maybe even lots of code… • Licensed separately Mastering SAP Technologies
  • 36. Mapping to BAPIs BAPI Field Defaults OData XML Field Mastering SAP Technologies
  • 37. OData Channel Programmatic way of exposing OData from the backend Much more flexible – full HATEOAS implementation possible! Full feature set available in SP04 (May 2012) Mastering SAP Technologies
  • 40. NetWeaver Custom Concepts Demo Gateway Coding Implementation Options Mastering SAP Technologies
  • 41. DJ Adams Started It All… Mastering SAP Technologies DJ Adam’s SCN Blog
  • 42. A Simple REST API for CRM • BusinessPartners everywhere • BPs have roles (e.g. Customer, Contact Person, Employee…) • BPs have relationships with other BPs • Relationships have attributes • Relationships lead to Opportunities Target consumer: Mobile app built with HTML5 + jQuery Mobile Mastering SAP Technologies
  • 44. Design Principles JSON as the default format Roles & Relationships via hyperlinks Client must only know the ‘entry point’ URL to its own BP All other client interaction driven by hyperlinks There is a great ABAP  JSON library on CodeExchange! Mastering SAP Technologies
  • 45. ICF Configuration Create a public class Mastering SAP Technologies
  • 46. ICF Configuration Assign Interface IF_HTTP_EXTENSION Mastering SAP Technologies
  • 47. Insert Code Here. Mastering SAP Technologies Thanks, Oliver Widder!
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. NetWeaver Custom Concepts Demo Gateway Coding Implementation Options Mastering SAP Technologies
  • 54. Key Points to Take Home • REST is an architectural style – not a protocol or product. – Applies web principles to A2A integration, including use of hyperlinks • NetWeaver Gateway can quickly expose SAP data & functionality in a RESTful way. • More specific requirements can be met via custom code, including the ADL (Alternative Dispatch Layer) • Most mobile frameworks rely on RESTful integration Mastering SAP Technologies
  • 55. If You’d Like to Learn More A free eBook on REST, by InfoQ: http://www.infoq.com/minibooks/emag-03-2010-rest A Pragmatic Introduction to REST, by Stefan Tilkov Teach a Dog to REST, by Apigee’s Brian Mulloy REST: putting the web back in to web services, by Kerry Buckley DJ Adams’ original blog on REST on SDN: Forget SOAP - build real web services with the ICF Further blogs by DJ on implementing RESTful services via the ICF: • REpresentational State Transfer (REST) and SAP • A new REST handler / dispatcher for the ICF • REST-orientation: Controlling access to resources The defining work on REST, by Roy FieldingArchitectural Styles and the Design of Network-based Software Architectures A Simple Intro to JSON: http://json.org Known Limitations of SAP NetWeaver Gateway: SAP Note 1574568 The Richardson Maturity Model, and explained by Martin Fowler. Mastering SAP Technologies
  • 58. We’re RESTful now GET /masteringsap/tech/keynote HTTP/1.1 Mastering SAP Technologies
  • 59. Sascha Wenninger Australia Post sascha@wenninger.name @sufw +61 403 933 472 Mastering SAP Technologies Slide 59

Notes de l'éditeur

  1. Thanks to Kerry Buckley for the inspiration here: http://www.slideshare.net/kjbuckley/rest-putting-the-web-back-in-to-web-services