I have a HTTP wcf hosted on IIS. I checked the service on local machine using android emulator. The emulator and wcf on local machine is working fine.
In webbrowser I can access service by using this URL:
http://localhost:4806/Service1.svc
and in android emulator I am using http://10.0.2.2:4806/Service1.svc
to successfully connect android with wcf.
Now I wanted to use android device to access the wcf on PC. How can I do that? Do I need to make any changing in web.config file? it is web.config file code
<service name="JSONService.Service1" behaviorConfiguration="JSONService.Service1Behavior">
<!-- Service Endpoints -->
<!--Change the binding to webHttpBinding and set behaviour configuratiion to web-->
<endpoint address="" binding="webHttpBinding" contract="JSONService.IService1" behaviorConfiguration="web" >
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="JSONService.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<!--Newly added configuration-->
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
<!--End of newly added Configuration-->
</behaviors>
Thanks for help.
EDITED:
I tried by using IP of PC like this http://192.168.1.67:4806/Service1.svc
and also open a port in windowsfirewall 4806. I wanted to login from android device and get authentication from wcf running on PC. Now when I press login button the application get stop and give error foreclose. Any help is this regard would be great. Thanks