2009-06-17 7 views
0

私は現在、XMLを返す1つのget要求で実行している単純なWCFサービスを持っています。http://a446062738bb4f0aa2d8fd975aac602f.cloudapp.net/Service1.svc/GetALLPictures/10 ... [NSString stringWithURL:]を使用して文字列にXMLコンテンツを取り込もうとしていますUnicodeとUTF8エンコーディングを使って文字列を取得しようとしましたが、サーバー上でcrossclient.xmlを設定しましたが、Silverlightアプリケーションで同様の方法でサービスを使用しました。
おかげIPhone resting WCFサービス

答えて

1

はあなたが+stringWithContentsOfURL:を意味する(私もNSURLCOnnectionとNSURLRequestを使用して上記のすべてを試してみましたか)?それは、この戻っています

NSString *xml = [NSString stringWithContentsOfURL: 
    [NSURL URLWithString: 
@"http://a446062738bb4f0aa2d8fd975aac602f.cloudapp.net/Service1.svc/GetALLPictures/10"]]; 

:私はこれでトラブルを見ていないよあなたがバックグラウンドスレッドでこれをやっている場合を除きあなたはNSURLConnectionを使用したいと思う

<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> 

を、それは罰金です。

+0

ええと...私はデバッガを介して文字列を見ようとしていましたが、無効であると言っていましたが、うまくいきます...ありがとう –