webserviceManager isminde bir classın olsun
[code]
-(void)KurulumIDTuret:(id)view endMethod:(SEL)_endMethod dName:(NSString *)_domainName error:(SEL)_error
{
NSString *soapAddress = [NSString stringWithFormat:@"%@?wsdl",WebAdres];
NSURL *baseURL = [NSURL URLWithString:soapAddress];
NSString *soapBody = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><GetKurulumId xmlns=\"http://tempuri.org/\"><domainName>%@</domainName></GetKurulumId></soap:Body></soap:Envelope>",_domainName];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:baseURL];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[soapBody dataUsingEncoding:NSUTF8StringEncoding]];
[request addValue:@"http://tempuri.org/GetKurulumId" forHTTPHeaderField:@"SOAPAction"];
[request addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
//NSString *string = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
SEL mySelector = _endMethod;
[view performSelector:mySelector withObject:responseObject];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
SEL myError = _error;
[view performSelector:myError withObject:error];
}];
[operation start];
}
[/code]
bu kod içerisinde yer alsın çağırmak istediğin view controllerdada bu şekilde cagir
[code]
webServisManager *wsManager = [[webServisManager alloc]init];
[wsManager KurulumIDTuret:self endMethod:@selector(endMethodKurulumID:) dName:domainName error:@selector(errorKurulum:)];
[/code]
kodu bu şekilde yazdığında artık sorgunun bittiği zaman ve errore düştüğü zamanki metotları yakalamış oldun.
[code]
-(IBAction)endMethodKurulumID:(id)response
{
JsonManager *jsManager = [[JsonManager alloc]init];
NSMutableArray *arrDe = [jsManager GetKurulumId:response];
kurulumID = [[arrDe objectAtIndex:0]KurulumID];
}
[/code]
[code]
-(IBAction)errorKurulum:(id)response
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:myAppName message:appServiceError delegate:self cancelButtonTitle:@"Tamam" otherButtonTitles:nil, nil];
[alert show];
}
[/code]
takıldığın yer olursa tekrar sorarsın. İyi çalışmalar.