Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6688579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:25:10+00:00 2026-05-26T05:25:10+00:00

I’ve just put my iOS app on my iPad, which is connected to my

  • 0

I’ve just put my iOS app on my iPad, which is connected to my wireless network, and I cannot connect to web services. This was working in the simulator, however when I put it on the iPad, the connection times out. Is there something different needed when put on a real device?

Here is my code nevertheless:

-(BOOL)Webservice{
recordResults = FALSE;
user = nameInput.text;
pass = passwordInput.text;




NSString *soapMessage = [NSString stringWithFormat:
                         @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
                         "<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/\">\n"
                         "<soap:Body>\n"
                         "<ValidateUser xmlns=\"http://tempuri.org/\">\n"
                         "<User>%@</User>\n"
                         "<Password>%@</Password>\n"
                         "</ValidateUser>\n"
                         "</soap:Body>\n"
                         "</soap:Envelope>\n", nameInput.text, passwordInput.text
                         ];



NSLog(soapMessage);

NSURL *url = [NSURL URLWithString:@"http://192.168.51.3:60010/Webservice/IDLMobile.asmx?WSDL"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];

[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"http://tempuri.org/ValidateUser" forHTTPHeaderField:@"soapAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

if( theConnection )
{
    webData = [[NSMutableData data] retain];
}
else
{
    NSLog(@"theConnection is NULL");
}

[nameInput resignFirstResponder];
[passwordInput resignFirstResponder];

/* update function */
    }


-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
 {
[webData setLength: 0];
  }
   -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  {
[webData appendData:data];
   }
   -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
  {
NSLog(@"ERROR with theConenction");
[connection release];
[webData release];
  }
  -(void)connectionDidFinishLoading:(NSURLConnection *)connection
  {
NSLog(@"DONE. Received Bytes: %d", [webData length]);
NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:     [webData length] encoding:NSUTF8StringEncoding];
NSLog(theXML);
[theXML release];

if( xmlParser )
{
    [xmlParser release];
}

xmlParser = [[NSXMLParser alloc] initWithData: webData];
[xmlParser setDelegate: self];
[xmlParser setShouldResolveExternalEntities: YES];
[xmlParser parse];

[connection release];
[webData release];
 }

    -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
      attributes: (NSDictionary *)attributeDict
{

if ([elementName isEqualToString:@"Message"])
{
    //---displays the country---

    NSLog(soapResults);  

    NSString *convertString = soapResults;
   // check = 0;
    check = [convertString intValue];
    thyCheck = [convertString intValue];
    NSLog(@"user is");
  //  NSLog(user);
    if(check > 0){

        [self someUpdateFunction];


        NSString *string = [NSString stringWithFormat:@"%d", check];
        NSLog(string);
        NSLog(@"lolololol"); 
        check = 0;


    }else{
             UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Problem!" message:@"Incorrect Username or Password"
                                                           delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:@"Yes", nil];
        [alert show];
        [alert release];
        thyCheck = 0;
    }
  //  gotoContent = checkConfirm;
}



if( [elementName isEqualToString:@"ValidateUserResponse"])
{

    if(!soapResults)
    {
        soapResults = [[NSMutableString alloc] init];
        NSLog(soapResults);
        NSLog(@"above is soap validate user");


    }

    recordResults = TRUE;
}


    }



   -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
    {
if( recordResults )
{
    [soapResults appendString: string];
}
    }

The other thing I could think of is that the iPhone MUST be connected to a 3G network? So it can’t access web services through a connection to a router?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:25:10+00:00Added an answer on May 26, 2026 at 5:25 am

    192.168.51.3 look like a private subnet of a network, could it be that you WiFi is on another subnet?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.