101 reputation
1
bio website arunios.blogspot.in
location Pondicherry, India
age
visits member for 2 years
seen Sep 21 '12 at 17:42

My git: Spynet

You teach me the rules i will teach you the way to reach the destiny....

profile for Spynet at Stack Overflow, Q&A for professional and enthusiast programmers

Updating / Preparing for Next Level


I am Back...


"

NSError *xmlError = nil;

NSString *requestHeader = [self prepareRequestPayload];

requestHeader = [NSString stringWithFormat:@"inputXml=%@", requestHeader];
NSMutableURLRequest *URLRequest = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://172.16.0.217:5078/CsService.asmx/InitialSynchronization"]]];

[URLRequest setHTTPMethod:@"POST"];
[URLRequest setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
[URLRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[URLRequest setHTTPBody:[requestHeader dataUsingEncoding:NSUTF8StringEncoding]];

NSURLResponse *URLResponse;
NSData *responseData = [NSURLConnection sendSynchronousRequest:URLRequest returningResponse:&URLResponse error:&xmlError];

if (xmlError) {
    *error = [NSError errorWithDomain:@"Response error" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Remote server not responding"}];
    NSLog(@"Error occured");
    return NO;
}
else
{
    DDXMLDocument *xmlDocument = [[DDXMLDocument alloc]initWithData:responseData options:0 error:&xmlError];
    DDXMLNode * node =  [[xmlDocument nodesForXPath:@"//Error" error:&xmlError] firstObject];
    for (DDXMLElement *check in [node children])
    {
        NSString *error = [check stringValue];
        NSLog(@"The error  : %@",error);

    }
   *error = [NSError errorWithDomain:@"Response error" code:0 userInfo:@{NSLocalizedDescriptionKey: @"There is no data returned from server"}];
    return NO;
}

"

⌘ அருண் . திரு

http://www.friends2support.org/inner/news/donorRegistration.aspx

logo


This user has not answered any questions
This user has not asked any questions
This user has not participated in any tags
Stack Overflow 2,367 rep 3932
Programmers 285 rep 37
Ask Different 108 rep 6
Server Fault 101 rep 1
Super User 101 rep 1

0 Votes Cast

This user has not cast any votes