學習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);
}

 

暫時未解


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM