WCF/WF - Consume Wcf Using REST from Android client

Asked By Niron Kag on 14-Jul-14 12:52 PM


My question is about WCF service I wrote in C#, and android client which consume it using “REST” protocol.

I am using example from this link:


I am working with visual studio 2010 .net framework 4.

I wrote a simple WCF service and deployed it to IIS on windows 7.

I succeed to access the service from android ( is localhost when using android emulator):

It returns HTML test page with “200 OK”.


But when I try to access the function “GetPlates” in the service (or any other function) I get “HTTP/1.1 400 Bad Request”:

This is my function declaration in my interface:



      UriTemplate = "/GetPlates",

      BodyStyle = WebMessageBodyStyle.WrappedRequest,

      ResponseFormat = WebMessageFormat.Json,

      RequestFormat = WebMessageFormat.Json)]

    IList<string> GetPlates();


How can I know if my functions are accessible from "outside" users using “REST” protocol?

I tried a lot, adding and removing function attributes but I still get the error.

I will appreciate any help with this.

Thanks in advance!

Peter Bromberg replied to Niron Kag on 14-Jul-14 12:53 PM

The range of IP addresses from  to

Is a private address range and is not visible from the public internet.
Niron Kag replied to Peter Bromberg on 27-Dec-10 04:22 PM

First, thanks for the answer.
Can I do something about this? I think I must use as localhost?
Can I give my Website alias or any other thing I can do?
Thanks again.
Peter Bromberg replied to Niron Kag on 14-Jul-14 12:53 PM
The problem is that your Android (or any other phone) is using its own connectivity to go onto the internet. Since the address you are using is a private class IP address, you are plain out of luck.

www.eggheadcafe.com (  on the other hand, is a public internet IP address.
Niron Kag replied to Peter Bromberg on 14-Jul-14 12:54 PM


I uploaded my WCF test service to here:


Still, I can access the service but not the functions in it, if I call http://www.aaa.gamedroid.biz/VehicleService.svc I receive a test page with 200 ok.

But if I call this http://www.aaa.gamedroid.biz/VehicleService.svc/f3 (f3 is function name in the wcf) I receive status code 400.

I tried a lot and don’t understand what I do wrong:

This is a part of my wcf code:



UriTemplate = "f3")]

string f3();


public string f3() {
 return "Hello";


    <behavior name="httpBehavior">
    <webHttp />
    <behavior name="">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <service name="HttpWcfWeb.VehicleService">
    <endpoint address=""
       contract="HttpWcfWeb.IVehicleService" />


Is there any problem with my code?
Any help will be appreciated!

geordie replied to Niron Kag on 01-Jul-11 09:08 AM
i am having the same problem.  did you get this working?
Mike Clarke replied to geordie on 14-Jul-14 12:55 PM
I have the same problem to, I have been searching everywhere but can not find an answer. Has anyone got this working?

Please email me if you have mike@fnesse.com