简体   繁体   中英

How to invoke existing SOAP webservice into REST API Spring boot application

I have a Rest Spring boot application, I need to invoke external SOAP webservice in my Rest Spring boot application - similar question asked in stackoverflow - Calling a SOAP service using REST service but didn't get any exact steps. One blog I found the solution but don't know whether it right approach or not - https://docs.oracle.com/cd/E19340-01/820-6767/aeqgc/index.html

Let me know if anyone knows the solution. Whether need to create wsdl in Spring boot rest application or directly convert the json to xml and invoke the endpoint?

The WSDL is provided by the SOAP Web service. You can get it by visiting its WSDL endpoint url.

The idea is that once you get the WSDL, copy it to your project folder and then use some maven plugin to generate a SOAP client from the WSDL. Here is the spring official guide for how to do it.

You operate the generated client in the java object level and it will help to format the SOAP request in the correct XML format and then send out.So you do not need to manually create the XML request by yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM