Working of Optional attributes versus objects in a Published SOAP Webservice

1
Good afternoon, I have a SOAP Webservice which has The following structure: With this structure I would expect the following: Entity01 is always sent and has 0 to x Entity02 objects attached. If there are Entity02 objects, AttributeA should always be present and not empty. AttributeB is either left out or included and not empty. When I use SoapUI to Test the Webservice, it accepts the request when I don't inlcude AttributeA in it. Am I overlooking something here? Could it be that because Entity02 is Optional, all underlying attributes are Optional as well? I would expect it to break due to the absence of AttributeA.   Thanks!
asked
1 answers
0

It should indeed break. If I try this, SOAP UI receives an incomplete response:

<?xml version="1.0" ?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.example.com/"><soap:Body><tns:OperationResponse><EntityA><Attribute>2</Attribute><EntityB_EntityA><EntityB

and the console of the modeler reads:

com.mendix.integration.WebserviceException: Attribute 'Attribute1' is neither optional nor nillable but mapped value 'MyFirstModule.EntityB.MyFirstModule.EntityB.Attribute1' is null for operation 'Operation'

answered