Iphone soap请求正在返回此数据

Iphone soap请求正在返回此数据,iphone,soap,Iphone,Soap,当我在soap webservice中点击此链接时,第1行的“soap:Envelope”开始标记的响应与“soapody”的结束标记不匹配 2:10 pmReceevedString-->SOAPServerServer无法处理请求。--> 第1行的“soap:Envelope”开始标记与“soapody”的结束标记不匹配。第1行,位置343。将此代码替换为您的代码: -无效创建连接 { } voidparser:NSXMLParser*parser-didEndElement:NSStrin

当我在soap webservice中点击此链接时,第1行的“soap:Envelope”开始标记的响应与“soapody”的结束标记不匹配

2:10 pmReceevedString-->SOAPServerServer无法处理请求。-->


第1行的“soap:Envelope”开始标记与“soapody”的结束标记不匹配。第1行,位置343。

将此代码替换为您的代码:

-无效创建连接 {

}

voidparser:NSXMLParser*parser-didEndElement:NSString*元素名称namespaceURI:NSString*namespaceURI-qualifiedName:NSString*qName {

NSLog@END元素:%@,元素名称

}

   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];
}   
NSLog(@"String %@",string);