Web Services changes
There are changes in support of web services in Genero 5.01.
The handling of NULL values for primitive types during serialization has changed
Starting from FGLGWS 5.01.00, there are changes to how nulls are handled in primitive types.
Previously, when null
values were passed, the GWS sent null
. Now
error-15807 will be raised if
a null
value is sent. Where previously you did not have an option to allow null
values, you must now review your code to explicitly allow nulls. The following is a summary of the
behavioral changes for handling nulls in primitive types, objects, and arrays:
- Primitive type: If the value is
NULL
:- Before: It was serialized to
NULL
. - Now: If the
json_null="null"
attribute is not set or the serializeNullAsDefault option is not set to 1, a serialization error is generated.
- Before: It was serialized to
- Object: If a primitive type field is
NULL
, it is omitted unless there is aJSONRequired
attribute set:- Before: It was serialized to
NULL
. - Now: If the json_null="null" attribute is not set or the serializeNullAsDefault option is not set to 1, a serialization error is generated.
- Before: It was serialized to
- Array: If an index is
NULL
:- Before: It was serialized to
NULL
. - Now: If the
json_null="null"
attribute is not set or the serializeNullAsDefault option is not set to 1, a serialization error is generated.
- Before: It was serialized to
For more information about serialization, go to Serializer options.
Using the json_null="null"
attribute with
JSONRequired
Starting from FGLGWS 5.01.00, json.Serializer class
introduces changes to how nulls are handled with JSONRequired
.
Previously, when null
values were passed in a record, or on one of its
primitive elements, marked with JSONRequired
, the GWS sent null
.
Now serialization error-15807
will be raised if a null
value is sent. Where previously you did not have an option
to allow null values, you must now review your code to explicitly allow null values.
To explicitly allow a null value, you must set the json_null="null" attribute on the relevant field, or set the serializeNullAsDefault option for the The json.Serializer class to allow nulls.
For more information about JSONRequired
attribute, go to JSONRequired.
New HttpRequest methods dynamically override FGLPROFILE entries
Starting from FGLGWS 5.01.00, new methods in the HttpRequest
class have been
implemented to allow you to override configurations in FGLPROFILE dynamically at runtime.
Calling setCertificateAndKey() overrides configuration for certificates that might be set in FGLPROFILE. Calling the setCipher() and setVerifyServer() override other parameters that may be set in FGLPROFILE.
While clearing a parameter using clearCertificateAndKey(), clearCipher(), and clearVerifyServer() resets values to the ones configured in FGLPROFILE.
For details, go to com.HttpRequest methods: connection options.
New xml.keystore.cadir entry in FGLPROFILE for XML signature verification
Starting from FGLGWS 5.01.00, an xml.keystore.cadir
entry can be used to specify
a directory for all trusted X509 certificates to be used during XML signature verification.
Previously, you could only specify a priority list of certificates with the
xml.keystore.calist
entry.
Now, xml.keystore.cadir
allows you to provide all the CA certificates in a
directory. You can continue to use the xml.keystore.calist
as before; as files in
the "cadir" directory will be appended to those in xml.keystore.calist
.
For more details, go to FGLPROFILE entries for XML configuration.
New json.Serializer.getLastErrorDescription()
method has improved error
messaging
Starting from FGLGWS 5.01.01, a new method in the json.Serializer
class has been
implemented to allow you return last generated serialization error message.
Calling json.Serializer.getLastErrorDescription returns a more
complete message than sqlca.sqlerrm
. It will return the name of the class to
identify the source of the error, the name of the fields, when known, along with a detailed
description of the error.
Specific exception -15582 for status code not in the range 200 - 299
Starting from FGLGWS 5.00.00 and 5.01.02, the GWS method com.WebServiceEngine.SetRestStatus raises a specific error code -15582, when the status code is not in the range 200 - 299.
Specific exception -15583 when setting a LANG value not recognized by iconv
Starting from FGLGWS 5.01.02, the GWS raises a specific error code -15583 when the
LANG
value is not a codeset recognized by iconv.
Register web services and resources from a package
Starting from FGLGWS 5.01.02, the GWS supports package-style modules in the
com.WebServiceEngine.RegisterRestService()
and
com.WebServiceEngine.RegisterRestResources()
methods.
No action needs to be taken on your part, but if you have previously wanted to use a Genero BDL package when registering web services, this is now possible.
For more information on how to use this feature, go to com.WebServiceEngine.RegisterRestService or com.WebServiceEngine.RegisterRestResources.
New json.Serializer
option for handling implicit conversion
To implement strict JSON schema validation while allowing flexibility when needed, we are introducing an option for implicit conversions during JSON to BDL deserialization.
Starting with FGLGWS 5.01.03, the global option allowImplicitConversion
in
json.Serializer
permits implicit type conversion for
INTEGER
/NUMBER(DECIMAL)
, BOOLEAN
, and
STRING
values in an array. For example, a boolean value can be represented as
1
, 0
, true
, false
,
"true"
, "false"
, or "1"
,
"0"
.
You can now use CALL json.Serializer.setOption("allowImplicitConversion", 1)
in
your server module to enable this option and avoid deserialization errors related to type
mismatches.
For details, go to Serializer options.
Discontinued support for OCSP
We are discontinuing support for the Online Certificate Status Protocol (OCSP) due to the decision by several Certificate Authorities to phase out support for this protocol in web services. However, please note that the OCSP functionality will remain intact within our product, allowing you to continue using this feature as part of your secure communications.
For more information on OCSP, go to Enable OCSP.