I have open-sourced a CFC that includes  functions that convert a cf  
query or cf array to/from a thinArray ( a special-format, delimited  
list ).  The thinArray can then be transmitted to/from a web service as  
a single string within an XML (WDDX) packet.  It has the additional  
advantage of reducing bandwidth (XML tag overhead from about 256% to  
9%)

You would need to write the equivalent functions on the net side in  
whatever language you choose.  But that should not be too difficult as  
you could just re-implement the  logic in the CFC -- it is almost  
trivial:

Rob Rohan has implemented _javascript_ thinArray processing in his  
Neuromancer package at:

http://www.rohanclan.com/products/neuromancer/

The thinArray CFC (cfBAM.cfc) is part of the package.  The  
documentation is in comments at the start of the CFC.

Dick

On Aug 18, 2004, at 6:09 AM, Adam Haskell wrote:

> I've always contended that sending anything over a webservice other
>  than simple values is going to get you in trouble. Even in CF - CF
>  communications I think sending anything other than text is asking for
>  trouble. I recomend using one of the many functions on cflib.org to
>  convert the complex objects to xml.
>  http://www.cflib.org/udf.cfm?ID=648
>
>  Antother option would be to generate a WDDX packet and return that but
>  you'll need something like
>   
> http://www.topxml.com/code/default.asp?
> p=3&id=v20020829124758&ms=20&l=dotnet&sw=categ
>  to deal with WDDX in .Net I think.
>
>  Adam H
>
>  On Wed, 18 Aug 2004 10:20:00 +0100, Craig Dudley  
> <[EMAIL PROTECTED]> wrote:
>  > ..NET just doesn't understand the return type, it probably could if  
> you
>  > wrote some sort of QueryBean handler but I'd try returning a more  
> simple
>  > data type, maybe you could encode the query into an xml packet and
>  > return that? Or try and array?
>  >
>  > -----Original Message-----
>  > From: Steven Brownlee [mailto:[EMAIL PROTECTED]
>  > Sent: 18 August 2004 10:07
>  > To: CF-Talk
>  > Subject: Consuming CFC web methods in VB.NET
>  >
>  > This is my last stab at this problem. No other message boards have  
> been
>  > able to help me.
>  >
>  > First, the code...
>  >
>  > getPlaylist.cfc
>  > --------------------------------------------
>  > <cffunction access="remote" name="getNewPlaylist" output="no"
>  > returntype="query">
>  > <cfargument name="clientID" type="string" required="yes">
>  >
>  > <cfquery ....... name="IMPlaylist">
>  > .... removed for space saving...
>  > </cfquery>
>  >
>  > <cfif IMPlaylist.recordCount gt 0>
>  > <cfoutput query="IMPlaylist">
>  > <cfquery datasource="clp_dyn_signs" dbtype="odbc" username="..."
>  > password="...">
>  >������������������ .. Removed for space saving
>  > </cfquery>
>  > </cfoutput>
>  > <cfreturn IMPlaylist>
>  > </cfif>
>  >
>  > </cffunction>
>  > --------------------------------------------
>  >
>  > frmMain.vb
>  > --------------------------------------------
>  > Dim MyService As getPlaylist.getPlaylistService = New
>  > getPlaylist.getPlaylistService
>  > Dim MyResult As getPlaylist.QueryBean
>  >
>  > Try
>  >���MyResult = MyService.getNewPlaylist(xmlParser.ClientID)
>  > Catch ex As Exception
>  >���Me.txtHistory.Text += "Error calling playListExists function (" &
>  > ex.Message & ")" + vbCrLf
>  >���Log.AppendLog("Error calling playListExists function (" &  
> ex.Message
>  > & ")")
>  > End Try
>  > --------------------------------------------
>  >
>  > Now the getPlaylist.cfc works fine from the Flash Remoting  
> application
>  > that was built for this client, but when trying to get the query  
> into
>  > VB.NET, the following error is returned
>  > --------------------------------------------
>  > org.apache.axis.AxisFault : ; nested exception is:
>  > coldfusion.xml.rpc.CFCInvocationException:
>  > [coldfusion.runtime.UDFMethod$InvalidReturnTypeException : The value
>  > returned from function getNewPlaylist() is not of type query.][];  
> nested
>  > exception is:
>  > coldfusion.xml.rpc.CFCInvocationException:  
> [org.apache.axis.AxisFault :
>  > ; nested exception is:
>  > coldfusion.xml.rpc.CFCInvocationException:
>  > [coldfusion.runtime.UDFMethod$InvalidReturnTypeException : The value
>  > returned from function getNewPlaylist() is not of type query.][])
>  > --------------------------------------------
>  >
>  > It does return a query (or QueryBean as XML sees it) and everything  
> is
>  > types correctly in the .NET code.��I also put in a test function  
> that
>  > just returned some dummy text to see if I was able to properly  
> invoke
>  > functions of a CFC web method and it worked fine.��Just seems to be
>  > choking on sending back a query.
>  >
>  > I know this is a convoluted question, so if anyone has had  
> experience
>  > using CFC methods in .NET, I'd appreciate any help.
>  >
>  > Steven Brownlee
>  > [EMAIL PROTECTED]
>  >��_____
>  >
>  >
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to