2012-04-30 3 views
0

비누 webservice에서이 링크를 클릭하면 'soapody'의 끝 태그와 일치하지 않는 'soap : Envelope'시작 태그가 나타납니다.비누 요청이이 데이터를 반환합니다

http://74.54.137.138:3052/Service.asmx?op=GetFlightDetailforSQAR

2시 10분 PMrecevedstring ---> soaperverServer는 요청을 처리 할 수 ​​없습니다. --- >

1 행의 'soap : Envelope'시작 태그가 'soapody'의 끝 태그와 일치하지 않습니다. 1 호선, 위치 (343)

답변

0

하면 코드이 코드를 바꿉니다 :

- (무효) createconnection {

NSAutoreleasePool *pool = [NSAutoreleasePool new]; 

    NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>" 
        "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" 
        "<soap:Body>" 
        "<GetFlightDetailforSQAR xmlns=\"http://tempuri.org/\">" 
        "<FlightNo>100</FlightNo>" 
        "<UserBadgeNo>500</UserBadgeNo>" 
        "</GetFlightDetailforSQAR>" 
        "</soap:Body>" 
        "</soap:Envelope>"]; 

    NSURL *url = [NSURL URLWithString: @"http://74.54.137.138:3052/Service.asmx?op=GetFlightDetailforSQAR"]; 

    NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; 

    NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMsg length]]; 
    [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; 
    [req addValue:@"http://tempuri.org/GetFlightDetailforSQAR" forHTTPHeaderField:@"SOAPAction"]; 
    [req addValue:msgLength forHTTPHeaderField:@"Content-Length"]; 
    [req setHTTPMethod:@"POST"]; 
    [req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]]; 

    conn = [[NSURLConnection alloc] initWithRequest:req delegate:self]; 
    if (conn) { 
    webData = [[NSMutableData data] retain]; 
    } 
     [pool release]; 
} 
  • (무효) parserDidStartDocument : (NSXMLParser *) 파서 {

    NSLog (@ "found" ile 및 시작 구문 분석 ");

}

  • (공극) 파서 (NSXMLParser *) 파서 didStartElement (는 NSString *)가 elementName 이름 공간 URI은 (는 NSString *) 이름 공간 URI qualifiedName가은 (는 NSString *)는 QNAME 특성 (는 NSDictionary를 *) attributeDict

{

는 NSLog (@ "ELEMENT를 시작 %의 @ '가 elementName)를;

}

  • (공극) 파서 (NSXMLParser *) 파서 foundCharacters (는 NSString *) 문자열

{

NSLog(@"String %@",string); 

}

  • (void) 구문 분석기 : (NSXMLParser *) 구문 분석기 않았다 하는 endElement (는 NSString *)가 elementName 이름 공간 URI (는 NSString *) 이름 공간 URI qualifiedName가 (는 NSString *)는

을 {QNAME

NSLog ("END 소자 %의 @"@가 elementName);

}

관련 문제