Warning!
This is a legacy document. The features described below are only usable within the classic-generation environment.
Currently, Betty Blocks offers faster and more advanced options that are available in next-gen. Before you start working on some new features in your application, consider doing it using the next-gen version. Good luck!
A web service facilitates communication between client and server applications. A client sends a request to a server triggering an action on the server and the server sends a response to the client. Communication is platform-independent based on open protocols and standards with the webservice acting as the bridge between the web components. You can use webservices in Betty Blocks for accessing data and for setting up application programming interfaces (API) calls for services.
Note: We are constantly updating the Betty Blocks platform to increase the ease-of-use of our platform. Functionality that is currently still managed in our previous IDE is being transitioned to our updated environment. As certain configurations are still managed in our previous environment, how you work with this environment is described in this article. |
Setting up webservices
You can access webservices by opening the Tools (A) menu and selecting Webservices (B). Where you are working in our current environment, our previous platform is opened on the Webservices (C) page.
Note: If you are already working in our previous platform, you can also access the Webservices by opening the Tools (A) menu and selecting Webservices (B).
|
Click on the webservice in the list (A) to display its details (B). Click on the Edit (C) button details to display the webservice form. More detail on the individual fields is provided below in Completing the details in a Webservice form Press the Close button on the individual panels to return to the previous panel. |
Any changes on webservice files are logged. You can display the details of changes by clicking on the Changes (A) button as shown below. The details of the changes are displayed in the table displayed based on the columns: When (B) - date and time showing when the change was applied. User (C) - details of which user applied the change. Action (D) - details the action that was logged. Type (E) - details the type of change applied. Path (F) - details the path that is impacted. Data (G) - explains the data that was impacted by the action. |
Completing the details in a webservice form |
To create the details for a webservice, click on the New (A) button to open a new webservice form. The Webservice (B) form panel is opened. Complete the details in the form. |
Name | Assign a name for the webservice |
Protocol | Enter the protocol You can choose between HTTP and HTTPS. Check the details with respect to the host to see which protocol needs to be specified. See About HTTP and HTTPS below for more details. |
Host | Enter the domain URL of the webservice that you want to use. |
Authentication Type: | When the host requires you to authenticate before you can access the service, you specify the authentication type here. Betty Blocks supports 5 different types of authentication:
The authentication type you specify for your webservice must reflect the host. |
Authentication: | Select the authentication based on the Authentication Type selected (previous field).
Where you have already set an authentication in the configurations tab, you can select it here.
You can also create a new authentication by selecting |
Request Content-Type: | Choose the format type for sending the request based on the format expected by the host. The option selected is included as the
- JSON: The request is configured as JSON.
- Multi-Part: The request is transmitted as a Multi-Part type. This option should only be selected where the host accepts this content type and you want to send a file without additional body values.
- Other: Select this option when your host requires a request content type other than JSON or Multi-Part.
The option selected is included as the |
Response Content-Type: | Choose in which format type the host transmits its response. This depends on your host. You can choose from:
- JSON: You can use a webservice with a JSON response. Data can be translated for use in your application using custom models. More information about custom models is available in What are custom models?
XML: You can translate data using text expressions or an endpoint template. For more information about XML webservices, please refer to HowTo setup a XML webservice.
Other: Select this option where you expect a response in a format other than JSON or XML. |
Headers | You may need to pass additional information in your request. You can use variables in your header for this. Specify the name and value for the variable. Press Add button to include additional header lines with different names and corresponding values. |
Help text | You can provide a short summary regarding the purpose of the webservice in the Help text. This is useful where other colleagues are involved in maintaining an application. |
Input Variables | You can set up variables that you want to use later with input variables. For example, where you are using a webservice call in an action, you can enter a value for an input variable within the action block. The input variable remains usable for the entire action. |
Additional Webservice details - Dependent items
Once you have saved a webservice and reopen it, information on dependents is also displayed. The number of any related items is displayed. This can be in relation to an input variable that you have included in the webservice or other related details. More information can be found here: What are Dependencies?
Note: Where you want to delete a webservice or a dependent item, you should first check the impact of any dependent items to reduce the possibility of introducing errors.
Viewing details for Webservice Endpoints |
You can view the details for webservice endpoints by clicking on the Endpoints (A) button. Where any endpoints have been defined, they are displayed in the panel that is opened (B). The details are presented in columns in the panel displayed. To create a new webservice, press the New (C) button. The Webservice Endpoint (D) form is displayed that you can use for specifying the endpoint details. When you have specified the details you can use the Save details to save the endpoint details. |
|
About HTTP and HTTPS
Hypertext Transfer Protocol (HTTP) | HTTP is a protocol defining the order and syntax for information transferred over a network. Requests and responses are the two main kinds of HTTP messages. All requests and responses can be read by anyone monitoring the session. |
Hypertext Transfer Protocol Secure (HTTPS) | HTTPS protocol is an extension of HTTP for providing an encrypted connection between a web server and a browser over Transport Layer Security (TLS). TLS uses a public key encryption technology based on a public and a private key. Requests and response are encrypted with session keys so that any intercepted communication is displayed as a random string of characters and not the plaintext. |