xcode - Call a web service with MKNetworkoperation -
in our development team have implemented web service authenticate client. iphone application need send client's information web service , in order so, have written following function.
-(void)authenticateclient:(nsstring*)thecontractnumber clientcode:(nsstring*)theclientcode cellphone:(nsstring*)thecellphone appleid:(nsstring*)theappleid { nslog(@"begin send information web service",nil); nsstring *uid = [uidevice currentdevice].uniqueidentifier; nsdictionary *formparams = [nsdictionary dictionarywithobjectsandkeys: theclientcode, @"clientcode", thecontractnumber, @"contractcode", theappleid, @"appleid", @" ", @"androidid", @" ", @"windowsid", uid, @"appledeviceid", @" ", @"androiddeviceid", @" ", @"windowsdeviceid", thecellphone, @"telephonenumber" , nil]; mknetworkoperation *operation = [self.engine operationwithpath:@"/services/authentication.ashx" params: formparams httpmethod:@"post"]; [operation addcompletionhandler: ^(mknetworkoperation *operation) { nslog(@"%@", [operation responsestring]); } errorhandler:^(mknetworkoperation *erroroperation, nserror *error) { nslog(@"%@", error); }]; [self.engine enqueueoperation:operation] ; }
the function works (or seems works no errors) in fact not anything. passes [operation addcompletionhandler: block not anything. have executed step step , again saw application reaches line , executes , directly goes [self.engine enqueueoperation:operation] line without going inside code block.
does can on this?
thank you.
Comments
Post a Comment