Possible Duplicate:
How to access SOAP serv开发者_如何学Pythonices from iPhone
In my application . I want to send a array to web service
i use this method to parse in soap with different parameters
NSString *soapMessage = [NSString stringWithFormat:@"" "" "" "" "%@" "%@" "" "" "",[clientRefString valueForKey:@"Type"],[clientRefString valueForKey:@"feeEarner"]]; //NSLog(@"soapMessage : %@",soapMessage);
//NSString *body = [[NSString alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"GetSearchMatter" ofType:@"txt"],@"OMI",@"SPA005"];
////NSLog(@"%@",body);
NSURL *serviceURL = [[NSURL alloc] initWithString:@"http://82.110.35.93/oneoffice.asmx?op=SearchCosts"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:serviceURL];
[request setHTTPMethod:@"POST"];
[request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *dataStr = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
[dataStr release];
[serviceURL release];
[request release];
//[body release];
if(xmlParser)
{
[xmlParser release];
xmlParser = nil;
}
xmlParser = [[NSXMLParser alloc] initWithData:data];
[xmlParser setDelegate:self];
[xmlParser parse];
精彩评论