NSString *strgetpritype= @ "<?xml version=\" 1.0\ "encoding=\" utf-8\ "? >\n"
"<soap12:envelope xmlns:xsi=\" http://www.w3.org/2001/xmlschema-instance\ "xmlns:xsd=\" http://www.w3.org/2001/ Xmlschema\ "xmlns:soap12=\" http://www.w3.org/2003/05/soap-envelope\ ">"
"<soap12:Body>"
"<getprjtype xmlns=\" http://tempuri.org/\ "/>"
"</soap12:Body>"
"</soap12:Envelope>";
NSString *maglength=[nsstring stringwithformat:@ "%lu", (unsigned long) [strgetpritype length]];
Afhttprequestoperationmanager *manger=[afhttprequestoperationmanager Manager];
Manger.responseserializer = [[Afhttpresponseserializer alloc] init];
[Manger.requestserializer setvalue:@ "application/soap+xml; charset=utf-8" forhttpheaderfield:@ "Content-Type"];
[Manger.requestserializer setvalue:maglength forhttpheaderfield:@ "Content-length"];
[Manger.requestserializer setvalue:@ "application/soap+xml; charset=utf-8" forkey:@ "Content-Type"];
[Manger.requestserializer setvalue:maglength forkey:@ "Content-type"];
Nsmutableurlrequest *request=[manger.requestserializer requestwithmethod:@ "POST"
urlstring:@ "Http://192.168.2.214:86/webservice/WebService.asmx"
Parameters:nil
Error:nil];
[Request Sethttpbody:[strgetpritype datausingencoding:nsutf8stringencoding];
Afhttprequestoperation *operation=[manger Httprequestoperationwithrequest:request
success:^ (afhttprequestoperation *operation, id responseobject) {
NSString *response=[[nsstring alloc]initwithdata: (NSData *) Responseobject encoding:nsutf8stringencoding];
NSLog (@ "%@,====%@", operation,response);
}
failure:^ (afhttprequestoperation *operation, Nserror *error) {
NSString *response=[[nsstring alloc]initwithdata: (NSData *) [Operation Responseobject]encoding:nsutf8stringencoding ];
NSLog (@ "%@,%@,%@", operation,error,response);
}];
[Manger.operationqueue addoperation:operation];
Web interface Invocation