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

Re: coldfusion REST service, 404 not found

$
0
0

jpmyob wrote:

 

... Are you trying to say that is HAS to be under the CF default webroot???

No. I was just suggesting the simplest way to get REST working. Incidentally, by 'webroot' I mean webroot, not 'CF default webroot'.

 

I agree with you that any path to a directory containing a REST-enabled CFC should work. Let's debug your settings, one by one.

Directory looks like this

C:\wwwroot\restTest

 

CODE - saved as "obj1.cfc" - ( Note: I've tried restpath with and without the / )

<cfcomponentrestpath="/restTest"rest="true">  
    <cffunctionname="getMethod"access="remote"
                returntype="String"httpmethod="GET"> 
        <cfreturn"this is a string returned"/> 
    </cffunction> 
</cfcomponent>

That is OK. However, try testing the alternative,<cfcomponent restpath="/myRestPath">. I remember once encountering some difficulties with both restpath and rest. For clarity, at least, you should also distinguish the directory name from the restpath name, hence myRestPath.

 

The coldfusion ADMIN setup looks like this

Root path:'C:\wwwroot\restTest'ServiceMapping:'test'

That is OK, too. Now, to start anew, go to the Caching page of the ColdFusion Administrator and press the button to 'Clear Component Cache Now'.

 

Restart ColdFusion. Create and run a CFM page containing the following code:

 

<!--- Maintain case-sensitivity in the URL, just in case. Pun unintended--->

<cfhttp url="http://localhost/rest/test/myRestPath" method="get" result="restResult">

</cfhttp>

<cfdump var="#restResult#">


Viewing all articles
Browse latest Browse all 21760

Trending Articles



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