Web Service Server entity
A SOAP Web Service Server or JSON Web Service Server entity contains the main logic to publish services. It listens for incoming requests and executes the relevant service operation.
The XML representation of a SOAP Web Service Server entity is a .4wsprg file. The XML representation of a JSON Web Service Server entity is a .4wsjprg file.
When a Web Service Server entity is implemented from the diagram, a
.4gl source file is generated which contains the
MAIN
function for the application. This .4gl
file is also used to combine the other generated .4gl files into a
Genero application.
The generated code can be customized; see Adding custom code.
Any changes to the BA diagram are included in the subsequent re-generating of the program code.
Properties
The Type property is set to "WebServiceServer" for a SOAP Web Service Server entity, and "WebServiceServerJSON" for a JSON Web Service Server entity.
The Namespace property must be set for a SOAP Web Service Server entity.
All properties of a Web Service group of a Record node and of a RecordField node are applicable to the SOAP Web Service Server.
The properties of Web Service group of RecordField node are not applicable to JSON Web Services, except the Public property.
Implementing the Web Service Server
To implement a Web Service Server, right-click on the Web Service Server entity and
select Implement SOAP Web Service Server or
Implement JSON Web Service Server. An XML definition file
(.4wsprg for SOAP or .4wsjprg for
JSON) is generated, containing the logic for the MAIN
function.
When the Web Service Server is implemented, new context menu options appear as in Table 1.
Menu Option | Description |
---|---|
Open | Opens the definition file in the Code Editor. |
Execute Program / Build Program | Builds and/or executes the source code for the Web Service Server based on the related entities in the diagram. |
Locate in Project | Locates and highlights the selected item in the project. |