Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何将soap数组作为参数发送到web服务目标C_Iphone_Service - Fatal编程技术网

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