0

Hello i have exposed a soap ws with spring boot and i need to add soapenv:Header to the response.

the response that i have actually is

<SOAP-ENV:Envelope
   xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
   SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">

   <SOAP-ENV:Body xmlns:m = "">
      <m:GetQuotationResponse>
         <m:Quotation>Here is the quotation</m:Quotation>
      </m:GetQuotationResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

here is the WebserviceConfiguration class

@EnableWs
@Configuration
public class WebServiceConfiguration extends WsConfigurerAdapter {

    @Value("${webservices.endpoint.quotationEndpoint}")
    private String quotationEndpoint;


    @Bean
    public ServletRegistrationBean<CXFServlet> wsDispatcherServlet() {
        CXFServlet cxfServlet = new CXFServlet();
        return new ServletRegistrationBean<>(cxfServlet, "/services/*");
    }

    @Bean(name = "cxf")
    public SpringBus springBus() {
        return new SpringBus();
    }

    @Bean
    public Endpoint quotationEndpoint() {
        EndpointImpl endpoint = new EndpointImpl(springBus(), new quotationEndpoint());
        endpoint.publish(quotationEndpoint);
        return endpoint;
    }

}

0 Answers0