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: XMLSequence serialisation with fields out of order  (Read 11069 times)
Lu?s T.
Posts: 39


« on: September 30, 2022, 11:33:35 am »

We ate migrating some webservices from axis (java). With axis it does not complain if the fields come out of order, even if the type is a sequence. That's not what the specification says but it is how it works.

When migrating to GWS, the type generated has the XMLSequence attribute and, if you send a XML request with the fields out of order, the Genero serialisation engine gives an error.

Is there any way to make the serialisation engine ignore this error?

We thought to use XMLAll instead but it is not compatible with a XMLList as a child, that is something we have a lot.
Sisavanh S.
Four Js
Posts: 80


« Reply #1 on: October 04, 2022, 03:23:00 pm »

Hi,

Indeed, XMLAll would have been a good option but unfortunately as you noticed that does not work with XMLList.
A solution could be to modify the 4GL generated stub to fit what Axis is doing.
Could you provide a test sample to your local support center with the xml sample so they can test and see if there is another solution ?

TIA.
Best regards,
Sisa.
Lu?s T.
Posts: 39


« Reply #2 on: October 11, 2022, 04:42:39 pm »

Hi,
I attached an example.
We have multiple customers using the AXIS versión and they can call the webservices using using different order for the elements of a record.
What we really need is support to XMLAll record with XMLList inside.
I hope you can find us a solution.
Thanks
Luis

* testSEQ.4gl (2.36 KB - downloaded 1167 times.)
* TestSequence_wsdl.txt (3.11 KB - downloaded 1146 times.)
* outOfOrderRequest.xml (0.5 KB - downloaded 1151 times.)
* outOfOrderResponse.xml (0.38 KB - downloaded 1147 times.)
Jos? V.
Posts: 58


« Reply #3 on: October 13, 2022, 03:52:03 pm »

Hi,

indeed xmlall does not support xmllist as an element.

I tested fglwsdl on a wsdl with one of this cases and it throws an error.
It looks like this use case is not supported:

<xs:complexType name="agendaIn">
       <xs:all>
           <xs:element maxOccurs="unbounded" minOccurs="0" name="agendaDetail" nillable="true" type="tns:agendaDetail"/>
           <xs:element minOccurs="0" name="deleteOldRegisters" type="xs:string"/>
           <xs:element minOccurs="0" name="pronum" type="xs:int"/>
       </xs:all>
</xs:complexType>


When generating stubs I get the following error:

VALIDATION ERROR (1840) ON FILE 'LeaseProposalService_schema1.xsd' AT LINE 680: Element '{httplement of the set {'0', '1'}.

VALIDATION ERROR (1826) ON FILE 'LeaseProposalService_schema1.xsd' AT LINE 680: Element '{httpe.

ERROR : Element 'maxOccurs' value must be one in 'All'.


Lu?s T.
Posts: 39


« Reply #4 on: October 13, 2022, 04:02:44 pm »

Just one clarification.
If Genero supports XMLAll with XMLList we will be able (we hope) to solve our issue, changing all XMLSequence to XMLAll.
Another way to solve this, which can be easier for FourJs to implement, is to add a serialization option flags for the xml.Serializer to control if it validates or not the order of elements inj a sequence.
This last solution is also better for us as we don't need to modify so much code.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines