【发布时间】:2009-08-07 10:56:19
【问题描述】:
看看这段代码 sn-p:-
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[webData setLength: 0];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
NSLog(@"Recieving Data...");
[webData appendData:data];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(@"ERROR with theConenction");
[connection release];
[webData release];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"DONE. Received Bytes: %d", [webData length]);
NSLog(theXML);
}
我正在调用 SOAP Web 服务。我的代码中没有显示错误或警告。
当我通过 safari 访问网络服务时,它工作正常。但是当我尝试时出现问题
通过我的代码点击它。
一切正常,但 connection:didRecieveData 没有被调用。
因此,webData 变量中没有数据。这个webData 是一个NSMutableData 对象。
这个问题似乎很愚蠢,但任何有答案的人....
谢谢大家。
【问题讨论】:
标签: iphone web-services iphone-sdk-3.0 soap