webservice

webservice发布类似这个样子:

package com.hyan.service;

import javax.jws.WebService;
import javax.xml.ws.Endpoint;

@WebService
public class ServiceHello {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Endpoint.publish("http://localhost:9012/Service/ServiceHello", new ServiceHello());
        System.out.println("service success");
    }
    
    public String getValue(String name){
        return "来了"+name;
    }

}

webservice客户端推荐用  SoapUI工具来模拟发送webservice请求,

类似这个样子

原文地址:https://www.cnblogs.com/feiyunaima/p/6677090.html