Copy link to clipboard
Copied
I am looking to use mosync to develop for mobile rather than air. Is there a way to Connecting to cfcs via non flash platforms, ie not usiong the flashservices gateway?
Yup.
Have a look at <cfajaxproxy>
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79f9.html
--
Adam
Copy link to clipboard
Copied
Yup.
Have a look at <cfajaxproxy>
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79f9.html
--
Adam
Copy link to clipboard
Copied
I don't think that CFAJAXPROXY will be useful to the poster directly, as he won't be writing a CF-based client?
But in any case, Adam's answer gets the gist of what you need. You can expose CFCs directly as web services using SOAP or JSON.
Dave Watts, CTO, Fig Leaf Software
Copy link to clipboard
Copied
Sorry Dave, yeah you're right. I am extremely hungover today, so was not focusing on my answer. What I was kinda driving at (but in no way said) was to check what JS <cfajaxproxy> creates, and emulate that sort of approach.
--
Adam
Copy link to clipboard
Copied
No need to apologize - 90% there is still most of the way!
Dave Watts, CTO, Fig Leaf Software
Copy link to clipboard
Copied
I actually just want to connect from android from the iphone so I guess I dont need the proxy?
Copy link to clipboard
Copied
No, no proxy is needed. Just make sure your CFCs are accessible through the web server, then use the URLs of those CFCs as SOAP or JSON services in your application.
Dave Watts, CTO, Fig Leaf Software
Copy link to clipboard
Copied
use the URLs of those CFCs as SOAP or JSON services in your application
So I can't use remote objects like this in my iphone app? Im finding it tricky cause in the past all my apps have resided in the same server as cf is running
<mx:RemoteObject id="myService"
destination="ColdFusion"
showBusyCursor="true"
source="flex.TravelMoney.Service">
<mx:method name="getAllData"
result="handleGetAllData(event)"/>
<mx:fault>
<![CDATA[
var am:AlertMsg = new AlertMsg();
am.open(this, false);
am.lb.text = "Service error debug: \n\n" + event.fault.message;
]]>
</mx:fault>
</mx:RemoteObject>
Copy link to clipboard
Copied
You can't use MXML in your iPhone app, unless you're writing your iPhone app with Flex. You'd have to use your CFCs in whatever way your development environment lets you - as SOAP or JSON services.
Dave Watts, CTO, Fig Leaf Software
Copy link to clipboard
Copied
Yeah it's a flex app. I want to use remote object cause that's how I use CFCs in the past
Copy link to clipboard
Copied
If you're writing a Flex app, you should be able to use RemoteObject.
Dave Watts, CTO, Fig Leaf Software
Copy link to clipboard
Copied
Cool, Im trying to duplicate the my-cfamf in the services-config file with as:
channel = new AMFChannel; | ||
channel.endpoint = 'http://www.mysite.com/flex2gateway/'; |
do I need any of the other stuff like the coldfusion element use-mappings?
<!-- CF Based Endpoints -->
<channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/" class="coldfusion.flash.messaging.CFAMFEndPoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<enable-small-messages>false</enable-small-messages>
</serialization>
<coldfusion>
<!-- define the resolution rules and access level of the cfc being invoked -->
<access>
<!-- Use the ColdFusion mappings to find CFCs-->
<use-mappings>true</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<method-access-level>remote</method-access-level>
</access>
<!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
<use-accessors>true</use-accessors>
<!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
<use-structs>false</use-structs>
<property-case>
<!-- cfc property names -->
<force-cfc-lowercase>false</force-cfc-lowercase>
<!-- Query column names -->
<force-query-lowercase>false</force-query-lowercase>
<!-- struct keys -->
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</coldfusion>
</properties>
</channel-definition>
Copy link to clipboard
Copied
Yeah, your CFCs need to have all of the CF-specific information. I'm not sure why you're creating a new channel, though - you can just use that one. Typically, the only reason I create new channels is if I want features not available in the default channels - for example, if I wanted to use HTTPS instead of HTTP.
Dave Watts, CTO, Fig Leaf Software