I am trying to connect my iphone with my local web service but the phone can't find the page on the server. It works when I test my app on xcode on the mac but it fails once I try it on the phone.
I've tried these method but it didn't work for me Accessing localhost from iPhone (in same network) Connect Device to Mac localhost Server?
ViewController.h
-(IBAction)Invoke:(id)sender{
NSstring *soapformat = ....;
//This is what i use to test it on the mac on xcode and it finds the page
//NSURL *locationOfWebService = URLWithString:@"http://127.0.0.1:8080/Service1.asmx;
//
NSURL *locationOfWebService = 192.168.1.57/Service1.asmx;
}
Output
2014-06-24 08:48:08.303 SoapServiceTest[1609:60b] The request format is <?xml version="1.0" encoding="utf-16"?>
<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>
<printsomeThing xmlns="http://tempuri.org/">
<userData>12</userData></printsomeThing>
</soap:Body>
</soap:Envelope>
2014-06-24 08:48:08.308 SoapServiceTest[1609:60b] web url = http://192.168.1.57/Service1.asmx
2014-06-24 08:48:08.500 SoapServiceTest[1609:60b] DONE. Received Bytes: 211
2014-06-24 08:48:08.501 SoapServiceTest[1609:60b] XML <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /Service1.asmx was not found on this server.</p>
</body></html>
I've tried using my_mac_name.local/Service1.asmx as well but it still didn't work. Im pretty sure it is my locationOfWebService but im not sure how else to change it.