user630209
user630209

Reputation: 1207

calling soap service from spring boot

I haven't worked with soap service.

Currently I do have a wsdl file and to pass an input dto with that.

This service will save that data.

How can I call this soap service from my spring boot application. I'm familiar with using RestTemplate to invoke rest service.

Tried with below one it looks bit complicated. Any references will great help.

https://howtodoinjava.com/spring-boot/spring-soap-client-webservicetemplate/

Upvotes: 1

Views: 16513

Answers (2)

amar19
amar19

Reputation: 391

You should refer to the spring docs soap service example for details.

https://spring.io/guides/gs/consuming-web-service/

Also, since you already have WSDL and DTO, you just need to create a client to feed your WSDL and Data to the end service.

Define specific goals in pom.xml for parsing WSDL and creating the stub data at runtime. If you are comfortable with Maven it will be easy for you to build your application quickly without much configuration changes.

Upvotes: 1

Aryan
Aryan

Reputation: 56

You can convert WSDL to java class and import classes to your project, there is a stub class that you can find it in converted class, you can use it to communicate with remote service just by creating the object from stub class, you can find more information about it on
wsdl to java class

if you are using the intelij idea you can convert your WSDL easily
right-click on your package -> web services -> generate java class from WSDL

Upvotes: 1

Related Questions