Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 80307

Re: Re: Remote CFC call through self-made proxy times out when CFC returns ColdFusion error

$
0
0

I'll see if I can simplify:

 

Web.config takes a regex that basically evaluates to */* as a wildcard. So someone calls bob.com/test/this then we get vars "test" and "this" forwarded to something like api.cfc?method=init&var1=test&var2=this.

 

Api.cfc has an init method which validates url vars, verb used to call the page, etc.

 

To test the API I have a page on another app server calling the public API URL using CFHTTP and POST method. Nothing strange here, calls the URL and posts body data.

 

Any time the api.cfc has a CF error (errors that aren't handled by application.cfc onError(), so gray CF output) the CFHTTP call times out. No matter what the timeout setting, it will timeout.

 

web.config rewrite rule

<rule name="API" patternSyntax="ECMAScript" stopProcessing="true"><match url="^v1/([^\\/?%*:|&quot;&lt;>\.]+)/([^\\/?%*:|&quot;&lt;>\.]+)$" /><action type="Rewrite" url="/v1/api.cfc?method=init&amp;function={R:1}_{R:2}" /></rule>

 

Just a bit of the api.cfc file, you can see how the init function is structured.

component {
/***********

INIT

***************/
remote void function init() {


  this.calledFunction = '';  this.apiUserID = 0;  //Make sure our URL var exists from the URL rewrite  if (!StructKeyExists(url, "function")) {   abort;  }

 

Sample of the CFHTTP remote call:

 

<cfhttp method="post" url="https://api-dev.boompayments.com/v1/customer/auth" timeout="3"><cfhttpparam type="body" value="#cfsavecontent#"></cfhttp>

 

 

Nothing really out of the ordinary except I have never used this method with the web.config and rewriting to a CFC. Everything works as long as api.cfc does not return a CF gray error page. I haven't messed with any of the CF admin error handling settings. This is a dev server so robust handling is on but in prod that would be off. I can test that on dev and see if that changes anything but even with the CF error I'd like to not timeout connections.


Viewing all articles
Browse latest Browse all 80307

Trending Articles



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