Example: Adding Resources and Operations from a WADL Service to a REST Reference
You can add resources and operations to a REST reference from a WADL service using the Configuration Shortcut found in the REST Binding Configuration Wizard.
-
Right-click the External References swimlane in the SOA Composite Editor, and select Insert, then REST.
The REST Binding Configuration Wizard is displayed.
-
Enter a Name for your REST service or reference.
The Type field displays Reference.
-
Select Service will be invoked by components using WSDL interfaces.
-
Click Next.
-
Under Configuration Shortcut, select Add resources and operation mappings based on WADL Service.
The WADL Location dialog is displayed.
-
Specify a WADL file through one of the following methods:
- In the WADL URL field, specify the URL of the WADL file, then go to the next step.
or
-
Click the Search icon to invoke the WADL Chooser dialog for selecting the WADL file. Options are provided for finding WADLs in the local file system or project, in the design-time Oracle Metadata Services Repository (MDS Repository), or by connecting to an application server to find WADLs associated with deployed Oracle SOA Suite or Oracle Service Bus services.
-
Select the WADL file, and click OK.
-
Click OK.
-
Select copy schema artifacts into the project to copy schemas referenced in the WADL file to the local project because they are used by the new REST adapter reference. This is the recommended method.
-
See the table below for the next step based on the type of WADL file selected.
Table 37-4 WADL File Status
If the Selected WADL File Was Provided By... Then... Next Step... An Oracle SOA Suite or Oracle Service Bus REST service
The Resources page is completely configured with information from the WADL file. All operations, resource paths, and verbs are displayed in the Operation Bindings section. A complete configuration is indicated by a value of yes in the Complete column of the Operation Bindings section.
View the Resources page and its contents, and click OK.
A non-Oracle SOA Suite or Oracle Service Bus REST service such as a Jersey service.
The WADL Parsing Issues dialog indicates that additional configuration is required.
-
Review the list of recommended corrective actions in the WADL Parsing Issues dialog, then click OK. The same information is written to the Oracle JDeveloper Log window for later reference.
A WADL file for a non-Oracle SOA Suite or Oracle Service Bus service typically does not include all required information. You must manually complete configurations. In many cases, the WADL file used does not supply the schemas required to bind the REST reference to a WSDL operation. The schemas can often be generated using the Native Format Builder wizard using a sample payload provided by the REST service provider.
The Resources page is displayed.
For a REST binding that requires further configuration, a value of no is displayed in the Complete column of the Operation Bindings section. Tool tips in the Complete column for each no value identify what is missing so that you can perform corrective actions. The OK button is disabled as long as at least one operation has a value of no in the Complete column.
Note:
All error and warnings are also displayed in more detail in the Log window in Oracle JDeveloper. For example, the Log window contains entries such as the following:
ERROR at [resource path: containers/{container}, method name: PUT, request/response: response, representation mediaType: application/xml ] - No schema information is available for containers/{container}.PUT response. Please specify a schema.
-
Perform the corrective actions indicated by the tool tips. When configuration has been successfully completed, a value of yes is displayed for all operations in the Complete column of the Operation Bindings section.
For more information about the SOA design-time MDS Repository, see Managing Shared Data with the Design-Time MDS Repository.
-