I am trying to use a soap web service which only returns me a date(test). But I am not able to connect with the web service. I am only receiving the wsdl from the web servic
Please go through following link http://www.icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/
I hope it will help you.
Veery simple way is to generate WSDL classes. Can do that using https://code.google.com/p/wsdl2objc/. Folowing instruction from https://code.google.com/p/wsdl2objc/wiki/UsageInstructions
The following code block helped me in handling web-service using SOAP request.
-(void)getWebServiceContent {
NSURL *url = [NSURL URLWithString:@"http://url_value_here"];
NSString *soapBody = @"soap_body_here";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPBody:[soapBody dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPMethod:@"POST"]; //GET
[request addValue:@"Value_to_be_added" forHTTPHeaderField:@"SOAPAction"];
[request addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation,id responseObject{
NSLog(@"Success : Content : %@",[operation responseString]);
} failure:^(AFHTTPRequestOperation *operation,NSError *error) {
NSLog(@"Failed");
})];
[operation start];
}