ColdFusion web service: semantic error(s) in generated XML content

Copy link to clipboard
Copied
I have created a component with properties called employee.cfc
<cfcomponent>
<cfproperty name="FirstName" type="string">
<cfproperty name="LastName" type="string">
</cfcomponent>
I have a web service that receives an array of employees to update: the saveEmployees() function has this argument:
<cfargument name="employees" type="employee[]" required="true">
the getSOAPRequest() method call renders a SOAP envelope with the following inner structure for the employees:
<employees soapenc:arrayType="ns2:employee[2]" xmlns:ns2="http://soap.mynamespace.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:Array">
<employees xsi:type="ns2:employee">
<firstName xsi:type="xsd:string">
Mark
</firstName>
<lastName xsi:type="xsd:string">
Smith
</lastName>
</employees>
<employees xsi:type="ns2:employee">
<firstName xsi:type="xsd:string">
John
</firstName>
<lastName xsi:type="xsd:string">
Doe
</lastName>
</employees>
</employees>
Maybe this is just semantics, but why doesn't it create the inner elements of the
<employees>
tag as
<employee>
(singular)
as specified in type of my argument?
Any way to achieve this so that the rendered requests and other service methods will return XML that is as self-describing as possible?

Copy link to clipboard
Copied
The more I look at this the more I am convinced that is a BUG. Perhaps a low priority, semantics-only, but definitely a BUG.
Adobe Cold Fusion guys, can you tell me how could I generate the correct version of the XML?

