Java WebService Programming

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.