ColdFusion Rest API not working - rest

Previously I was running ColdFusion 10 configured with Apache on my localhost. I am using a different machine now and I am now using ColdFusion 11's built in web server. I have imported settings from an archived ".car" file. My app uses ColdFusion Rest services which were working on my previous machine. I have setup the rest service on this new machine and I am using the same service name but with a different absolute path to directory.
for example:
previous directory: - D:/foo/bar/api/v2
current directory: - C:/foo/bar/baz/api/v2
The rest service is registered and gets refreshed successfully in the ColdFusion Administrator. But when I try to access the API path on localhost, I get this 500 error :
This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
Application v2 could not be found. The specific sequence of files included or processed is: ''''

Related

Testing Jetty server of Jasper Reports Integration

I am trying to use JasperReports integration for the first time. I am using the included Jetty server, Oracle database XE 18c and Windows 7.
I am following the quick start guide https://github.com/daust/JasperReportsIntegration/blob/main/src/doc/github/installation-quickstart.md
I downloaded the zip folder, configuired database access through adding schema credentials in application.properties file as follows...
[datasource:default] type=jdbc
url=jdbc:oracle:thin:#localhost:1521:XEPDB1 username=hr password=hr
this parameter is limiting access to the integration for the specified
list of ip addresses, e.g.:
ipAddressesAllowed=127.0.0.1,10.10.10.10,192.168.178.31 if the list is
empty, ALL addresses are allowed.
Then I deployed the jri.war file successfully. Then I started the server successfully as well. But when I tried to test it through http://localhost:8090/, I got the following page, and I do not know if that's the norm or there's something wrong...
I need to know if testing is successful, and what's meant by "context" here?
Thanks
You deployed the jri.war to the context path /jri, this isn't an error, and is quite normal.
Just access your webapp via http://localhost:8080/jri/

A WebGroup/Virtual Host to handle /appname has not been defined

I get the following error message when I try to open up my application from the web (using 'appname' as my application name, the root name of my application - the error displays my app's actual name):
com.ibm.ws.webcontainer.internal.WebContainer handleRequest SRVE0255E: A WebGroup/Virtual Host to handle /appname has not been defined.
As far as I can tell, my application was installed correctly and is running on our Websphere server (WAS 8.5).
I'm at a loss for what to pursue in order to resolve this issue - what possible issue could my application be having?
Map your web module to /appname in the administration console, or use whatever context-root is specified for the web module.

SOAP/HTTP using different folder mappings in ColdFusion

I'm experiencing some strange behaviour with a ColdFusion 11 server, which (among other things) publishes some web services accessed via both SOAP and HTTP. The server itself is Windows 2012, running IIS. Actual folder config is as follows:
IIS has two websites configured, 'BOB' and 'BOB_Services'. Both have been configured with the CF Server Config tool so that CF handles .cfc, .cfm files. They share a common CFIDE config.
BOB's root is I:/inetpub/BOB
BOB_Services's root is I:/inetpub/BOB_Services
There is a folder mapping configured in CF Admin from '/' to 'I:/inetpub/BOB'. Don't ask me why, no one seems to know.
Normally there is a services.cfc file in BOB_Services ONLY. Yesterday we accidentally copied that same file into the BOB root folder, and all of our SOAP services using BOB_Services\services.cfc started throwing errors. Yet I can query the same webservice via HTTP (eg. using http://bob/services.cfc?method=function1&param1=0 ....etc) and get a valid result.
This is a reference answer in case anyone else comes across this strange behaviour.
It appears that when BOB_Services/services.cfc is called using HTTP GET, the folder mapping
'/' -> 'I:/inetpub/BOB'
is ignored and the actual file used to process the request is I:/inetpub/BOB_Services/services.cfc.
When a function in BOB_Services/services.cfc is called using a SOAP client, the folder mapping is invoked and the file used to process the request is I:/inetpub/BOB/services.cfc, IF IT EXISTS. If it does not exist, the file I:/inetpub/BOB_Services/services.cfc is used as expected.
This behaviour appears to be entirely repeatable - I can make a SOAP request, get one result, change the mapping, make another request and get the other result.

Disable /rest URL in ColdFusion10

Our problem with ColdFusion 10 is that there is the /rest/ URL binded. In our application we have a rest service ourselves. Since ColdFusion 10 it will not work because the URL is already defined and our requests won't get through. Is there any way to disable /rest/ completely? Or do we have to rename our service?
I also tried to edit the axis2.xml file
<parameter name="disableREST" locked="true">true</parameter>
<parameter name="restPath">restdisabled</parameter>
But that won't effect anything on the server.
Thanks in advance!
Disclaimer: I have not tried this and do not have a ColdFusion 10 installation nearby to verify
There is a servlet mapping defined in the web.xml file that defines how to handle /rest/ requests for ColdFusion. So you should be able to rename that URI to something else for your implementation. The web.xml file is located under the wwwroot\WEB-INF directory on your ColdFusion server.
I found some reference to this here - Getting started with RESTful web services in ColdFusion (under the Accessing a REST Service through HTTP section)
That documentation also mentioned updating the uriworkermap.properties file. Here is an excerpt from that page:
rest in the URL specifies that the request is for a REST service. ColdFusion has a servlet mapping for the same and would direct the request to the servlet that handles REST service. If there is a directory in the server webroot with the same name, you must update the servlet mapping in web.xml file inside wwwroot\WEB-INF directory. Also, you must update the same mapping in the uriworkermap.properties file located under the config\wsconfig\1 of the server directory.
You will need to restart the ColdFusion service after making any changes to these files.
While this will not disable the functionality in ColdFusion it will allow your services to respond under the /rest/ URI because ColdFusion will be listening under a different one that you define.

404 error with cross domain json calls

I have an ASP.NET MVC 2.0 application where I have an action that returns a jsonp action result. It worked on my development machine from my local IIS web site to another IIS site.
When I deployed the services site on Windows Server 2008 R2+IIS7.5 the ajax calls don't work and I get this error:
404 The resource you are looking for
might have been removed, had its name
changed, or is temporarily unavailable
Update: Solved
The problem was with query string limits on IIS 7.5. You can adjust this by following the steps on this page:
http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits
The problem was with query string limits on IIS 7.5. You can adjust this by following the steps on this page:
http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits