-NSString *soapmessage =-[NSString stringWithFormat:-@"<?xml version=\"1.0\"encoding=\ "utf-8\"?>"-"<soap:envelope xmlns:xsi=\ "http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\ "http://www.w3.org/2001 /xmlschema\ "xmlns:soap=\" http://schemas.xmlsoap.org/soap/envelope/\ ">"-"<soap:Body>"-"<save xmlns=\ "http://www.myapp.com/\" >"-"<par1>%i</par1>"-"<par2>%@</par2>"-"<par3>%@</par3>"-"</Save>"-"</soap:Body>"-"</soap:Envelope>", Par1, par2, Par3- ];-Nsurl *url = [Nsurl urlwithstring:@"Http://....asmx"];-Nsmutableurlrequest *request =[Nsmutableurlrequest Requestwithurl:url];--NSString *msglength = [NSString stringWithFormat:@"%lu", (unsignedLong) [SoapMessage length]];--[Request AddValue:@"text/xml; Charset=utf-8"Forhttpheaderfield:@"Content-type"];-[Request Addvalue:msglength Forhttpheaderfield:@"Content-length"];--[Request Sethttpmethod:@"POST"];-[Request Sethttpbody: [SoapMessage datausingencoding:nsutf8stringencoding];--Afhttprequestoperation *operation =[[Afhttprequestoperation alloc] initwithrequest:request];-Operation.responseserializer =[Afxmlparserresponseserializer serializer];-[Operation setcompletionblockwithsuccess:^ (Afhttprequestoperation *operation,IDresponseobject) {-if([Self.Delegaterespondstoselector: @selector (myapphttpclientdelegate:didupdatewithweather:)]) {-[Self.Delegatemyapphttpclientdelegate:self Didupdatewithweather:responseobject];- }-} failure:^ (Afhttprequestoperation *operation, Nserror *error) {-if([Self.Delegaterespondstoselector: @selector (myAppHTTPClientDelegate:self:didFailWithError:)]) {-[Self.Delegatemyapphttpclientdelegate:self Didfailwitherror:error];- }- }];--[Operation start]; Updatensdictionary*s_request = @{@"par1": [NSString stringWithFormat:@"%i", Par1],@"par2": Par2,@"Par3": Par3,@"PAR4": [NSString stringWithFormat:@"%i", PAR4],@"PAR5": PAR5}; Afhttpsessionmanager* S_manager =[[Afhttpsessionmanager alloc] init]; [S_manager POST:@"Http://192.168.10.26/mywebservice/myservice.asmx?op=MethodName"Parameters:s_request success:^ (Nsurlsessiondatatask *task,IDresponseobject) {NSLog (@"done!"); } Failure:^ (Nsurlsessiondatatask *task, Nserror *error) {NSLog (@"FAILED%@,%@", [Error localizeddescription], [error Localizedfailurereason]); }];-[Manager SOAP:@"/webservices/weatherwebservice.asmx"constructingbodywithblock:^ (Nsmutableurlrequest *request) {-[Request Sethttpbody:[soapmessage datausingencoding:nsutf8stringencoding];-} success:^ (Afhttprequestoperation *operation,IDresponseobject) {-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);- }];
iOS calls C # background Interface message format