CXF服务端:
package com.sean.server;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
public interface Plus {
public int add(@WebParam(name="x") int x, @WebParam(name="y") int y);
}
package com.sean.server;
public class PlusImpl implements Plus {
public int add(int x, int y){
return x + y;
}
}
package com.sean.server;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.frontend.ServerFactoryBean;
public class Server {
public static void main(String args[]) throws Exception {
PlusImpl plusImpl = new PlusImpl();
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
//ServerFactoryBean factory = new ServerFactoryBean();
factory.setServiceClass(Plus.class);
factory.setAddress("http://127.0.0.1:8