MarshallingWebServiceInboundGateway issues

I am using spring-boot with spring-integration and spring-ws to provide a SOAP web service as the entry point for my integration flow.

I set up the inbound gateway this way:

@Bean
MarshallingWebServiceInboundGateway entryPoint() {
    MarshallingWebServiceInboundGateway entryPoint = new MarshallingWebServiceInboundGateway(jaxb2Marshaller());
    return entryPoint;
}

@Bean
Jaxb2Marshaller jaxb2Marshaller() {
    Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
    jaxb2Marshaller.setContextPath("my.schemas");
    return jaxb2Marshaller;
}

      

The MessageDispatcherServlet is configured like this:

@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext context) {
    MessageDispatcherServlet servlet = new MessageDispatcherServlet();
    servlet.setApplicationContext(context);
    servlet.setTransformWsdlLocations(true);
    return new ServletRegistrationBean(servlet, "/entrypoint/*");
}

      

And the display:

@Autowired
MarshallingWebServiceInboundGateway entryPoint;

@Bean
UriEndpointMapping uriEndpointMapping() {
    UriEndpointMapping uriEndpointMapping = new UriEndpointMapping();
    uriEndpointMapping.setDefaultEndpoint(entryPoint);
    return uriEndpointMapping;
}

      

According to the docs, I should use MarshallingWebServiceInboundGateway

this way, but when I try to request this endpoint in SoapUI, I get this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring xml:lang="en">No adapter for endpoint [entryPoint]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

      

What am I missing here?

+3


source to share


2 answers


This issue has been solved. I also needed to define the bean as such:

@Bean
MessageEndpointAdapter messageEndpointAdapter() {
    MessageEndpointAdapter adapter = new MessageEndpointAdapter();
    return adapter;
}

      



I couldn't find links to this in any of the docs, but it did solve certain problems for me.

+3


source


Thanks a lot, I was angry about that. I spent about 4 hours reading the docs, tried it, cursed, read again, dug in SI sources, try again, curse even louder until I found your post ...

I guess it was no longer mentioned that an adapter declaration is required! At least I've managed to convert from your fancy Java config to xml; -)



  <bean id="endpointAdapter" class="org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter" />

      

Thanks again!

0


source







All Articles