Click here to Skip to main content
15,885,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I wrote a simple WCF Service Application. The service is deployed on a server with IP `10.0.0.14`. I can ping the server when I go to the URL :`http://10.0.0.14/jonts/WCFService.svc` from a desktop web browser and a mobile browser.

I have a Service interface that Implements REST that looks as follows:

namespace WCF_Connection
{

[ServiceContract]
public interface IWCFService
{
[OperationContract]
[WebGet(UriTemplate = "Test/{msg}")]
string sayHello(string msg);
}

}

When I use the WCF service by going to `http://10.0.0.14/jonts/WCFService.svc/test/one` I get a response with no problem. When I run the following in android I get a `connection to http://10.0.0.14 refused` error in the log.


private void Message()
{
HttpClient httpClient = new DefaultHttpClient();
try
{
String url = "http://10.0.0.14/jonts/WCFService.svc/test/dasd";

HttpGet method = new HttpGet( new URI(url) );
HttpResponse response = httpClient.execute(method);
Toast.makeText(getApplicationContext(),getResponse(response.getEntity()) ,
Toast.LENGTH_LONG).show();
} catch (IOException e) {
Log.e( "error", e.getMessage() );
} catch (URISyntaxException e) {
Log.e( "error", e.getMessage() );
}
}

My log from IIS is as follows:

#Software: Microsoft Internet Information Services 8.0
#Version: 1.0
#Date: 2014-07-01 08:20:09
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2014-07-01 08:20:09 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/5.0+(Windows+NT+6.3;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/35.0.1916.153+Safari/537.36 - 200 0 0 885
2014-07-01 08:20:23 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 84
2014-07-01 08:20:23 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 43
2014-07-01 08:20:23 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 74
2014-07-01 08:20:23 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 546
2014-07-01 08:20:23 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 93
2014-07-01 08:20:24 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 99
2014-07-01 08:20:24 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:20:24 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 74
2014-07-01 08:20:24 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:20:24 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 77
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 106
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 73
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 79
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 131
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 62
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 50
2014-07-01 08:20:35 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 74
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 102
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 39
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 62
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 49
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 73
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc - 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 104
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc disco 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 46
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc wsdl 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 62
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd0 80 - 10.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 56
2014-07-01 08:21:02 10.0.0.14 GET /jonts/WCFService.svc xsd=xsd1 80 - 10.0.0.1 Mozilla/4.0+ (compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.34014) - 200 0 0 72

Why do I get the error and How can I fix it?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900