CONNECT. TRANSFORM. AUTOMATE. Creating Web Services with FME Server
May 24, 2015
CONNECT. TRANSFORM. AUTOMATE.
Creating Web Services with FME Server
Web services
Create REST Web Services with FME Server
Web Services
HTTP/HTTPS JSON or XML URL HTTP Parameters
Web Service Standards
Specific URL patterns Specific HTTP parameters Specific XML and JSON payloads
The FME Bits
Data Streaming service Workspace
FME_SERVER_REQUEST_URI parameter FME_SERVER_REQUEST_HEADERS parameter JSON/XML Transformers
The Workspace
The workspace implements the service standards All of the transformation abilities of FME FME Workbench’s ease of use
Three Examples
OGC WXS Junaio Augmented Reality Subscription Management
FME WxS Workspace
GetCapabilities Request
Response XML
GetFeature Request
Response GMLFME Server
OGC WXS
Augmented Reality
Augmented Reality
Define a channel by providing a service URL
Augmented Reality
FME Server Data Streaming service URL: http://fmeserver.com/fmedatastreaming/junaio/
surrey_businesses.fmw
Augmented Reality
Specific URL patterns defining the type of request: http://<host>/<service>/pois/search http://<host>/<service>/pois/event http://<host>/<service>/pois/visualsearch http://<host>/<service>/tools/modelencrypt http://<host>/<service>/tools/trackingxml
Augmented Reality
Specific HTTP parameters for filtering the response: http://<host>/<service>/pois/search?l=
(location) http://<host>/<service>/pois/search?p=
(search perimeter) http://<host>/<service>/pois/search?m=
(max features)
Augmented Reality
Request from Junaio Augmented Reality Browser: http://fmeserver.com/fmedatastreaming/junaio/
surrey_businesses.fmw/pois/search?l=54.40,-120.01,200&p=3000&m=40
Augmented Reality
Augmented Reality
Published Parameters Request URL
Augmented Reality
Specific response data format: AREL XML
Augmented Reality
XMLTemplater transformer
Subscription ManagementExample of Implementing a REST API
Let’s manage subscriptions to FME Server topics using a web service
Subscription ManagementExample of Implementing a REST API
Entities: devices, email addresses, WebSocket streams
Topics: places to send messages to and read messages from
Subscriptions: agreement for an entity to receive messages from a topic
Subscription ManagementExample of Implementing a REST API
Let’s make it RESTful by using the URL pattern to specify the resource to act on
Subscription ManagementExample of Implementing a REST API
The Subscription Manager REST API:
subscription_manager.fmw/entity/<id>/add?type=<email|apns|gcm|websockets>subscription_manager.fmw/subscription/<topic_name>/<id>/addsubscription_manager.fmw/subscription/<topic_name>/<id>/add?confirm_token=******subscription_manager.fmw/subscription/<topic_name>/<id>/deletesubscription_manager.fmw/subscription/<topic_name>/<id>/delete?confirm_token=******
Subscription ManagementExample of Implementing a REST API
Let’s return JSON like the cool kids
Subscription ManagementExample of Implementing a REST API
Subscription ManagementExample of Implementing a REST API
Request URL
Subscription ManagementExample of Implementing a REST API
JSONTemplater transformer
Subscription ManagementExample of Implementing a REST API
FME Server makes creating web services easy