I ran across an interesting CFC bug this weekend. I have a CFC method that calls a custom tag like so:
type="__types"
bActiveOnly="false"
r_stObjects="types"
/>
When I ran a sample CFM page that used this method, it ran fine, however, when I tried calling the same method as a web service, I got an error stating that foo/customtags/etc could not be found and that I needed to add a mapping for foo. Of courcse, foo already existed as mapping so it didn't make sense.
After some digging and multiple posts, all I found was another friend who shared the same issue. It turns out that this may be a known bug in CF. When I verify it I will post here.
Now you may ask, why am I wrapping a custom tag call inside a CFC? In this case, the custom tags make up a CMS (Element) that my company develops. I'm working on a demo that utilizes Flash to speak to the CMS so I wanted to wrap up some of the core functionality inside a CFC.
While I can switch my calls to use relative paths, the entire framework depends on the use of a mapping, so this may be a problem.
As I find more I'll edit this post.
Archived Comments
Hi Raymond,
I have also had this issue and it turns out it is a known issue with CF.
See post by Charlie Arehart (bottom of page, look at comments also)
http://cfmxplus.blogspot.co...
There is a very hard to find section in the Macromedia livedocs also:
http://livedocs.macromedia....
"If you invoke a CFC method remotely, using a specific URL, form field, Flash Remoting MX, or a web service invocation, ColdFusion looks in the specified path relative to the web root. For form fields and URLs specified directly on local web pages, ColdFusion also searches relative to the page directory."
I think the above translates to "ColdFusion ignores CF Mappings when invoked remotely, via remoting etc"
Hope that helps.
-Brendan
http://farcry.daemon.com.au
Ray,
You might be encountering an old issue... Charlie Arehart puts it quite well here:
Impact of mappings on use of CFCs in CF, web services, and Flash remoting
http://cfmxplus.blogspot.co...
Benoit Hediard has a workaround in the comments which you might find useful.
Guys, thanks for the info. Brendan, I don't think your second URl applies, as I _believe_ it directly relates to _finding_ the CFC. In my case, I have no issue finding the CFC. The issue is that the method then uses a CF mapping. I'm still trying to find a bug # if it exists.