A resource contains the definition of the REST response message and the data access method to return the response. When you create an Informatica REST web service, you can manually define the resource or you can create a resource from a data object.
You can create a resource from a relational data object or a flat file data object. When you create a resource from a data object, the Developer tool creates a default resource mapping with a Read transformation and an Output transformation. The Output transformation contains the same ports as the Read transformation.
You can manually define the structure of the output response message. When you manually create a resource, you define the elements in the response message. Then you define the mapping that returns the data to the response message.
A REST web service can have multiple resources. Each resource has a resource mapping to retrieve the data and a definition of the output response. You can choose the resources to view in the Resources tab. Right-click in the editor and select
Show Resources
.
The following image shows the Select Resources dialog box:
You can view the components of a resource on the
Resources
tab.
The following image shows the components of a resource on the
Resources
tab of the REST web service:
The resource contains the following components:
Key
An index to the data in the response message. A web service client can request data for a specific key. You can set any simple type element as a key in the output.
Definition
The elements in the output response message. You can view the elements by expanding the definition in the resource or by navigating to the
Schema
view of the
Resources
properties.
Resource Mappings
The mapping that retrieves the data, transforms it, and returns it in a response message. By default, a resource mapping contains a Read transformation and an Output transformation. You can add any transformation to the mapping. View the resource mapping by clicking the link in the resource.