Highlighted

Getting status Pending when calling rest function call

Explorer ,
Jan 14, 2015

Copy link to clipboard

Copied

Hi,

Coldfusion version 10.

The app hangs using IE9 when I do a REST cf function call from js file. Observing the console, I see Pending status. However, it works fine in later versions of IE, Chrome and Mozilla.

When I changed cffunction httpmethod from DELETE to PUT it worked. So, I figure that maybe javascript function call and cffunction header mismatch.

------------------------------------------------------------------------------------

Here is cffunction;

<cffunction output="no" name="zeroUpdateCredits" access="remote" produces="application/json" consumes="application/json" returnType="struct" httpmethod="DELETE">

<cfargument name="DATA" type="struct" required="yes"/>

<cfset var retStatus = StructNew() />

<cfset retStatus["success"] = true />

<cftry>

<cfset var qSponsDetails = APPLICATION.cfc.properties.getsettings(DATA.employee_id)>

<cfif qSponsDetails.allow_credits>

  <cfset temp = saveCredits(credits = 0, employee_id = DATA.employee_id, effective_date = DATA.effective_date)>

</cfif>

<cfcatch type="any">

<cfthrow errorcode="401" message="error zero credits" />

<cfreturn>

</cfcatch>

</cftry>                  

<cfreturn retStatus>

</cffunction>

----------------------------------------------------------------------------------

Here is the function call:

exports.clearCredits = function(employeeId, effectiveDate){

data = {

  employee_id: employeeId,

  effective_date: effectiveDate

};

var promise = rest.DELETE({

  url: appConfig.restPrefix + 'selections/unusedcredits?t=' + new Date().getTime(),

    contentType: 'application/json'

  }, JSON.stringify(data)

  );

  return promise;

};

Thank you,

Gena

Views

430

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Getting status Pending when calling rest function call

Explorer ,
Jan 14, 2015

Copy link to clipboard

Copied

Hi,

Coldfusion version 10.

The app hangs using IE9 when I do a REST cf function call from js file. Observing the console, I see Pending status. However, it works fine in later versions of IE, Chrome and Mozilla.

When I changed cffunction httpmethod from DELETE to PUT it worked. So, I figure that maybe javascript function call and cffunction header mismatch.

------------------------------------------------------------------------------------

Here is cffunction;

<cffunction output="no" name="zeroUpdateCredits" access="remote" produces="application/json" consumes="application/json" returnType="struct" httpmethod="DELETE">

<cfargument name="DATA" type="struct" required="yes"/>

<cfset var retStatus = StructNew() />

<cfset retStatus["success"] = true />

<cftry>

<cfset var qSponsDetails = APPLICATION.cfc.properties.getsettings(DATA.employee_id)>

<cfif qSponsDetails.allow_credits>

  <cfset temp = saveCredits(credits = 0, employee_id = DATA.employee_id, effective_date = DATA.effective_date)>

</cfif>

<cfcatch type="any">

<cfthrow errorcode="401" message="error zero credits" />

<cfreturn>

</cfcatch>

</cftry>                  

<cfreturn retStatus>

</cffunction>

----------------------------------------------------------------------------------

Here is the function call:

exports.clearCredits = function(employeeId, effectiveDate){

data = {

  employee_id: employeeId,

  effective_date: effectiveDate

};

var promise = rest.DELETE({

  url: appConfig.restPrefix + 'selections/unusedcredits?t=' + new Date().getTime(),

    contentType: 'application/json'

  }, JSON.stringify(data)

  );

  return promise;

};

Thank you,

Gena

Views

431

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 14, 2015 0

Have something to add?

Join the conversation