Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Asynchronous CFML Gateway

Guest
May 18, 2007 May 18, 2007
I am trying to invoke a Asynchronous CFML Gateway. Inf my CFC i am sending an email using CFemail tag. I am getting the following error. Has anybody experienced this error. Any help will be appreciated.

Error Invoking CFC for Gateway gatewayname: null
TOPICS
Event gateways
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2007 May 18, 2007
Is your gateway's ID actually gatewayname? Does your CFC have the method onIncomingMessage()? In fact, could you show us the content of the CFC?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 19, 2007 May 19, 2007
Hello BKBK, Thanks for your reply. Following is what i did.

1. created a gateway instance in CFadmin of with following information
type Asynchronous CFML
Id = asynchr_submit
Path = H:\JL\TEST\cfc\asynchr_submit.cfc
Config file = H:\JL\TEST\cfc\asynchr_submit.cfg. I also tried with no config file.
(i also tried with config file cfc-method =onIncomingMessage and mode = saynchronous )

Gateway service enabled in settings

2. Config file has the following
mode=asynchronous
cfc-method=onIncomingMessage


3. Content of CFC (asynchr_submit.cfm)

<cfcomponent displayname="asynchr_submit" output="false" hint="Asynchronous CMFL gateway for Submit">
<cffunction name="onIncomingMessage" output="no">
<cfargument name="CFEvent" type="struct" required="true" />

<cfset email_txt = 'test email 2144'>
<cfmail to="email@email.com" from="email@email.com"
subject="Async test" cc="email@email.com">#email_txt#
</cfmail>

</cffunction>
</cfcomponent>

4. Calling cfml code
<cfoutput>
<div class="pagebody">
<cfscript>
status=false;
stTest = StructNew();
StructInsert(stTest, "Fname", "Test");
StructInsert(stTest, "lname", "Test again");
StructInsert(stTest, "email", "email@email.com");
status = SendGatewayMessage("asynchr_submit",stTest);
</cfscript>
<cfoutput>status = #status#
<cfdump var=#stTest#>
</cfoutput>
</div>
</cfoutput>

5. Error received from log is 05/18 08:33:20 Error [Thread-20] - Error Invocking CFC for gateway asynchr_submit: null
&. i even tried with only cfset insided my cfc. I apreciate your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2007 May 20, 2007
> 3. Content of CFC (asynchr_submit.cfm)
You register the CFC in the Administrator as H:\JL\TEST\cfc\asynchr_submit.cfc. However, you seem to have saved the file as asynchr_submit.cfm. Unlikely to be the cause of the error, however, verify it.

I would leave out the CFG completely. Tighten the code in the calling cfm page. In the CFC, make use of the data you pass from the calling page, which is what it's all about.

<cfscript>
status=false;
stTest = StructNew();
StructInsert(stTest, "Fname", "Test");
StructInsert(stTest, "lname", "Test again");
StructInsert(stTest, "email", "email@email.com");
status = SendGatewayMessage("asynchr_submit",stTest);
</cfscript>
<cfoutput>status = #status#</cfoutput>
<cfdump var="#stTest#">


<cfcomponent displayname="asynchr_submit" output="false" hint="Asynchronous CMFL gateway for Submit">
<cffunction name="onIncomingMessage">
<cfargument name="CFEvent" type="struct" required="true" />
<cfset email = CFEvent.data.email>
<cfset email_txt1 = 'test email 2144'>
<cfset email_txt2 = CFEvent.data.Fname>
<cfset email_txt3 = CFEvent.data.lname>
<cfmail to="#email#" from="#email#" subject="Async test" cc="#email#">
#email_txt1#
Fname: #email_txt2#
Lname: #email_txt3#
</cfmail>
</cffunction>
</cfcomponent>



edit: quotes added to cfdump line

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2007 May 20, 2007
Thanks BKK, That was a typo. I named the file as .cfc. Right now i do not have access to admin to get rid .cfg file. But i tried with you code, i got the same error message. I am trying to do this for the first time and no body have done this at my workplace place. So i tend to think more of a some kind of setting issue with CFadmin.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2007 May 20, 2007
BKBK,
what do you mean by register cfc ? do i have to do anything other than creating the gateway instance (asynchr_submit).
Also for me this is the first CFC.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2007 May 20, 2007
I wonder whether there is something wrong with the path H:\JL\TEST\cfc\. I created a gateway instance similar to yours

Gateway ID: asynchr_submit
Gateway Type: Asynchronous Events via CFML
CFC Path: C:\JL\TEST\cfc\asynchr_submit.cfc
Configuration File:
Startup Mode: manual

It works on my machine. The calling file and CFC I used are

C:\CFusionMX7\wwwroot\gw_test.cfm:
<cfscript>
status=false;
stTest = StructNew();
StructInsert(stTest, "Fname", "Test");
StructInsert(stTest, "lname", "Test again");
StructInsert(stTest, "email", "email@email.com");
status = SendGatewayMessage("asynchr_submit",stTest);
</cfscript>
<cfoutput>status = #status#</cfoutput>
<cfdump var="#stTest#">

C:\JL\TEST\cfc\asynchr_submit.cfc :
<cfcomponent displayname="asynchr_submit" output="false" hint="Asynchronous CMFL gateway for Submit">
<cffunction name="onIncomingMessage">
<cfargument name="CFEvent" type="struct" required="true" />
<cfset email = CFEvent.data.email>
<cfset email_txt1 = 'test email 2144'>
<cfset email_txt2 = CFEvent.data.Fname>
<cfset email_txt3 = CFEvent.data.lname>
<cflog application="YES" file="asynchr_submit_logger" text="#email#; #email_txt1#; Fname: #email_txt2#; Lname: #email_txt3#">
</cffunction>
</cfcomponent>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2007 May 20, 2007
Thank for your help.

I am using fusebox3 and i am calling the script from one of my fuse. Is anything to do with permissions ?
I can't think of anything else.

regards
Jothi
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2007 May 20, 2007
what do you mean by register cfc ?
Nothing besides what you already know. I meant register a gateway instance in the Administrator with that CFC path.

Is anything to do with permissions ?
It's a possibility. Do you lack any?

Two experiments:
- Move your CFC to a folder under the web root? Can you then use a CFM page to instantiate an object from the CFC?
- Run my version of the code. What happens?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 21, 2007 May 21, 2007
LATEST
BKBK, I really appreciate your help. I moved my CFC to the root (H;\JL\cfc\asynchr_submit.cfc) and it worked. But if I have the cfc in (H:\JL\TEST\cfc\asynchr_submit.cfc) it does not work. I got Error Invoking CFC for Gateway gatewayname: null.

I also tried to create Mapping for H:\JL\TEST\cfc in cfadmin and it did not like it. Here we run multiple Virtual Machines in one machine. I am going play more and I will keep you posted. Let me know f you can think of anything else.

Thanks again.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources