how to send objecs from an iPhone app to a server app using XML?


how to send objecs from an iPhone app to a server app using XML?



I'm building an application in the iPhone where the communication with a PHP server is needed (using XML).

I'm able to receive data from the server and I handle the xml file using the NSXML parser.

I haven't found too much documentation about sending data from the iPhone to the server (via XML).

Any idea, links, and examples will be appreciated.

regards Alejandra




Fade in/out UIScrollView's content like Mobile Safari does in its tab

1:



warning: declaration does not declare anything
I am currently using XML-RPC to talk to a server from the iPhone.


How to Base64 encoding on the iPhone
There seems to be two implementations to choose from..
UIWebView slow loading images--disturbs scrolling to anchors
The most popular seems to be from the WordPress for iPhone app, but be aware that this is GPL licensed:.
iPhone / .NET WCF Interoperability
http://iphone.trac.wordpress.org/browser/trunk/Classes/XMLRPC.
UIScrollView
I myself am using this code, which is MIT licensed:.
How can I decode data with Base64 in IPhone
http://github.com/eczarny/xmlrpc/tree/master.
iphone mail won't display javascript in attached html files?


2:


A quick and dirty synchronous REST implementation would look something like this:.
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:@"http://yourserver.com/script"]; [request setHTTPMethod:@"POST"]; const char *bytes = [[NSString stringWithFormat:@"<?xml version=\"1.0\">\n<yourxml>%@</yourxml>", yourData] UTF8String]; [request setBody:[NSData dataWithBytes:bytes length:strlen(bytes)]]; NSURLResponse *response; NSError *err; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err]; 
It takes a few more steps to send this POST asynchronously.

You can read about this in the docs for NSURLConnection and the URL Loading System..


3:


it depends on the magnitude of your data.

but if it simple data, I think you can use REST to post or put data to the server.

http://en.wikipedia.org/wiki/Representational%5FState%5FTransfer.



66 out of 100 based on 41 user ratings 1016 reviews