Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Sequence cannot be null  (Read 573 times)
Jos? V.
Posts: 25

« on: November 23, 2021, 06:21:28 pm »

I'm building a webservice which gets a list of DB records as a dynamic array.
When there's no record on the DB the array ends up empty and should return a empty tag, but instead I'm getting the error:
-17 Sequence 'testresponse': Sequence cannot be null

My response type is defined as follows:
type tns1testresponse record ATTRIBUTE(XMLSequence,XSTypeName="TestResponse",XSTypeNamespace="urn:audaxys/leasews/leasing/LeaseComercialService")
  responsearray dynamic array       ATTRIBUTE(XMLList) of tns2resparray   ATTRIBUTE(XMLNamespace="",XMLOptional)
end record

The problem seems to be that even tought responsearray is XMLOptional he is the only member of type tns1testresponse and without it being instantiated I get the error above.

I also noticed that I get the correct result if I add an empty member to responsearray using appendElement() which forces the array to not be null but returns this:
SOAP-ENV:Envelope xmlns:SOAP-ENV="">
      <fjs1:testresponse xmlns:fjs1="urn:audaxys/leasews/leasing/LeaseComercialService" xmlns:fjs2=""/>

I attached a zip file demonstrating this behaviour.
It includes a server, the .h file with the globals and the WS module.

Is there a way/attribute to get the expected behaviour(empty testResponse tag) when the array is empty?

NOTE: Im using BDL 3.20.11

* (2.4 KB - downloaded 15 times.)
Reuben B.
Four Js
Posts: 845

« Reply #1 on: November 24, 2021, 09:39:05 am »

I have not tried with your example, but in 3.10 there was a change in this area and it maybe that you need XMLOptional or XMLNillable or both.

Register for WWDC 21 at

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of
Contributor to
Jos? V.
Posts: 25

« Reply #2 on: November 24, 2021, 11:14:49 am »

I had read the upgrade notes and tried several combinations before posting.

My understanding of the issue is that the type of the main response variable cannot be "empty"
Since it is composed only of a optional dynamic array, this array cannot be null.
And that's what I'm trying to achieve, an empty response.

Is there any way do to this? Am I missing something?
Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines