Arun Paarthi
Arun Paarthi

Reputation: 643

Soap web service is no accessible from android emulator?

Hi I am consuming a soap web service from my android application, I was able to get the response from my desktop browser where as it is not working in android emulator's browser and also in my application which runs on the emulator.

Upvotes: 3

Views: 941

Answers (1)

Bhavesh Patadiya
Bhavesh Patadiya

Reputation: 25830

If you are referring your localhost on your system from the Android
emulator then you have to use http://10.0.2.2:8080/. Because Android
emulator runs inside a Virtual Machine(QEMU) therefore here 127.0.0.1 or localhost will be emulator's own loopback address.

While calling the Webservice from your Emulator Web Browser Verify that 10.0.2.2 is your machine address(run ifconfig to verify it )

let say if your webservice is

 http://localhost:39064/AndroidServiceImpl.svc/.. 

then while calling this from your emulator you have to use 10.0.2.2 instead localhost

you should call webservice like

 http://10.0.2.2:39064/AndroidServiceImpl.svc/.. 

Hope it will help.

Upvotes: 2

Related Questions