我从iOS代码中调用此when服务,但是当我在iOS代码中从相同的请求调用时,它没有给我响应。收到的致命错误或响应字节0如下所示。
当我从iOS代码发布时,我会检查服务器,但原因是我的请求无法在服务器上成功到达。
有没有人知道为什么我的请求不能到达服务器??
发布于 2013-11-14 07:32:47
-(IBAction)FindWords:(Id)发送方{ NSString *sSOAPMessage = @"service@wakanow.compasswordDubai CityUnited阿联酋15-12-201318-12-2013115NGN";NSLog(@"SOAP消息:%@",sSOAPMessage);sSOAPMessage = (NSString *) sSOAPMessage (CFStringRef)sSOAPMessage mutableCopy,NULL,CFSTR(",!$'()*+;?\n\"<>#\t ://“),);stringWithFormat:@"http://betahwcf.wakanow.com/SVCServices/WakanowHotelService.svc/HotelSearch=%@",* NSString = NSString self;NSURL *sRequestURL = NSURL URLWithString:strRequest;NSLog(@"NSURL:%@",sRequestURL);NSMutableURLRequest * NSMutableURLRequest strRequest= NSURLConnection requestWithURL:sRequestURL;NSURLConnection *theConnection = [NSURLConnection alloc :theRequest:self];if(theConnection) { self.conWebData = NSMutableData data;} else {NSLog(@“连接出错”);}} -(void)connection:(NSURLConnection*)connection错误:(NSURLResponse*)response { self.conWebData setLength:0;} -(void)connection:(NSURLConnection*)connection self.conWebData:(NSData*)data{didFailWithError appendData:data;} -(void)connection:(NSURLConnection*)connection didReceiveData:(NSError*) error {NSLog(@“theConenction出错”);} -(void)connectionDidFinishLoading:(NSURLConnection*)connection {NSLog(@“完成。接收字节数:%d",self.conWebData长度);NSString*theXML = [NSString alloc initWithBytes:self.conWebData mutableBytes length:self.conWebData length encoding:NSUTF8StringEncoding];//检查响应格式是否正确//打印响应解析(@“%@”,theXML);xmlParser= [NSXMLParser allocinitWithData:self.conWebData];xmlParser setDelegate:self;xmlParser setShouldResolveExternalEntities:YES;xmlParser parse;}
https://stackoverflow.com/questions/19931513
复制