私は価値を得るためにWebサービスを使っています。私は値をWebサービスurl.thereに渡しています。xml
タグを含むパラメータがあります。この文字列を次のように置きます。iOS、目的cのWebサービスURL経由でxmlタグでパラメータを渡すより良い方法は
その後、私は次のようにurl
に値を追加します。
NSString *checkingbaseUrl = [NSString stringWithFormat:@"http://myson.ascentur.au/AUMobile.asmx/FlightBooking?Authkey=%@&Reqxml=%@&infovia=%@&totalpax=%@&totalfare=%@&flightsegmentcount=%@&from=%@&destination=%@&departuredate=%@&returndate=%@&airlinecode=%@&cabinclass=%@&cabinclasses=%@",authkey,requestXml,infovia, totalPax, totalfare,flightsegmentcount,from,destination,departuredate,returndate,airline,cabinclass,cabinClassess];
ですが、応答はerror
です。私はそれがこのエラーを示しブラウザで見たときに :私のアプリで
A potentially dangerous Request.QueryString value was detected from the client (Reqxml="<BPC9> <MSG_VERSION>...").
を、それが続く
Request failed: not found (404)
とエラーを返し、これは私がvia
が
NSString *checkingbaseUrl = [NSString stringWithFormat:@"http://myson.ascentur.au/AUMobile.asmx/FlightBooking?Authkey=%@&Reqxml=%@&infovia=%@&totalpax=%@&totalfare=%@&flightsegmentcount=%@&from=%@&destination=%@&departuredate=%@&returndate=%@&airlinecode=%@&cabinclass=%@&cabinclasses=%@",authkey,requestXml,infovia,totalPax,totalfare,flightsegmentcount,from,destination,departuredate,returndate,airline,cabinclass,cabinClassess];
NSString *basedUrl = [checkingbaseUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
AFHTTPSessionManager *bookingmanager = [AFHTTPSessionManager manager];
[bookingmanager GET:checkingbaseUrl parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject)
{
NSString *responseS = (NSString *)responseObject;
NSLog(@"resoponseS : %@", responseS);
}
failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"anurdh_caldera :%@", error.localizedDescription);
}];
をAFNetworking要求する方法であります私は知りたい、これは正しい方法ですrequestXml
パラメータ(私はどのようにこれらの特殊文字のこれらのタイプでこの文字列を追加する考えている) 。
これであなたの助けを願っています。法の下に使用してブラケットを交換した後
は、POSTメソッドですか?はいの場合は、HTTPBodyに入れないでください。リクエストにはどのようなオブジェクトを使用していますか? – Larme
これは 'GET'メソッドではありません。私はWebサービスと通信するために' AFNetworking'を使用しています。 –