Skip to main content
Known Participant
January 20, 2015
Question

Mappings not working for REST

  • January 20, 2015
  • 2 replies
  • 1580 views

I am working on my first REST application in ColdFusion and I am noticing that application specific mapping defined in Application.cfc does not seem to work!

Is it something that is not supposed to work because the application.cfc is only utilized when the REST service is initialized and subsequently its not utilized? Thank you for any insight.

EDIT:


When I had first posted this I thought it was just application specific mappings that did not work. Later on I discovered that it was mappings in general. Even if you had set a server level mapping in the administrator it did not matter. The REST service always defaulted to the wwwroot starting path. Seems like a pretty significant issue unless I am missing something very obvious.

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
January 20, 2015

Could you show us how your Application code and REST CFC look like? It will make it easier to debug this together.

Known Participant
January 20, 2015

I am talking about just regular ColdFusion mappings. I have the REST service working fine if my component paths are absolute.

For example, if you define in your Application.cfc or in your server admin a mapping say

/abc :  .\inetpub\wwwroot\MAINAPPLICATIONPATH

Your REST application is registered at

.\inetpub\wwwroot\RESTAPPLICATIONPATH

now in your REST application if you have a component reference in the format below, I get errors saying that the component does not exist.

abc.cfc.Component

Now if I put the component in the RESTAPPLICATIONPATH and reference is like below everything works fine.

RESTAPPLICATIONPATH.cfc.Component.

I can share code but as all this is part of a much larger application, I would have to create something smaller to demonstrate the issue. I have been able to get things working by using absolute path references but just not by using mappings.

BKBK
Community Expert
Community Expert
January 21, 2015

I fail to understand why you use MAINAPPLICATIONPATH and RESTAPPLICATIONPATH.

Inspiring
January 20, 2015

Which version of Coldfusion are you using?

In the latest version of Coldfusion you can registered you REST services in the Administrator under Data & Services > REST Services. I assume when you are talking about mappings, you are talking about the normal mappings.

Also take a look at this RESTful Web Services in ColdFusion - ColdFusion, English documentation - Adobe Learning Resources