Summary:
See also: The Genero Web Services COM Extension Library
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.
com.WebOperation
Class Methods | |
Name | Description |
com.WebOperation.CreateRPCStyle(
STRING,
STRING, 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; 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( STRING, STRING, 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; 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(
STRING,
STRING, 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; 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. Notice 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(
STRING,
STRING, 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; 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. Notice 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. |
Object Methods | |
Name | Description |
setInputEncoded(
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(
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(
|
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(
|
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(
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. |
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.