Hi !
It seems that when we use an OGNL map the generated soap contains all optional element with empty value.
For example, with the following xsd :
<?xml version="1.0" encoding="UTF-8"?><xs:schema targetNamespace="http://webservice_consumer/test"
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://webservice_consumer/test">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="mandatoryElement" type="xs:string" />
<xs:element name="optionalStringElement" type="xs:string"
minOccurs="0" />
<xs:element name="optionalElement" type="tns:optionalElementType"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="optionalElementType">
<xs:sequence>
<xs:element name="aString" type="xs:string" minOccurs="0" />
<xs:element name="aDate" type="xs:date" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:schema>
and the requestMap
{code}requestMap.put("root.mandatoryElement","A");{code}
the generated soap is (from soapUI software)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://webservice_consumer/test">
soapUI accept that but not my esb service (webservice="true") even without the comments, unless I remove the "aDate" element, wich must be a type issue.
So my question : how avoid the generation of optionnals elements without values ?
Unfortunately there is no way to do this at the moment. This will be handled by this JIRA: