For 2.X reference http://jiapumin.iteye.com/blog/2109378
1Afhttprequestoperationmanager *manager =[Afhttprequestoperationmanager manager];2Manager.responseserializer =[[Afhttpresponseserializer alloc] init];3[Manager.requestserializer SetValue:@"application/soap+xml; Charset=utf-8"Forhttpheaderfield:@"Content-type"];4[Manager.requestserializer setvalue:soaplength Forhttpheaderfield:@"Content-length"];5Nsmutableurlrequest *request = [Manager.requestserializer requestwithmethod:@"POST"URLString:@"Http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"Parameters:nil];6 [Request Sethttpbody:[soapmessage datausingencoding:nsutf8stringencoding];7Afhttprequestoperation *operation = [Manager httprequestoperationwithrequest:request success:^ ( Afhttprequestoperation *operation,IDresponseobject) {8NSString *response = [[NSString alloc] Initwithdata: (NSData *) Responseobject encoding:nsutf8stringencoding];9NSLog (@"%@, %@", operation, response);Ten} failure:^ (Afhttprequestoperation *operation, Nserror *error) { OneNSString *response = [[NSString alloc] Initwithdata: (NSData *) [Operation Responseobject] encoding:nsutf8stringencoding]; ANSLog (@"%@, %@", operation, error); - }]; - [Manager.operationqueue addoperation:operation]; the}
For 3.X (not verified)
1Afhttpsessionmanager *manager =[Afhttpsessionmanager manager];2Nsmutableurlrequest *request = [Manager.requestserializer requestwithmethod:@"Post"URLString:@""Parameters:nil Error:nil];3 [Request Sethttpbody:nil];4Nsurlsessiontask *task = [Manager datataskwithrequest:request completionhandler:^ (nsurlresponse * _Nonnull response,ID_nullable Responseobject, Nserror *_nullable Error) {5 6 }];7[Task resume];
SOAP request by Afnetworking2. x/3.x