2010-12-06 71 views

回答

0

我用這個方法在肥皂解析使用不同的參數

的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

在我的應用程序中,我使用從sudzc.com生成的代碼,在這裏需要傳遞一個數組到web service.But我無法傳遞數組 – 2010-12-06 10:35:28