Back to Contents


Choosing a Web Services Style

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

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

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 from the Web Services COM Library (com). The parameters are the same for both methods:

  1. the name of the 4GL 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",add_in,add_out)
LET op = com.WebOperation.CreateDOCStyle("checkInvoice","CheckInvoice",invoice_in,invoice_out)

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.

Note: Warning: 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. Example:
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.