No adapter for endpoint; Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?

前端 未结 8 1065
遥遥无期
遥遥无期 2021-02-05 07:45

I am struggling with an Spring-WS with JMS example. I set the Spring-WS and JMS wiring as per the Spring recommendations. But I kept getting following error. I dont know how to

8条回答
  •  梦谈多话
    2021-02-05 08:06

    First, as per the guidelines, there should be an Endpoint class

    @Endpoint
    public class EmpEndpoint {
    
        @Autowired
        private EmpService empService;
    
        //This is like @RequestMapping of Spring MVC    
        @PayloadRoot(localPart = "EmpServiceRequest", namespace = "http://www.example.org/")
        @ResponsePayload
        public EmpServiceResponse getemployeeDetails(@RequestPayload EmpServiceRequest request) {
            EmpServiceResponse response = new ObjectFactory().createEmpServiceResponse();
            List l = empService.getemployeeDetails(request.getName());
            response.setName(l.get(0).getName());
            response.setEmail(l.get(0).getEmail());
            return response;
        }
    }
    

    And one Service and its implementation class which will have PayloadRoot and other Annotations (Request and Response)

    And place this in your spring-servlet.xml

      
    
    
    
    
    

提交回复
热议问题