Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dwm

macrumors newbie
Original poster
Jul 19, 2007
13
0
I would like users of an iPhone app to be able to create text/string content (e.g. recipes, business cards, quotes, etc.) and upload it to a website. This content will reside and be persistent on the iPhone in a database (or something) but the idea would be to share and exchange the content with other iPhone users in a website. Ideally, the content would move back and forth as an XML document.

Downloading an XML document with the iPhone seems straightforward (a HTTP request that returns an XML document and then parsing that document) but I am at a loss on how I can send/upload an XML document to a server from an iPhone.

Any hints on how to do this?

I suppose, I could put together an XML document, wrap it in SOAP (or not), and send it to a web service as a parameter, but I'm hoping there is a much simpler way.
 

ghayenga

macrumors regular
Jun 18, 2008
190
0
I would like users of an iPhone app to be able to create text/string content (e.g. recipes, business cards, quotes, etc.) and upload it to a website. This content will reside and be persistent on the iPhone in a database (or something) but the idea would be to share and exchange the content with other iPhone users in a website. Ideally, the content would move back and forth as an XML document.

Downloading an XML document with the iPhone seems straightforward (a HTTP request that returns an XML document and then parsing that document) but I am at a loss on how I can send/upload an XML document to a server from an iPhone.

Any hints on how to do this?

I suppose, I could put together an XML document, wrap it in SOAP (or not), and send it to a web service as a parameter, but I'm hoping there is a much simpler way.

Well, if you control the website you can simply do an HTTP Post and send any string you want and have your webserver/CGI process it, XML or key value pairs or whatever. SOAP is only for sites that want to give you an interactive public protocol that anyone can access.
 

dwm

macrumors newbie
Original poster
Jul 19, 2007
13
0
Yes, I control the server, but I understand there is a 2K limit on POSTs. Since XML elements themselves take up so many characters, I'm afraid that more detailed content could not be uploaded/posted.
 

firewood

macrumors G3
Jul 29, 2003
8,141
1,384
Silicon Valley
Yes, I control the server, but I understand there is a 2K limit on POSTs. Since XML elements themselves take up so many characters, I'm afraid that more detailed content could not be uploaded/posted.

If you control the server, then you could send up multiple fragments, and have the server agent reassemble, check and forward the completed result to the processing agent.
 

dwm

macrumors newbie
Original poster
Jul 19, 2007
13
0
If you control the server, then you could send up multiple fragments, and have the server agent reassemble, check and forward the completed result to the processing agent.

Whoa, just went over my programming competence ;) (but a good thought)
 

matthew858

macrumors member
Apr 15, 2008
97
0
Sydney, Australia
Well, if you control the website you can simply do an HTTP Post and send any string you want and have your webserver/CGI process it, XML or key value pairs or whatever. SOAP is only for sites that want to give you an interactive public protocol that anyone can access.

Sorry to bump this thread, but what do you mean by an HTTP post? I am currently investigating ways to get data off the iPhone (a 30-40 character string) off the iPhone and save it to my web server, but since I'm new to iPhone programming, I'm not sure how to go about it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.