参考https://blog.youkuaiyun.com/c99463904/article/details/76018436
服务端:
1.编写SEI(Service Endpoint Interface),SEI在webservice中称为portType,在java中就是普通接口
public interface ICameraService {
public void test();
}
2. 编写SEI实现类,此类作为webservice提供服务类
@WebService///@WebService表示该类是一个服务类,需要发布其中的public的方法
@Service("CameraServiceImpl")//Spring mvc 纳入容器管理
public class CameraServiceImpl implements ICameraService {
@Override
public void test() {
System.out.print("asada");
}
}
3.发布服务,Endpoint类发布服务,publish方法,两个参数:1.服务地址;2.服务实现类
import javax.xml.ws.Endpoint;
import com.ctfo.spring.SpringInit;
public class Start {
public static void main(String[] args) {
Endpoint.publish("http://192.168.1.1