I'm attempting to implement two formats for my API. JSON is served up by default and works fine when not explicitly denoted in the url.
As soon as I try using .json or .xml in the url, I start getting 400.0 Errors that read "IIS 7.5 Detailed Error - 400.0 - Requested mime type is not supported (.xml)".
This just seams like it should be an IIS issue, but I'm not sure how to troubleshoot further.
The URL used follows this format: https://{domain}/v1/locations.xml?postalcode=75460&token=DBB6BF17093...&reload=true
And it's redirected to: https://{domain}:443/v1/index.cfm/locations.xml?postalcode=75460&token=DBB6BF17093...&reload=true
Here's my code thus far.
Application.cfc
function applicationStartEvent(){
application.anythingToXml = new anythingtoxml.AnythingToXML().init();
}
function configureTaffy()
{
setDebugKey("debug");
setReloadKey("reload");
setReloadPassword(true);
enableDashboard(true);
setDefaultRepresentationClass("v1.resources.customRepresentation");
}
customRepresentation.cfc
<cfcomponent output="false" extends="taffy.core.baseRepresentation">
<cfset variables.anythingToXml = application.anythingToXml />
<cffunction name="getAsJson" access="public" output="false" taffy:mime="application/json" taffy:default="true">
<cfreturn serializeJson(variables.data) />
</cffunction>
<cffunction name="getAsXML" taffy:mime="application/xml" output="false">
<cfreturn variables.AnythingToXML.ToXML(variables.data) />
</cffunction>
</cfcomponent>