Returntype of "XML" Issue With REST Webservice
Andrew Powell
When you use the returntype="XML" argument (CFMX 7.0.2 in my case), you expect valid XML to be returned, and it is. The issue comes up when you are looking at the MIME type being set. When you use the XML returntype, the MIME type remains "text/html" instead of being "text/xml".
Why does this matter? Some clients that may be consuming your service are expecting a MIME type of XML. If you give them "text/html" the client may see it as invalid and not properly digest your response.
Adding this to your method that returns the XML will ensure you have the proper MIME type:
<cfcontent type="text/xml"/>
Use this and your REST webservices will behave properly.
Posted in ColdFusion | XML | AJAX |
0 comments