Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guest
Oct 05, 2015 Oct 05, 2015

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?

272
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 06, 2015 Oct 06, 2015
LATEST

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources