1

I wanna send message to the MQ with SOAP format but in exchange object i'll get only XML Data (without envelope,header and body), here i have to append the SOAP envelope and body to the exchange object as like below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:act="http://ei/event/envprocess">
   <soapenv:Header/>
   <soapenv:Body>
 **//  exchange object get the xml data need to add here.**
   </soapenv:Body>
</soapenv:Envelope>

for solution i found this link but i'm not getting how to get the cxf:cxfEndpoint object in spring boot and how to append payload or exchange data for it.

Can anyone please help me to resolve this issue.

1 Answers1

1

As mentioned in the comment, you can use XSL to transform your message body into a SOAP request.

To call the XSL in the route is a one-liner:

.to("xslt:MyStylesheet.xsl?saxon=true")

This expects the MyStylesheet.xsl in the classpath root. If you want to leverage XSL 2, add the Saxon dependency and the option saxon=true.

If you only need XSL 1, you don't need Saxon and the option.

The solution you found would be to establish a SOAP communication through a JMS broker. In this scenario, MQ mimics a synchronous request/reply communication. This is a quite different subject than using standard MQ (asychronous sender and receiver).

If the simple XSL or SOAP over JMS better suits you case depends on the broader goal you want to reach.

burki
  • 6,741
  • 1
  • 15
  • 31