Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Flash Integration / March 2009



Tip: Looking for answers? Try searching our database.

Error in CFC - message to Flex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phred1 - 26 Feb 2009 22:44 GMT
I am sending messages to a flex program via a CFC reading messages off of a
socket (gateway is called asocket - the flex gateway is ows35_example4 via
LCDM).
The messages are getting to the flex program but errors are showing up in
cfserver.log, eventgateway.log and exception.log that says:

Error invoking CFC for gateway asocket: Unable to locate the body entry in the
outgoing message structure..

once for each message that is sent.  The enclosed code shows the CFC running
the asocket gateway - which definitely has a "body" entry.
How do I stop this error ?  Is there something wrong with the CFC ?
Using Coldfusion 8.0.0.1786276

-thank you

<cfcomponent displayname="echo" hint="echo messages from the event gateway">
    <cffunction name="onIncomingMessage" output="no">
        <cfargument name="CFEvent" type="struct" required="yes">

      <cfset flexMessage = StructNew() >

      <cfset messageObject = StructNew() >
      <cfset messageObject.message = arguments.CFEvent.Data.MESSAGE >

     <cfset flexMessage.body = messageObject>

      <cfset flexMessage.Destination="ColdFusion_exam">

      <cfset ret = SendGatewayMessage( "ows35_example4", flexMessage)>

    </cffunction>

</cfcomponent>
Phred1 - 02 Mar 2009 21:02 GMT
Ugh .... I figured this out.

I was using HTTP comments "<!--  -->" (that I did not include in the source
above) instead of the CF comments "<!--- --->".

What you don't see is that there is another SendGatewayMessage that was (I
thought) commented out using the messageObject Struct for the message.  It
doesn't have a body part so it makes sense that the error happened.

I changed the HTTP comments to CF comments and the errors went away.

Note to self ... be careful of your comments.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.