0

I have a static array like.Here it is static array.I want to load from web service. e.g

 - (void)viewDidLoad
 {
   [super viewDidLoad];

      tableData = [NSArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto",
             @"Pig spit-roast", @"goat", @"beefed up beef", @"squidles",
             @"whale", @"crabbies", @"quack", @"Instant Noodle with Egg",
             @"Noodle with BBQ Pork", @"Japanese Noodle with Pork",
             @"Green Tea", @"Thai Shrimp Cake", @"Angry Birds Cake",
             @"Ham and Cheese Panini", nil];

         }

I want to load all food from service like that

     NSString *soapMessage =[NSString stringWithFormat:

      @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
 "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"    
      xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"   
      xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap:Body>"
"<List xmlns=\"http://tempuri.org/\">"
"<Foods></Foods>"

"</List>"
 "</soap:Body>"
"</soap:Envelope>"                            
];  
7
  • There are two issues here. Parsing the soap response and converting XML into an array of items. Are you good with parsing the soap? Commented May 30, 2013 at 13:16
  • Yes I can parsing.Only I dont know load an array from web service Commented May 30, 2013 at 13:17
  • Do you want to use a third-party XML parser or Apple's XML parser? Commented May 30, 2013 at 13:20
  • tableData = [NSArray arrayWith what for load from web service ? I dont know this. Commented May 30, 2013 at 13:20
  • @bbarnhart I used xml parser for my project.But you don't understand me :) I said I dont know How I load an array from service. (e.g) tableData = [NSArray arrayWith ?????? ]; Commented May 30, 2013 at 13:22

1 Answer 1

2

Use this XML parsing library : TBXML

and then follow this stepwise tutorial for parsing : xml-parsing-using-tbxml

Hope it helps you.

Sign up to request clarification or add additional context in comments.

2 Comments

You can parse this using TBXML. I have parsed SOAP using TBXML many times.
My problem is : I know load any labels,textfields from soap,I know soap parse but I dont know load an array from same soap service :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.