Highlighted

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

New Here ,
Oct 05, 2015

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?

Views

182

Likes

Translate

Translate

Report

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

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

New Here ,
Oct 05, 2015

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?

Views

183

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 05, 2015 0
gabrybe LATEST
New Here ,
Oct 06, 2015

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 06, 2015 0