nesium / cocoa-amf Goto Github PK
View Code? Open in Web Editor NEWObjective-C implementation of the Flash Remoting format (AMF0/AMF3) for servers and clients.
License: Other
Objective-C implementation of the Flash Remoting format (AMF0/AMF3) for servers and clients.
License: Other
This is a great library, it works perfectly. The issue i'm having is that there seems to be no way to set, or specify a time limit for a network/DB call to return. I need a way to stop a call that does not return at all.
This is a great library that I am using to make a iPhone version of my flex application.
I have this problem that I can't figure out how to solve. It's when I try to send anything that contains scandinavian characters (Å Ä Ö for example) the application crashes.
The error I get is like this:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: mod_name)'
The value for mod_name is 'Timepört' if I change it to 'Timeport' everything is fine. but it looks like the value is nil for some reason.
Also if I utf8_encode() the variable on server-side in my php function it works. But thats nothing I would like to do in all functions I built and loop all arrays and so on. My database is encoded in UTF-8 and Im using the SabreAMF framework.
Thanks!
regard,
Johan Axlesson
if ([[value className] isEqualToString:@"NSCFBoolean"])
==> if ([[value className] isEqualToString:@"__NSCFBoolean"])
Your code has been extremely helpful and is implemented really well, however we had to customize it a bit to handle status errors differently and thought you should know.
Inside AMFRemotingCall connectionDidFinish is the following line of code
AMFActionMessage *message = [[AMFActionMessage alloc] initWithData:m_receivedData];
AMFMessageBody *body = [message.bodies objectAtIndex:0];
objc_msgSend(m_delegate, @selector(remotingCallDidFinishLoading:receivedObject:), self, data);
[message release];
This code indiscriminately returns the user whatever the body of the message is without providing the context of the message. A body can either be an onResult or onStatus message, both of these messages will be fully encoded amf packets, but on onStatus usually means that an exception has been encoded as the body instead of the usual expected result. this was the solution we used, but you may have a better thought on how to accomplish it.
AMFActionMessage *message = [[AMFActionMessage alloc] initWithData:m_receivedData];
AMFMessageBody *body = [message.bodies objectAtIndex:0];
NSObject *data = [[message.bodies objectAtIndex:0] data];
NSRange range = [body.targetURI rangeOfString:@"onStatus"];
if (range.location != NSNotFound) {
objc_msgSend(m_delegate, @selector(remotingCallOnStatus:receivedObject:), self, data);
}else {
objc_msgSend(m_delegate, @selector(remotingCallOnResult:receivedObject:), self, data);
}
[message release];
Sean
I had a hard time trying to figure out how to make this library work with the new MemoryManagement in iOS, since none of the used "autorelease", "release", etc... is supported anymore. It looks like the whole app has to be without auto reference counting in order to work at all.
Would be nice to have the updated version. Im an Objective-C noob, so I would rather dont do this myself :)
Thanks for the help!
NSData objects are not added in the objectTable, causing errors when deserializing NSData. Here is a patch :
--- nesium-cocoa-amf-ef2ab9e/CocoaAMF/AMFUnarchiver.m 2011-10-31 02:58:42.000000000 +0100
+++ nesium-cocoa-amf-ef2ab9e-fixbug/CocoaAMF/AMFUnarchiver.m 2011-11-24 15:15:08.000000000 +0100
@@ -958,6 +958,7 @@
}
uint32_t length = (ref >> 1);
NSData *data = [self decodeBytes:length];
Per the spec at the bottom of page 11. http://opensource.adobe.com/wiki/download/attachments/1114283/amf3_spec_05_05_08.pdf
It should be encoding the BinaryArray type marker 0xC then U29 with the length encoded then left shifted by 1. What is really happening is it is encoding 0x4 (int) with 0xC (byte array marker), and then 0x4 (int) and then U29 length <<1. for my test case i was encoding a 32 byte NSData object.
it ended up looking like this 0x04 0x0C 0x04 0x41 (... data ...)
what it should be is 0x0C 0x41 (... data ...)
Thanks
I can't get it to build with the 10.6 sdk using xcode 4. Anyone get it to work using that combination?
Try connecting to a BlazeDS back end configured with Spring which works fine in Flex but cocoa-amf reports No destination with id 'destination name' exists.
The other issue is there is no way to authenticate on a BlazeDS server that has been configured to use channelset authentication, is the only other work around to create a standard method for handling authentication?
Hi all,
I integrate simple AMF call with ios app and it return me proper object (ASObject) but when i try to add AMF client with my code it creates lots of errors. i am totally new bee for AMFRemocall so i request you to please help that how can i integrate AMFClient properly. i appreciate your help in advance.
thanks and regards
bimal dave
I have provided the sample code below. Any suggestions would be much appreciated.
{
code = "Server.Processing";
details = ;
message = "No destination with id 'ExampleService' is registered with any service.";
rootCause = ;
}
m_remotingCall.URL = [NSURL URLWithString:@"http://mydomain.com/flex2gateway"];
m_remotingCall.service = @"ExampleService";
<cffunction name="hello" access="remote" returntype="string">
<cfreturn "hello world!">
</cffunction>
<cffunction name="returnArray" access="remote" returntype="array">
<cfset var ar = ['1','2','3','apple','pears','oranges'] />
<cfreturn ar>
</cffunction>
<cffunction name="returnFloat" access="remote" returntype="numeric">
<cfset var float = 1.23456789 />
<cfreturn float>
</cffunction>
I've converted my iPhone project which uses CocoaAMF very nicely from a Facebook Flash App, but tried to build an iPad version of it and got a compile error.
".objc_class_name_AMFUnarchiver", referenced from:
literal-pointer@__OBJC@__cls_refs@AMFUnarchiver in EAGLView.o
".objc_class_name_AMFArchiver", referenced from:
literal-pointer@__OBJC@__cls_refs@AMFArchiver in EAGLView.o
".objc_class_name_AMFRemotingCall", referenced from:
literal-pointer@__OBJC@__cls_refs@AMFRemotingCall in EAGLView.o
Thanks
Any help would be great so I could get both versions out this month.
Phil
Looking through the examples I didn't see a way to make a Remote Call where the RemoteClass needed to be specified. In the .net AMF calls there is a way to specify the remote class. Any hints?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.