I think if you take out the bus part, which is more complicated to be used as the Spring java configure, the PersonServiceConfiguration should work as you want.

Current you can't load a bus from spring without the import the classpath:META-INF/cxf/cxf.xml and other extensions.

Willem
On 12/10/10 8:06 AM, mreardon wrote:

I'm experimenting with Java-based configuration in Spring 3.0. So far I'm
finding it a mixed bag. One problem has been that there is no equivalent for
the domain-specific configuration though XML namespaces. Has anyone else
tried using @Bean to define JAX-WS endpoints and clients (as apposed to
using<jaxws:client/>  or<jaxws:endpoint/>)? For example, I tried the
following endpoint without success...


import org.apache.cxf.Bus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.expd.service.person.impl.dao.IPersonDao;

@Configuration
public class PersonServiceConfiguration {
        
        @Autowired
        private Bus bus;

        @Autowired
        private PersonDao personDao;
        
        @Bean
        public Endpoint personServiceEndpoint() {               
                return new EndpointImpl(bus, personService(), "/PersonService");
        }

        @Bean
        public PersonService personService() {
                PersonServiceImpl service = new PersonServiceImpl();
                service.setDao(personDao);
                return service;
        }
}


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Reply via email to