Error with connection Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x6a3f420 {NSErrorFailingURLStringKey=http%3A%2F%2F10.101.189.65%3A8090%2Fbusinessservice.svc, NSErrorFailingURLKey=http%3A%2F%2F10.101.189.65%3A8090%2Fbusinessservice.svc, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x6a3f450 "unsupported URL"}
I am getting this error when i am hitting the server.
Its directly calling the didfailwithError. -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
NSLog(@"Error with connection %@",error);
}
May i know when this error call!
I create soapenvelope and call soap request with method name. and encoded the url and send to the dot.net webserver
NSString *soapMessage = [self getTestSoapEnvelope];
NSLog(@"soapMessage %@",soapMessage);
NSString *urlString = @"http://systemName:8090/businessservice.svc";
NSString *encodeUrl = (__bridge_transfer NSString *)
CFURLCreateStringByAddingPercentEscapes(NULL,
(__bridge_retained CFStringRef)urlString,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
NSURL *url = [NSURL URLWithString:encodeUrl];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"ManageCase" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"GET"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if( theConnection )
{
webData = [NSMutableData data];
}
else
{
NSLog(@"theConnection is NULL");
}
And the Request time is GET
Unable to hit the server. Please any one advice me with this issue.
@thanks in advance