zoukankan      html  css  js  c++  java
  • 学习webservice之cxf(2):使用java代码使用webservice(jdk1.8无法使用)

    package com.rg2.webservice.impl;
    
    import javax.xml.ws.Endpoint;
    
    import com.rg2.webservice.HelloWorld;
    
    public class Server {
    
        public static void main(String[] args) {
            System.out.println("web service start");
            HelloWorld implementor = new HelloWorldImpl();
            String address = "http://localhost/helloWorld";
            Endpoint.publish(address, implementor);//jdk实现暴露webservice接口
            System.out.println("web service started");
        }
    
    }
    package com.rg2.webservice.impl;
    
    import javax.jws.WebService;
    
    import com.rg2.webservice.HelloWorld;
    
    @WebService
    public class HelloWorldImpl implements HelloWorld {
    
        @Override
        public String say(String str) {
            return "hello"+str;
        }
    
    }
    package com.rg2.webservice;
    
    import javax.jws.WebService;
    
    @WebService
    public interface HelloWorld {
    
        public String say(String str);
    }

    暂时未解

  • 相关阅读:
    推箱子
    去掉两个最高分、去掉两个最低分,求平均分
    投票选班长
    彩票
    闰年、平年
    闹钟
    手机号抽奖
    for练习--侦察兵
    兔子、棋盘放粮食、猴子吃桃
    for练习--凑法
  • 原文地址:https://www.cnblogs.com/zhengyuanyuan/p/9261238.html
Copyright © 2011-2022 走看看