Back to Contents


The Web Operation class

Summary:

See also: The Genero Web Services COM Library


Syntax

The Web Operation class provides an interface to create and manage the operations of a Genero Web Service.

The Web Operation can be created as RPC Style or Document Style. Both RPC/Literal and Doc/Literal Styles are WS-I compliant (standards set by the Web Services Interoperability organization).

Note that status is set to zero after a successful method call.

Syntax

com.WebOperation

Methods


Creation

Class Methods
Name Description
com.WebOperation.CreateRPCStyle(
  function
CONSTANT STRING,
  operation
STRING,
  input Variable,
  output Variable )
  
RETURNING com.WebOperation
Creates a Request-Response RPC Style WebOperation object, where function is the name of the 4GL function that is executed to process the XML operation. Note that the function name must be a string literal not a string variable due to Operation publication restrictions; operation is the name of the XML operation; input is the input record defining the input parameters of the operation (or NULL if there is none) output is the output record defining the output parameters of the operation (or NULL if there is none).
This method returns a WebOperation object.
Throws an exception in case of errors, and updates status with an error code.
com.WebOperation.CreateDOCStyle(
  function
CONSTANT STRING,
  operation
STRING,
  input Variable,
  output Variable)
  
RETURNING com.WebOperation
Creates a Request-Response Document Style WebOperation object, where function is the name of the 4GL function that is executed to process the XML operation. Note that the function name must be a string literal not a string variable due to Operation publication restrictions; operation is the name of the XML operation; input is the input record defining the input parameters of the operation (or NULL if there is none) output is the output record defining the output parameters of the operation (or NULL if there is none).
This method returns a WebOperation object.
Throws an exception in case of errors, and updates status with an error code.
com.WebOperation.CreateOneWayRPCStyle(
  function
CONSTANT STRING,
  operation
STRING,
  input Variable)
  
RETURNING com.WebOperation
Creates a One-Way RPC Style WebOperation object, where function is the name of the 4GL function that is executed to process the XML operation. Note that the function name must be a string literal not a string variable due to Operation publication restrictions; operation is the name of the XML operation; input is the input record defining the input parameters of the operation (or NULL if there is none).
This method returns a WebOperation object.
Note that there is no output parameter to be returned to the client.
Throws an exception in case of errors, and updates status with an error code.
com.WebOperation.CreateOneWayDOCStyle(
  function
CONSTANT STRING,
  operation
STRING,
  input Variable)
  
RETURNING com.WebOperation
Creates a One-Way Document Style WebOperation object, where function is the name of the 4GL function that is executed to process the XML operation. Note that the function name must be a string literal not a string variable due to Operation publication restrictions; operation is the name of the XML operation; input is the input record defining the input parameters of the operation (or NULL if there is none).
This method returns a WebOperation object.
Note that there is no output parameter to be returned to the client.
Throws an exception in case of errors, and updates status with an error code.

Back to the top


Configuration

Object Methods
Name Description
setInputEncoded(
  encoded
INTEGER )
Sets the input parameter encoding mechanism of the WebOperation, where values for encoded are TRUE indicating the SOAP Section 5 encoding mechanism, and FALSE indicating the XML Schema mechanism. Not recommended.
Throws an exception in case of errors, and updates status with an error code.
setOutputEncoded(
  encoded
INTEGER )
Sets the output parameter encoding mechanism of the WebOperation; where values for encoded are TRUE indicating the SOAP Section 5 encoding mechanism, and FALSE indicating the XML Schema mechanism. Not recommended.
Throws an exception in case of errors, and updates status with an error code.
addInputHeader(
  input Variable )
Adds an input header to the WebOperation, where input is any variable previously created as the Header of the WebService object.
Throws an exception in case of errors, and updates status with an error code.
addOutputHeader(
  output Variable )
Adds an output header to the WebOperation, where output is any variable previously created as the Header of the WebService object.
Throws an exception in case of errors, and updates status with an error code.
setComment(
  comment
STRING )
Adds a comment to the WebOperation. The comment will appear in the WSDL of the service.
Throws an exception in case of errors, and updates status with an error code.

Back to the top


Usage

RPC Style Service (RPC/Literal) is generally used to execute a function, such as a service that returns a stock option. Document Style Service (Doc/Literal) is 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. The input or output RECORD cannot have XMLNamespace attributes set on their members.

Calling the appropriate function to create 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, as they will specify the RPC/Encoded Style, which is not recommended (see Choosing a Web Service Style). 

Since release 2.0 GWS 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.

Back to the top