On Monday, October 31, 2011 4:59:42 PM Geert Schuring wrote:
> Absolutely. The CXF distribution contains an example called
> "java_first_jaxws_factory_bean" that demonstrates the use of the Java API.
> Below is an extract from that example:
>
>
> import org.apache.cxf.interceptor.LoggingInInterceptor;
> import org.apache.cxf.interceptor.LoggingOutInterceptor;
> import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
>
> public class Server {
>
> protected Server() throws Exception {
> System.out.println("Starting Server");
> HelloWorldImpl implementor = new HelloWorldImpl();
> JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> svrFactory.setServiceClass(HelloWorld.class);
> svrFactory.setAddress("http://localhost:9000/helloWorld");
> svrFactory.setServiceBean(implementor);
> svrFactory.getInInterceptors().add(new LoggingInInterceptor());
> svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
> svrFactory.create();
> }
>
You'd obviously want to add a "svrFactory.setWsdlLocation(wsdlLocation);"
call in there if you want to specify the location of the WSDL. :-)
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com