Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-03-2008, 12:02 PM   #32 (permalink)
nait
New Member
 
Join Date: Sep 2008
Posts: 3
Default

Quote:
Originally Posted by gagandeepb View Post
Hi Guys,
What if my request xml is too long. Suppose i have 5000 records in a local table and that i want to send to server. Definitely i will not create Soap request like that as mentioned in above posts. What i will prefer is keeping all data in NSData object setting it as a setHTTPBody and then using POST send it to aspx page at server side. Then save whole xml locally over there and then read it in dataset that's all.
Sounds like you answered your own question. Create a serialization class that knows what each of the records looks like that will create an NSString containing the xml that holds the data from your NSData object. You can the append that into the appropriate part of the envelope body and call the service that way.

Pseudo Code:
Code:
public class MyDataSerialization
{
 /* maybe static, depends on you */
    public string TurnDataToXml(NSData theData)
    {
      /* maybe static, depends on you */
        foreach (dataUnit in theData)
        {
            //create the appropriate xml nodes in a string you are returning
        }
    return myStringOfXmlNodes;
    }
}
I haven't looked at it yet, but another idea is to use the NSXml object to create your entire envelope programmatically. This is probably the better option as it is specific to what we are trying to do. Using the static strings above is just a simple way to show what we are all trying to accomplish. You can abstract the hell out of what's up there and make it as complex as you like.

Here's some more info about the NSXml object.

Here's the wiki article about serialization. It even has an Objective-C sample (though it looks like they are talking about binary serialization as opposed to xml).
nait is offline   Reply With Quote
 

» Advertisements
» Online Users: 269
14 members and 255 guests
ADY, BdR, BrianSlick, dacapo, Joseph Nardone, laurielaptop, M@realobjects, oztemel, poisenden, rob.mccarthy, Sunny46, TheWebWizz, VikMyr, XRumerTest
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,701
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:41 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.