Iphone 如何使用touchxml从WSDL文件获取数据
我使用TouchXML解析WSDL文件,我是一个新手,有一个类似这样的NSStringIphone 如何使用touchxml从WSDL文件获取数据,iphone,objective-c,ios,Iphone,Objective C,Ios,我使用TouchXML解析WSDL文件,我是一个新手,有一个类似这样的NSString NSString*str=@“9E0B34E6DFF7BF89” 如何在“ns:out”中获取字符串9E0B34E6DFF7BF89试试这个: NSString *str = @"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSch
NSString*str=@“9E0B34E6DFF7BF89”代码>
如何在“ns:out”中获取字符串9E0B34E6DFF7BF89试试这个:
NSString *str = @"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soap:Body><ns1:createSessionResponse xmlns:ns1=\"http://soap.user/\"><ns1:out>9E0B34E6DFF7BF89</ns1:out></ns1:createSessionResponse></soap:Body></soap:Envelope>";
NSRange rr2 = [str rangeOfString:@"<ns1:out>"];
NSRange rr3 = [str rangeOfString:@"</ns1:out>"];
int lengt = rr3.location - rr2.location - rr2.length;
int location = rr2.location + rr2.length;
NSRange aa;
aa.location = location;
aa.length = lengt;
str = [str substringWithRange:aa];
NSLog(@"%@",str); // 9E0B34E6DFF7BF89
NSString*str=@“9E0B34E6DFF7BF89”;
NSRange rr2=[str rangeOfString:@”“;
NSRange rr3=[str rangeOfString:@”“;
int length=rr3.location-rr2.location-rr2.length;
int location=rr2.location+rr2.length;
NSRange-aa;
aa.位置=位置;
aa.长度=长度;
str=[str substringWithRange:aa];
NSLog(@“%@”,str);//9E0B34E6DFF7BF89
ohh…您想使用TouchXML吗?谢谢您,Hector,我找到了另一种直接获取会话值的方法。但是你的回答对我还是有帮助的。