Iphone 如何将soap数组作为参数发送到web服务目标C
可能重复:Iphone 如何将soap数组作为参数发送到web服务目标C,iphone,service,Iphone,Service,可能重复: 在我的申请中。我想向web服务发送一个数组我使用此方法在soap中使用不同的参数进行解析 NSString*soapMessage=[NSString stringWithFormat:@] "" "" "" "%@" "%@" "" "" “,[clientRefString valueForKey:@“Type”],[clientRefString valueForKey:@“feeerner”]; //NSLog(@“soapMessage:%@”,soapMessage)
在我的申请中。我想向web服务发送一个数组我使用此方法在soap中使用不同的参数进行解析 NSString*soapMessage=[NSString stringWithFormat:@] "" "" "" "%@" "%@" "" "" “,[clientRefString valueForKey:@“Type”],[clientRefString valueForKey:@“feeerner”]; //NSLog(@“soapMessage:%@”,soapMessage)
在我的应用程序中,我使用从sudzc.com生成的代码,这里需要将数组传递给web服务。但我无法传递数组
//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];