Detailed explanation of Android calling WCF instance
Android calls WCF instance
1. Build the server program
2. Build IIS website host
YourService.svc
<%@ServiceHost Debug="true" Service="YourNameSpace.YourService"%>
Web.config
3. Boarding services
Publish the website to the web server, and specify the virtual directory of the website to point to the directory
If you can access http: / / your IP: port / virtual directory / service. SVC
Well, Congratulations, your server is successful!
4. Use ksoap2 to call WCF
Go to ksoap2 official website
http://code.google.com/p/ksoap2-android/ Download the latest jar
5. Create a new Java project in eclipse and test your service
Create a new interface to read the soapobject returned by WCF
ISoapService
HelloService
Test procedure
Tested successfully
Operation results:
Hello Master HaKu
6. Android client test
7. Final operation results
Thank you for reading, hope to help you, thank you for your support to this site!