Choosing a web services style

Genero Web Services contains style options for creating SOAP Web services. Your choice is dependent on the type of service, (Document or RPC), and the encoding mechanism (literal or encoded) required.

Genero Web Services 2.0 allows you to create SOAP Web services operations in the following styles:

Table 1. Web Services Styles
Web Services Style Description
Remote Procedure Call (RPC) Style Service (RPC/Literal) Generally used to execute a function, such as a service that returns a stock option.
Document Style Service (Doc/Literal)

Generally used for more sophisticated operations that exchange complex data structures, such as a service that sends an invoice to an application, or exchanges a Word document; this is the MS.Net default.

Both RPC/Literal and Doc/Literal Styles are Web Services Interoperability (WS-I) organization compliant.

RPC Style Service (RPC/Encoded)

This feature is deprecated, its use is discouraged although not prohibited.

Provided only for backward compatibility with older versions of web services already published.


This style is deprecated by the WS-I organization, and is not recommended, as most Web Service implementations won't support it in the future.

The style of service to be created is specified in the Genero application for the Web Service, using the following methods of the WebOperation class from the (Web Services COM Library). The parameters are the same for both methods:

  1. The name of the BDL function that is executed to process the Web service operation
  2. The name you wish to assign to the Web service operation
  3. The input record defining the input parameters of the operation (or NULL if there is none)
  4. The output record defining the output parameters of the operation (or NULL if there is none)
LET op = com.WebOperation.CreateRPCStyle("add","Add",
LET op = com.WebOperation.CreateDOCStyle("checkInvoice",

Calling the appropriate function for the desired style is the only difference in your Genero code that creates the service. The remainder of the code that describes the service is the same, regardless of whether you want to create an RPC or Document style of service.


Do not use the setInputEncoded() and setOutputEncoded() methods of the WebService class from the Web Services COM Library (com), as they apply only to RPC/Encoded Style, which is not recommended.

If you add headers to your RPC Style service, choose the Literal serialization mechanism by setting the encoded parameter of the createHeader() method to FALSE:
CALL serv.createHeader(var,FALSE)

GWS release 2.0 allows you to create RPC Style and Document Style operations in the same Web service. However, we do not recommend this, as it is not WS-I compliant.