Back to Contents


The Web Service class

Summary:

See also: The Genero Web Services COM Library


Syntax

The Web Service class provides an interface to create and manage Genero Web Services.

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

Syntax

com.WebService

Methods

Class Methods
Name Description
com.WebService.createWebService(
  name STRING,
  namespace STRING )
   RETURNING com.WebService
Creates a WebService object by providing the mandatory name and namespace, which must be unique across the entire application.

Throws an exception in case of errors, and updates status with an error code.

com.WebService.CreateStatefulWebService(
  name STRING,
  namespace STRING,
  state VARIABLE )
   RETURNING com.WebService
Creates a stateful WebService object by providing the mandatory name and namespace (which must be unique across the entire application) and a state variable used to identify the state between the client and the server.
  • For a WS-Addressing stateful service, the state variable must be a record with W3CEndpointReference as attribute.
  • For a stateful service based on HTTP cookies, the state variable must be any simple 4GL variable.
  • It is up to the programmer to manage the state variable and to restore the service state from a database.
  • All published web operations require a session in the client request excepted those set as 'initiateSession' that have to instantiate a new session.

Throws an exception in case of errors, and updates status with an error code.

See Stateful services.


Object Methods
Name Description
setComment(
  comment STRING )
Adds a comment to a WebService; the comment will be visible in the generated WSDL file.

Throws an exception in case of errors, and updates status with an error code.

publishOperation(
  op com.WebOperation,
  role STRING )
Publishes a WebOperation named op.  The role identifies the operation if several operations have the same name.

Throws an exception in case of errors, and updates status with an error code.

saveWSDL(
  location STRING )
   RETURNING status
Saves the WSDL of the WebService to the file system; location is the URL where the service will be deployed.  Status is 0 if the file was saved, -1 if there was an error.
generateWSDL(
  location STRING )
   RETURNING xml.DomDocument
Returns a xml.DomDocument representing the WSDL of the WebService; location is the URL where the service will be deployed.

Throws an exception in case of errors, and updates status with an error code.

createHeader(
  header Variable,
  encoded INTEGER )
Creates a global Header of the WebService; header is any Variable defining the header, encoded specifies the encoding mechanism, where TRUE indicates the SOAP Section 5 encoding mechanism and FALSE the XML Schema mechanism. Since Headers are always in Document Style, set the encoded parameter to FALSE.

Throws an exception in case of errors, and updates status with an error code.

createFault(
  fault Variable,
  encoded INTEGER )
Creates a global Fault this WebService can raise; fault is any Variable defining the fault, encoded specifies the encoding mechanism, where TRUE indicates the SOAP Section 5 encoding mechanism and FALSE the XML Schema mechanism.

Throws an exception in case of errors, and updates status with an error code.

registerWsdlHandler(
  function STRING )
Registers a 4GL function executed when a WSDL is generated. The 4GL function must have one input and one output parameter of type xml.DomDocument; the system provides the generated WSDL as input parameter, and you must return it (after modification) to fulfill the WSDL generation process.

Throws an exception in case of errors, and updates status with an error code.

See example 1.

registerInputRequestHandler(
  function STRING )
Registers a 4GL function executed when an incoming SOAP request is received and before the SOAP engine has processed it. The 4GL function must have one input and one output parameter of type xml.DomDocument; the XML SOAP request is provided as input parameter, and you must return it (after modification) to fulfill the SOAP request processing.

Throws an exception in case of errors, and updates status with an error code.

See example 2.

registerOutputRequestHandler(
  function STRING )
Registers a 4GL function executed just after the SOAP engine has processed it and before the SOAP response is forwarded to the client. The 4GL function must have one input and one output parameter of type xml.DomDocument; the XML SOAP response is provided as input parameter, and you must return it (after modification) to fulfill the SOAP response processing.

Throws an exception in case of errors, and updates status with an error code.

Note: If NULL is returned from the input callback, the output callback will be called with the default SOAP fault node, that you can then modify.

See example 3.

setFeature(
  feature STRING,
  value STRING)
Sets a feature for that web service, where feature is one of the name in the list of supported Web Service Features, and value a valid value for the feature to be set.

Throws an exception in case of errors, and updates status with an error code.

Back to the top


Web Service Features

Name Description
Soap1.1 Defines whether the web service supports the SOAP 1.1 protocol. Default value is FALSE.
Soap1.2 Defines whether the web service supports the SOAP 1.2 protocol. Default value is FALSE.
WS-Addressing1.0 Defines whether the web service supports WS-Addressing 1.0. Valid values include:
  • TRUE - The service supports WS-Addressing 1.0 and accepts requests without WS-Addressing.
  • REQUIRED - The service supports WS-Addressing 1.0 and accepts only requests with WS-Addressing.
  • FALSE - WS-Addressing 1.0 is disabled (Default).

Back to the top