Hello
I currently have a simple WCF service running with one get request which returns XML, http://a446062738bb4f0aa2d8fd975aac602f.cloudapp.net/Service1.svc/GetALLPictures/10... Im trying to use [NSString stringWithURL:] to populate the string with the XML content, however this is not working, ive tried using Unicode and UTF8 encoding to get the string and nothing, I have set the crossclient.xml on the server and i have consumed the service in a similar way in a silverlight application. (I have also tried all of the above using NSURLCOnnection and a NSURLRequest)
Thanks
views:
786answers:
1
+1
A:
You mean +stringWithContentsOfURL:
? I'm not seeing any trouble with this:
NSString *xml = [NSString stringWithContentsOfURL:
[NSURL URLWithString:
@"http://a446062738bb4f0aa2d8fd975aac602f.cloudapp.net/Service1.svc/GetALLPictures/10"]];
It's returning this:
<GetAllPicturesResponse xmlns="http://tempuri.org/">
<GetAllPicturesResult
xmlns:a="http://schemas.datacontract.org/2004/07/TestCloudService_WebRole"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Coordinate><a:latitude>0</a:latitude><a:longitude>0</a:longitude>
</a:Coordinate><a:Coordinate><a:latitude>-50</a:latitude>
<a:longitude>-80</a:longitude></a:Coordinate></GetAllPicturesResult>
</GetAllPicturesResponse>
You'll want to use NSURLConnection
unless you're doing this on a background thread, but it seems fine.
Rob Napier
2009-06-17 02:06:38
yeah...i was trying to look at the string through the debugger and it was saying invalid, but it works...thanks
2009-06-17 03:12:37