【发布时间】:2016-05-27 07:13:23
【问题描述】:
我想异步执行我的 SOAP Web 服务,因为我在同步调用时获取数据有些滞后。此外,当调用多个 Web 服务时,我能够在调用单个 Web 服务时获得结果(视图确实加载)或在(将出现视图)我无法获取数据。
谁能告诉我如何调用异步 SOAP webService:这是我的代码
cws = [[CustomWebService alloc]init];
NSString *soapMessage = [NSString stringWithFormat:@"my soap string"];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(msgCount) name:@"my response name" object:nil];
NSDictionary *Details=[[NSDictionary alloc]initWithObjectsAndKeys:nil];
[cws getSoapAction:@".........." andNameSpace:@"" andDetails:Details andUrlIs:[AppDelegate URLSource] andSoapMessage:soapMessage ];
[cws getPageName:@"my response name"];
NSLog(@"SOAP MESSAGE IS %@",soapMessage);
我在这里得到了回复:
-(void)msgCount
{
[[NSNotificationCenter defaultCenter]removeObserver:self];
NSMutableDictionary *diict=[[NSMutableDictionary alloc]initWithDictionary:[cws msgCount]];
NSLog(@"the response is %@",diict);
}
【问题讨论】:
-
你可以使用 afnetwork 或 asihttp 或 nsurlrequest
-
vaibby Tanks 我会试试的。
-
你要试试哪一个?
-
我很复杂是他们解决这个问题的任何简单聪明的方法。
-
尝试使用 nsurlrequest 作为启动器
标签: ios objective-c ios7 ios8 ios9