import
org.apache.cxf.interceptor.LoggingInInterceptor;
import
org.apache.cxf.interceptor.LoggingOutInterceptor;
import
org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import
com.java1234.webservice.impl.HelloWorldImpl;
public
class
Server {
public
static
void
main(String[] args) {
System.out.println(
"web service start"
);
HelloWorld implementor =
new
HelloWorldImpl();
String address =
"http://192.168.1.103/helloWorld"
;
JaxWsServerFactoryBean factoryBean =
new
JaxWsServerFactoryBean();
factoryBean.setAddress(address);
factoryBean.setServiceClass(HelloWorld.
class
);
factoryBean.setServiceBean(implementor);
factoryBean.getInInterceptors().add(
new
LoggingInInterceptor());
factoryBean.getOutInterceptors().add(
new
LoggingOutInterceptor());
factoryBean.create();
System.out.println(
"web service started"
);
}
}