ios SOAP响应不是XML格式

ios SOAP响应不是XML格式,ios,xml,parsing,soap,tbxml,Ios,Xml,Parsing,Soap,Tbxml,我正在开发一个应用程序,其中使用TBXML解析器使用SOAP响应。 但我面临的问题是SOAP响应没有以正确的XML格式出现。 以下是我收到的SOAP响应: <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.or /soap/envelope/"><S:Body><ns2:getNotificationCountResponse xmlns

我正在开发一个应用程序,其中使用TBXML解析器使用SOAP响应。 但我面临的问题是SOAP响应没有以正确的XML格式出现。 以下是我收到的SOAP响应:

 <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.or
 /soap/envelope/"><S:Body><ns2:getNotificationCountResponse xmlns:ns2="http://wfnwebservice.oi.com
 /"><return>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&lt;Results&gt;&lt;Row&gt;&
 lt;MESSAGE_TYPE&gt;REQAPPRV&lt;/MESSAGE_TYPE&gt;&lt;NOTIFICATION_CNT&gt;2&lt;   
 /NOTIFICATION_CNT&gt;&lt;WORKFLOW_NAME&gt;Purchase Requisition&lt;/WORKFLOW_NAME&gt;&lt;
 /Row&gt;&lt;Row&gt;&lt;MESSAGE_TYPE&gt;POAPPRV&lt;/MESSAGE_TYPE&gt;&lt;NOTIFICATION_CNT&gt;4&lt;
 /NOTIFICATION_CNT&gt;&lt;WORKFLOW_NAME&gt;Purchase Order&lt;/WORKFLOW_NAME&gt;&lt;/Row&gt;&lt;
 /Results&gt;</return></ns2:getNotificationCountResponse></S:Body></S:Envelope>
?xml version=“1.0”encoding=“UTF-8”standalone=“否”?结果行&
书信电报;消息类型请求批准/消息类型通知2
/通知\u工作流\u名称请购单/工作流\u名称
/RowRowMESSAGE_typepoapprov/MESSAGE_TYPENOTIFICATION_CNT4
/通知\工作流\名称采购订单/工作流\名称/行
/结果
SOAP请求消息如下所示:

 NSString *soapMsg = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
                     <S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"   
 xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\
                     <SOAP-ENV:Header/>\
                     <S:Body>\
                     <ns2:getNotificationCount xmlns:ns2=\"http://wfnwebservice.oi.com/\">\
                     <arg0>CBAKER</arg0>\
                     </ns2:getNotificationCount>\
                     </S:Body>\
                     </S:Envelope>"];
NSString*soapMsg=[NSString stringWithFormat:@”\
\
\
\
\
克贝克\
\
\
"];

任何人都可以告诉我什么是问题以及我如何解决它吗???

//传递您的url在这里

首先使用NSXml解析器您需要在.h中声明NSXmlParser委托。然后试试这个代码

NSString * urlString = [NSString stringWithFormat:@"http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry?CountryName=%@",CountryName];

NSLog(@"%@",urlString);

NSMutableURLRequest * req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];

NSData * data  = [NSURLConnection sendSynchronousRequest:req returningResponse:nil error:nil];

NSLog(@"%@",data);

xmlResultString = [[NSMutableString alloc]init];

NSLog(@"%@",xmlResultString);

parser = [[NSXMLParser alloc]initWithData:data];
[parser setDelegate:self];
[parser parse];

   // return result;

}

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{

    xmlDictionary=[[NSDictionary alloc]init];

    [xmlResultString appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];

    NSLog(@"%@",xmlResultString);

    xmlDictionary = [XMLReader dictionaryForXMLString:xmlResultString error:nil];

}
-(void)parserDidEndDocument:(NSXMLParser *)parser
{

    NSLog(@"%@",xmlDictionary);

    NSArray * City=[[NSArray alloc]init];

    NSString* city =[[[xmlDictionary valueForKey:@"NewDataSet"] valueForKey:@"Table"] valueForKey:@"City"];

    NSLog(@"%@",city);

    City=[[[xmlDictionary valueForKey:@"NewDataSet"] valueForKey:@"Table"] valueForKey:@"City"];

    NSLog(@"%@",City);
}



-(void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError
{
    result = 0;
    NSLog(@"%@",parseError);

}

感谢您的回复,但我们要求使用TBXML进行解析,使用SOAP消息进行请求。。。所以你能给我一个解决方案吗