Duncan Priest · Sep 5, 2018

XMLIGNORENULL equivalent for object valued properties

I'm writing a SOAP client in Ensemble (2017.2.2) that is required to pass empty elements to the SOAP server in the form <xsi:type="ns:ResponsibleUser"/> where ResponsibleUser is a class that itself has no properties. I initially thought I'd found the answer with the XMLIGNORENULL parameter of XML enabled classes but this didn't make any difference for SOAP requests, only working when I wrote the XML to a file. Then I came across the XMLIGNORENULL parameter for the SOAP client class (inherited from %SOAP.WebBase), but this only works for %String properties and not for properties of arbitrary class types.

Is there a way to force the output of an empty object-valued property as an empty element in a SOAP request?

Thanks in advance for any guidance

0 1 218 1


Well, months later I stumbled across the answer myself after needing to recreate the web services from modified WSDL. It seems that the problem was the options I selected when originally generating the classes from the WSDL using the SOAP Wizard. I had been using "Class Type: Serial" to avoid cluttering the database with lots of unnecessary tables, but changing this to Persistent (+using indexed one-many relationships) produced classes that no longer give the problem - I now get SOAP requests with empty elements included in the correct form smiley. (At least I assume this was the change that fixed the issue, I also selected "Use unwrapped message format for document style web methods", but I imagine it was the class type that made the difference.)