I want to ignore the unknown elements I receive in the response from a soap api. So I added these attributes flexible = true and odred = false in the binding file on the mapping of the element.
Extract from the binding file :
<mapping abstract="true" type-name="ns1:MakeReservationResponseType" class="com.path.MakeReservationResponseType" ordered="false" flexible="true">
<structure map-as="ns1:ControlType" get-method="getControl" set-method="setControl" name="Control"/>
<structure get-method="getResponse" set-method="setResponse" usage="optional" name="Response" ordered="false" flexible="true">
<structure map-as="ns1:ResponseBaseFields-Group" get-method="getResponseBaseFields" set-method="setResponseBaseFields" usage="optional"/>
<structure map-as="ns1:BookingType" get-method="getBooking" set-method="setBooking" name="Booking"/>
<structure map-as="ns1:PriceDataType" get-method="getPrice" set-method="setPrice" name="Price"/>
</structure>
<structure map-as="ns1:ErrorResponseType" get-method="getError" set-method="setError" usage="optional" name="Error"/>
</mapping>
When i try to unmarshal the response that i receive, i have this error :
"Expected "{apiUrl}Response" end tag, found "{
apiUrl}Item" start tag (line -1, col -1, in SOAP-message), role=supplier, property=Expected "{apiUrl}Response" end tag, found "{
apiUrl}Item" start tag (line -1, col -1, in SOAP-message"
I have this error because i receive an unknown object not declared in my xsd and binding file.
But in this documentation say if i add flexible = true and ordered = false, i can ignore unknown elements : http://jibx.sourceforge.net/tutorial/binding-extras.html#mixing
But this solution doesn't work and i have the error above.
I use this version of jibx : 1.3.3
So can someone help me please ?
Thanks
question from:
https://stackoverflow.com/questions/65886629/jibx-ignoring-unknown-elements-within-an-unordered-group-on-a-soap-response 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…