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 ?
CodePudding user response:
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.