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

前端 未结 8 1208
遥遥无期
遥遥无期 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 07:58

    I had a similar error. the problem is that the request and response generated from XSD/WSDL missed the @XMLRootElement annotation. By adding JAXBElement to the endpoint solved the problem.

    private static final String NAMESPACE_URI = "";
    
    @Autowired
    Service   service;
    
    @PayloadRoot ( namespace = Endpoint.NAMESPACE_URI, localPart = "name" )
    @ResponsePayload
    public JAXBElement < Response > Create ( @RequestPayload JAXBElement < Request> request ) throws Exception
    {
    ObjectFactory factory = new ObjectFactory ( );
    Response response = new Response ( );
    Request req = request.getValue ( );
    
    response  = this.service.call( req);
    
    return factory.createResponse ( response );
    }
    

提交回复
热议问题