Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

REST Custom XML Output

$
0
0

Hi,

 

I've spent the last few days working with CF's implementation of REST and I love it. I can return XML as well as JSON from a query. The mobile app developer however says he needs the xml with special output.

 

So for example, ColdFusion outputs the following:

 

<QUERY ID="1">

     <COLUMNNAMES>

          <COLUMN NAME="VENDOR_NAME"/>

          <COLUMN NAME="ID"/>

     </COLUMNNAMES>

     <ROWS>

          <ROW>

               <COLUMN TYPE="STRING">ADVANCED INTERSTATE</COLUMN>

               <COLUMN TYPE="STRING">ABC123</COLUMN>

          </ROW>

          <ROW>

               <COLUNM TYPE="STRING">M-AMERICA INC</COLUMN>

               <COLUMN TYPE="STRING">DEF456</COLUMN>

          </ROW>

     </ROWS

</QUERY>

 

The mobile app developer says he needs it this way:

<vendors type="array">

     <vendor>

          <id type="integer">7</id>

          <name>ADVANCED INTERSTATE</name>

          <api-key>ABC123</api-key>

     </vendor>

     <vendor>

          <id type="integer">5</id>

          <name>M-AMERICA INC</name>

          <api-key>DEF456</api-key>

     </vendor>

</vendors>    

 

So, based on my understanding, QUERY= ID="1" needs to read VENDORS type="array", and so on.

 

Can I modify any of the output in order to match what the mobile app developer wants? Thank you.

 

Sincerely,

Andy


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>