Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何使用touchxml从WSDL文件获取数据_Iphone_Objective C_Ios - Fatal编程技术网

Iphone 如何使用touchxml从WSDL文件获取数据

Iphone 如何使用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

我使用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/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,我找到了另一种直接获取会话值的方法。但是你的回答对我还是有帮助的。