This afternoon, I tested WebService and encountered various problems. Now I will summarize all kinds of files in the compilation process one by one. For detailed operation steps, refer to the article on Java WebService programming.
First look at the service class (specific implementation is omitted ):
package test;/** * GetUserInfo From Romote DB * * @author dml * @since 2012.9.13 * */public class InitUserHandle {public static List query_userInfo_from_romoteDB() {……………………public static List query_userInfo_from_IMDB() {……………………}protected static void insert_userInfo_to_localDB(List list, String SITENAME) {……………………}public static void getUserList(String SITENAME) {……………………}
Service address: http: // 127.0.0.1: 8080/inituserservice/inituserhandleport? WSDL
After Tomcat is started, its WSDL content is displayed.
The project structure generated based on the specific operation method of the test project is shown in:
File List:
1. A packet information package-info.java;
2. An object factory class objectfactory. Java;
3. A service class [class name] service. Java;
4. A representative class [class name] delegate. Java;
5. Methods declared as public (XXXX) will be generated as XXXX. Java and xxxxresponse. Java classes;
These files are all generated by IDE. If you are interested, please read them in detail.
Test content:
Package COM. jointsky. test; import COM. jointsky. handle. inituserhandledelegate; import COM. jointsky. handle. inituserhandleservice;/***** <p> * Title: Test code/P> ** <p> * description: example business class * </P> ** <p> * copyright: Copyright (c) 2012 * </P> ** @ author DML @ 2012-12-11 * @ version 1.0 */public class initusertest {public static void main (string [] ARGs) {inituserhandleservice iuhs = new inituserhandleservice (); inituserhandledelegate iuhd = iuhs. getinituserhandleport (); iuhd. getuserlist ("192.168.4.155 ");}}
(Instantiate the service class, instantiate the proxy class, and perform the required methods through the proxy class object.
After these operations, you can write a WebService project on your own, and then you need to consolidate the theoretical basis.
The above stick these sample code key package for JAX-WS, next, a detailed understanding of this package, see
[Todo] WebService JAX-WS to explore the article.
DML @ 3.1.3.1.7