开发者

How to send a soap array as a parameter to a web service objective C [duplicate]

开发者 https://www.devze.com 2023-01-28 20:33 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: How to access SOAP serv开发者_如何学Pythonices from iPhone
This question already has answers here: Closed 12 years ago.

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];  
0

精彩评论

暂无评论...
验证码 换一张
取 消