application connector operations |
proiv dashboard |
![]() |
RESTful Web Services Demo
The demo uses the Restful Web Service definition PROIV Demo Service and makes call to an example PROIV media database.
To make calls to the web service select the restful method and click the Send button.
RESTful Web Services Demo Configuration
To set the RESTful Web Services Demo configuration, do the following:
-
On the Application Connector Operations page, expand RESTful Web Services Demo.
The Application Connector operations page appears. -
Enter the configuration as required. The following table describes the fields that can be configured.
Field Name
Description
Options
Authorization
Security id
Enter the security id. Setting the security id enables HTTP access security on the service. The server sends the text to the client requesting the service, and the client needs to respond with the security secret specified in the next field.
Secret
Enter the secret text that the HTTP client needs to respond with if there is a security id. If there is no security id, this field is ignored.
CORS
Enable CORS
Cross-origin resource sharing (CORS) defines a way for client web applications that are loaded in one domain to interact with resources in a different domain.
Turn ON the slider for Enable CORS to enable the service. If this is not set, the service is not available. If you set and save the service it might be auto disabled where a red indicator appears. Click the red indicator to view the message that explains the reason for being auto disabled.
Note: If a REST service has both CORS and authorization (security ID & secret) enabled, the CORS Options request must include authorization. If this is not required then authorization for an Options request can be turned off by setting the servlet parameter 'restful_options_needs_authorization' to 'false' in the WebServices web.xml file.
By default, CORS is disabled.Headers
Enter the request header name for the service to accept; in case of multiple headers, separate the headers with a comma. A request header name defines a name that the service will accept in the request header called 'Access-Control-Request-Headers' for a CORS pre-flight request. The request headers that were accepted will be returned in the response header ‘Access-Control-Allow-Headers’ for the CORS pre-flight request.
A service does not need to use any headers, hence the field can be left blank but if a CORS pre-flight request does specify headers in the ‘Access-Control-Request-Headers’ header, then these must be defined in this field or an error status will be returned as stated in the Failed Status Responses.
Note: The ‘Authorization’ header used by the PROIV REST server is automatically included in the list of acceptable request headers so does not need to be defined here.
Asynchronous
Asynchronous
Turn ON the slider for Asynchronous to execute the REST service asynchronously.
HTTP Request Method
Method
Select a method. Refer to RESTful Web Service methods for more information.
By default, GET method is selected.
Request Data
artist
Represents an artist name as a field in the media database.
title
Represents the title of the artist in the media database.
URL
Endpoint
The URL is created automatically with the specified artist and title values.
The URL is recognized by the server as a request for a RESTful Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.
Click Send to execute the REST call.
Response
Status
The path is the last part of a URL that will be recognized by the server as a request for a RESTful Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.
Response Body
A service method may define the acceptable responses for a service call. You can create as many responses as you want and you do not have to define any responses.
You can define the body data for a service method which requires request body data when it is called. Only methods of type ‘post’ or ‘put’ can define a request body. This body field defines a JSON schema for the request body content and this schema will be used by the test panel and the client generation tool to provide some checking that the request body has the correct structure before a call to the service is performed.
To help in schema generation you can enter an actual JSON object and click ‘{o}->{s}’ on the right of the field and it will convert your JSON object to a valid JSON schema.
RESTful Web Services Test
To test the RESTful Web Services Demo configuration, do the following:
-
On the Application Connector Operations page, expand RESTful Web Services Test.
The PROIV Demo Service section appears.Field Name
Description
Use secure protocol
Turn ON the slider to use secure protocol (HTTPS). If the slider is turned OFF, the service will use HTTP protocol.
POST
Enter the values for the fields such as title, address, value, artist and format. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the POST method of RESTful Web Service configuration.
GET
Enter the values for the fields such as artist and title. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the GET method of RESTful Web Service configuration.
DELETE
Enter the values for the fields such as artist and title. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the DELETE method of RESTful Web Service configuration.
PUT
Enter the values for the fields such as title, address, value, artist and format. Click Test to test the service with the configured values. The response is displayed under the Response section with the response code and description as you have set in the PUT method of RESTful Web Service configuration.
-
Set the configuration as required. The following table describes the fields that can be configured.
SOAP WSDL
To set the SOAP Web Services Demo configuration, do the following:
-
On the Application Connector Operations page, expand SOAP WSDL.
The SOAP services that are configured are displayed. The Demo Web Service appears by default. -
The following table describes the fields that helps use the service for the selected web service.
Field Name
Description
Use secure protocol
Turn ON the slider to use secure protocol (HTTPS). If the slider is turned OFF, the service will use HTTP protocol.
Endpoint
The URL is created with the specified configuration settings. You can not change the URL as it s read-only. The URL is recognized by the server as a request for a SOAP Service. This can be any text but must start with "/". If you do not put "/" at the beginning, the "/" gets added automatically when the service is saved.
Enter WSDL URL to get a web page. You can use the URL to see the XML that is generated for the web service when executed by a service client.
Note: The WSDL URL can be used by an external web services client to collect the WSDL and execute the services.
Related Topics
Topic ID: 830005