Web Services
Consuming SOAP
Exposing SOAP
Consuming a REST API
Exposing REST APIs
Logging
Web Services
Set of functionalities offered by a software system over the World Wide Web
● Provided as language-agnostic remote procedures
● Allow integration between heterogeneous systems
OutSystems simplifies consuming and exposing functionality as standard
● SOAP web services
● REST APIs
2
SOAP and REST
SOAP
● "Contract" formalized in a Web Services Description Language (WSDL) file
○ All operations' parameters and return types are fully described
○ SOAP services can provide very detailed contracts
● Requests and responses in XML
3
SOAP and REST
SOAP
● "Contract" formalized in a Web Services Description Language (WSDL) file
○ All operations' parameters and return types are fully described
○ SOAP services can provide very detailed contracts
● Requests and responses in XML
REST
● Lightweight alternative to SOAP
○ No formal API contract file
○ Provide documentation and examples instead of a contract
● Requests and responses (usually) in compact JSON
4
Consuming SOAP in OutSystems
Consume one or more methods with SOAP 1.1 and 1.2 bindings:
● Upload the WSDL file or type its URL
● Choose the bindings
● Select the methods to consume
5
Consuming SOAP in OutSystems
Consume one or more methods with SOAP 1.1 and 1.2 bindings:
● Upload the WSDL file or type its URL
● Choose the bindings
● Select the methods to consume
6
Consuming SOAP in OutSystems
Consume one or more methods with SOAP 1.1 and 1.2 bindings:
● Upload the WSDL file or type its URL
● Choose the bindings
● Select the methods to consume
7
Consuming SOAP in OutSystems
Consume one or more methods with SOAP 1.1 and 1.2 bindings:
● Upload the WSDL file or type its URL
● Choose the bindings
● Select the methods to consume
8
Consuming SOAP in OutSystems
Consume one or more methods with SOAP 1.1 and 1.2 bindings:
● Upload the WSDL file or type its URL
● Choose the bindings
● Select the methods to consume
9
Using SOAP Methods
OutSystems generates...
● SOAP methods as Server Actions
● any compound data types as Structures
The generated elements can be used just like regular
Actions or Structures
Possible to change
● Default values of Input Parameters
● Name and description of elements
Refresh option to get the service updates and to change
the consumed methods
10
Exposing SOAP in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
11
Exposing SOAP in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
12
Exposing SOAP in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
13
Exposing SOAP in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
14
SOAP Endpoints
Endpoint information of exposed Web Services is in Service Center
● Module's Integration tab
The endpoint and WSDL URLs use the host name and module name
● WSDL: http://<hostname>/<ModuleName>/<WebServiceName>.asmx?WSDL
● Endpoint: http://<hostname>/<ModuleName>/<WebServiceName>.asmx
The Web Service is exposed with a WSDL having a SOAP 1.1 or 1.2 binding
15
REST APIs
Consuming a Single REST method
Consume a single REST method
● Provide the method's URL
● Test to get a sample response
● Copy the response to the Body
17
Consuming a Single REST method
Consume a single REST method
● Provide the method's URL
● Test to get a sample response
● Copy the response to the Body
18
Consuming a Single REST method
Consume a single REST method
● Provide the method's URL
● Test to get a sample response
● Copy the response to the Body
19
Consuming a Single REST method
Consume a single REST method
● Provide the method's URL
● Test to get a sample response
● Copy the response to the Body
20
Using REST methods
OutSystems generates
● REST methods as Actions
● Compound data types as Structures
The generated elements can be used just like
regular Actions or Structures
Possible to change
● Default values of Input Parameters
● Name and description of elements
● Change data types of attributes and parameters
○ And also add and remove them
21
Consuming a Single REST method
Consume a single REST method
● Provide the method's URL
● Test to get a sample response
● Copy the response to the Body
22
Using REST methods
OutSystems generates
● REST methods as Actions
● Compound data types as Structures
The generated elements can be used just like
regular Actions or Structures
Possible to change
● Default values of Input Parameters
● Name and description of elements
● Change data types of attributes and parameters
○ And also add and remove them
23
REST Callbacks
REST services provide the following Callbacks
● OnBeforeRequest
● OnAfterResponse
Actions are automatically called before the
request or after getting the response
Useful to debug and customize requests
● Detect and locally handle HTTP error statuses (400 and
over)
● Alter the sent and return values transparently to the
caller code
24
Consuming a REST API
Consume all REST methods
● Provide the API URL
● REST API must be compliant with Swagger specification
25
Consuming a REST API
Consume all REST methods
● Provide the API URL
● REST API must be compliant with Swagger specification
26
Consuming a REST API
Consume all REST methods
● Provide the API URL
● REST API must be compliant with Swagger specification
27
Consuming a REST API
Consume all REST methods
● Provide the API URL
● REST API must be compliant with Swagger specification
28
Exposing REST in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
29
Exposing REST in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
30
Exposing REST in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
31
Exposing REST in OutSystems
To expose a Service in OutSystems
● Create the Service
● Create each method
● Implement them as any Action
32
Logging
Service Center: Module's Integration Tab
Consumed and exposed Web Services
are configurable in Service Center
● Effective endpoint URL
● Security
● Log verbosity
Configuration done per module
● Integrations tab in Service Center
34
Service Center: Integration Logs
35
Summary
● SOAP
○ Consuming SOAP
○ Exposing SOAP
○ SOAP Endpoints
● REST
○ Consuming a REST method
○ Callbacks
○ Consuming a REST API
○ Exposing REST
● Logging
36