Home > SQL Developer Dialog Boxes ... > RESTful Services Wizard and...
The RESTful Services wizard lets you create the resource module, resource template, and resource handles for a RESTful service; individual dialog boxes let you edit the properties of objects associated with a RESTful service. The wizard is displayed when you right-click the Module node in the RESTful Services Administration Pane pane and select New Module; dialog boxes are displayed when you right-click an object and select Edt.
Specify properties of the resource module.
Module Name: Name of the RESTful service module. Case sensitive. Must be unique.
URI Prefix: Base of the URI that is used to access this RESTful service. Example: hr/
means that all URIs starting with hr/
will be serviced by this resource module. (The displayed example changes to include what you enter.)
Publish: Makes the RESTful service publicly available for use.
Pagination Size: Default pagination for a resource handler HTTP operation GET method, that is, the number of rows to return on each page of a JSON format result set based on a database query.
Origins Allowed: Origins that are allowed to access the resource templates. (Click the plus (+) to add each origin.) For example:
http://example1.org https://*.example2.com
Uploading a Resource Module: After creating a resource module, you can upload it, which updates the RESTFUL Services definition on the server. |
Specify properties of the resource template.
URI Template: URI for the resource template. Example: employees/
means that all URIs starting with employees/
will be serviced by this resource template. (The displayed example changes to include what you enter.)
Priority: Priority for the order of how the resource template should be evaluated (low through high).
HTTP Entity Tag (ETag): Identifies the type of entity tag to be used by the resource template. An entity tag is an HTTP Header that acts as a version identifier for a resource. Use entity tag headers to avoid retrieving previously retrieved resources and to perform optimistic locking when updating resources. Options include:
Secure HASH (default): The contents of the returned resource representation are hashed using a secure digest function to provide a unique fingerprint for a given resource version.
Query: Manually define a query that uniquely identifies a resource version. A manually defined query can often generate an entity tag more efficiently than hashing the entire resource representation.
None: Do not generate an entity tag.
Specify the properties of the resource handler. The specific options depend on the method type.
Method: HTTP request method for this handler: GET (retrieves a representation of a resource), POST (creates a new resource or adds a resource to a collection), PUT (updates an existing resource), or DELETE (deletes an existing resource). Only one handler for each HTTP method is permitted.
Requires Secure Access: Indicates whether the resource should be accessed through a secure channel such as HTTPS.
Source Type: Source implementation for the selected HTTP method:
Feed: Executes a SQL query and transforms the results into a JSON Feed representation. Each item in the feed contains a summary of a resource and a hyperlink to a full representation of the resource. The first column in each row in the result set must be a unique identifier for the row and is used to form a hyperlink of the form: path/to/feed/{id}, with the value of the first column being used as the value for {id}. The other columns in the row are assumed to summarize the resource and are included in the feed. A separate resource template for the full representation of the resource should also be defined. Result Format: JSON
Media Resource: Executes a SQL Query conforming to a specific format and turns the result set into a binary representation with an accompanying HTTP Content-Type header identifying the Internet media type of the representation. Result Format: Binary
PL/SQL: Executes an anonymous PL/SQL block and transforms any OUT or IN/OUT parameters into a JSON representation. Available only when the HTTP method is DELETE, PUT, or POST. Result Format: JSON
Query: Executes a SQL Query and transforms the result set into either a JavaScript Object Notation (JSON) or CSV representation, depending on the format selected. Available when the HTTP method is GET. Result Format: JSON or CSV
Query One Row: Executes a SQL Query returning one row of data into a JSON representation. Available when the HTTP method is GET. Result Format: JSON
Data Format (if the Source Type is Query Source): JSON or CSV.
Pagination Size (GET handler): Default pagination size for the module's resource templates: size of the pagination window, or the number of rows to return for a database query.
MIME Types (PUT and POST handlers): Content types.
Resource Handler Editing Pane
When you edit a resource handler, the following tabs are available:
SQL Worksheet: You can specify the query or PL/SQL code in the SQL Worksheet for the resource handler. The SQL Worksheet enables you to connect to the schema, execute the query or PL/SQL code, and view the results.
Parameters: Any parameters for the query or the PL/SQL code.
Details: You can edit the security and other attributes for the Resource Handler.
Displays a summary of the RESTful service properties that you have specified. To make any changes, click Back as needed to return to the desired page or pages.
To create the resource module, resource template, and resource handler as specified, click Finish.
Related Topics: