20
RELAX IT’S ONLY RESTFUL How to build a RESTful Web service with Iguana IGUANA USER CONFERENCE 2013

How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

RELAX IT’S ONLY RESTFUL

How to build a RESTful Web service with Iguana

IGUANA USER CONFERENCE 2013

Page 2: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

OVERVIEW

•  Introduction to basic terms •  Understand components and flow •  RESTful web services •  See it in action •  How is it used in healthcare (FHIR) •  Closing Arguments

IGUANA USER CONFERENCE 2013

Page 3: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

WEB SERVER

IGUANA USER CONFERENCE 2013

Page 4: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

WEB SERVICE

IGUANA USER CONFERENCE 2013

Page 5: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

WHY WEB SERVICES

•  INTEROPERABILITY •  Easy to implement •  Uses open/standardized protocols •  Low cost

IGUANA USER CONFERENCE 2013

Page 6: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

COMPONENTS

•  Server •  Client •  Resource •  Request •  Response

IGUANA USER CONFERENCE 2013

Page 7: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

FLOW OF A REQUEST

IGUANA USER CONFERENCE 2013

Page 8: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

LANGUAGES USED

•  Most common languages used – XML

•  example

– JSON •  example

IGUANA USER CONFERENCE 2013

Page 9: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

HTTP PROTOCOL

•  Hypertext Transfer Protocol •  Ascii text •  Methods specify desired result

– GET – POST – PUT – DELETE

•  URL used to make requests

IGUANA USER CONFERENCE 2013

Page 10: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

HTTP STRUCTURE

IGUANA USER CONFERENCE 2013

•  Protocols •  Host •  Port •  Path •  Parameters •  Fragment

Page 11: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

HTTP REQUEST

•  Uses GET or POST to request an action or resource •  Structure has [method][URL][version] •  [headers] •  [body]

IGUANA USER CONFERENCE 2013

GET http://server.com/patient/240 HTTP/1.1 Host: hl7.org Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) Accept: text/html Accept-Language: fr-FR Date: Fri, 9 Aug 2013 21:12:00 EST

Page 12: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

HTTP RESPONSE

•  MIME returned •  Response Format

–  [version][status][reason] –  [headers] –  [body]

IGUANA USER CONFERENCE 2013

HTTP/1.1 200 OK Cache-Control: private Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 Date: Fri, 9 Aug 2013 21:12:00 EST Content-Length: 17151

Page 13: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

EXAMPLE

•  GET patient name from Database – Taken from demo channels

•  http://wiki.interfaceware.com/1368.html

•  POST to add patient – Form written in HTML (Dreamweaver)

IGUANA USER CONFERENCE 2013

Page 14: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

RESTFUL INTERFACE

•  Representational State Transfer •  Leaves an open design and applies

constraints •  Stateless Client-Server •  Uses HTTP •  Uses API for structure

IGUANA USER CONFERENCE 2013

Page 15: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

WHAT ELSE CAN YOU DO!

•  Web services connect everything you love on the internet – Social media – Quick pricing for flights and hotels

•  Iguana has its own API for monitoring – Use GET to request status – Use POST to change a status

IGUANA USER CONFERENCE 2013

Page 16: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

HEALTHCARE RELATED

•  Healthcare has some bad communication practices

•  Web services help make sharing easier – Quicker implementation – Less network traffic – Higher ROI

IGUANA USER CONFERENCE 2013

Page 17: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

FHIR

•  Fast Healthcare Interoperability Resources(FHIR)

•  First major attempt to move to web services

•  Not perfect but a start •  Uses GET and PUT

– GET gives you patient information – PUT allows you to add new information in

•  Based off of HL7’s RIM IGUANA USER CONFERENCE 2013

Page 18: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

AUTHENTICATION

•  Tokens •  Keys •  OAuth2 •  SSL

IGUANA USER CONFERENCE 2013

Page 19: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

ADDITIONAL RESOURCES

•  RESTful WEB SERVICES •  Roy Fieldings Paper on designing of network based architectures REST •  http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf •  Good Restful API design Manual •  http://info.apigee.com/Portals/62317/docs/web%20api.pdf

•  WEB SERVICES BASICS •  http://www.w3schools.com/webservices/ws_platform.asp

•  MONITOR IGUANA WITH WEB API •  1. This one has the simple code in the translator for checking the status of the channel •  http://wiki.interfaceware.com/190.html •  2. This gives you the details on the web URL options and stopping and starting channels •  http://www.interfaceware.com/manual/starting_and_stopping_channels_using_a_web_url.html

•  SIMPLE EXAMPLE •  Calling a newsfeed with web services

http://wiki.interfaceware.com/148.html

IGUANA USER CONFERENCE 2013

Page 20: How to build a RESTful Web service with Iguana to Build... · RESTFUL INTERFACE • Representational State Transfer • Leaves an open design and applies constraints • Stateless

QUESTIONS AND ANSWERS

•  Yee haw

IGUANA USER CONFERENCE 2013