Xfire generates webservice. Android uses ksoap2 to access the webservice server. xfireksoap2
1. Preparations
I ran a notebook program. Desktop Connection Network. The notebook and my mobile phone are connected to the router at the same time.
If you do not have a vro or wifi, you can find another notebook and download a wifi sharing genie from the notebook. If you don't have a notebook, find a mobile phone. Enable a hotspot and connect your laptop to your hotspot at the same time.
2. Environment Construction
JDK 64-bit 1.8, Myeclipse8.5, tomcat 6.0, and Android sdk.
Connect Myeclipse to tomcat
Http://jingyan.baidu.com/article/4853e1e53465271909f72690.html
Jdk Configuration
Http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html
Download myeclipse8.5
Http://pan.baidu.com/s/1jGABEaM
Download jdk1.8
Http://pan.baidu.com/s/1o6r6AYA
Tomcat6.0 download
Http://pan.baidu.com/s/1pJ4vMT9
ADT download
Http://pan.baidu.com/s/1dDcpT7N
3. Server Construction
Use myeclipse to create a web service project
Remember to select xfire
Select the first
Create an interface file in the src directory
Write the following code (of course, I will upload the source code)
Create a new java file to implement the above interface
Write the following code:
Modify the services. xml file
Import xfire package
And all packages under lib
Remember to check all of them. Otherwise, the system will prompt that the class file cannot be found.
Then run the program
If the following information is displayed in the browser, the server is successfully set up.
4. Create a client