package at.gv.egiz.moazs.config; import at.gv.egiz.moazs.mzs.MzsService; import at.gv.zustellung.app2mzs.xsd.App2Mzs; import org.apache.cxf.Bus; import org.apache.cxf.jaxws.EndpointImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.xml.ws.Endpoint; @Configuration public class MzsServiceConfig { @Bean @Autowired public Endpoint endpoint(Bus bus, MzsService mzsService, App2Mzs app2mzs) { EndpointImpl endpoint = new EndpointImpl(bus, mzsService); endpoint.setAddress("/"); endpoint.setServiceName(app2mzs.getServiceName()); endpoint.setWsdlLocation(app2mzs.getWSDLDocumentLocation().toString()); endpoint.publish(); return endpoint; } @Bean public App2Mzs app2mzs() { return new App2Mzs(); } }