我想要異步執行我的SOAP的Web服務,因爲我得到了在獲取數據,同時呼籲synchronously.Also我能得到調用時,多個Web服務被稱爲在一個單一的Web服務時產生一定的滯後性(圖做負載)或在(查看會出現)我無法獲得的數據。如何調用異步SOAP Web服務?
誰能告訴如何調用一個異步SOAP web服務:這是我的代碼
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
vaibby坦克我會嘗試。 – Arun
哪一個你想要? – vaibby