Home > Software design >  How do I send data to a WSDL File from my Spring boot project?
How do I send data to a WSDL File from my Spring boot project?

Time:04-29

Sorry if this question doesnt make sense, but I don't know how else to ask. Let me describe my problem.

There are two projects A and B. Project B team has provided me with a WSDL File and url. They gave a demo of this API in Soap UI in which if you input data like name, age, address, etc., you get a ticket number in return.

Now my project is in Java Spring boot. I have the data name, age, address, etc., in my project A database. I have to send this to Project B using the url they provided and save the ticket number in the response in my database.

So my question is what exactly do I need to search to learn about this Soap UI and WSDL file? How do I send data to this WSDL file? I am a noob so I dont even know what search terms to google to find this answer. Can anyone explain this process if possible?

Do I need to make a rest template calling this url?

CodePudding user response:

The WSDL file you received, it's just a definition (or schema) of how the server should work (in your case it's as a simulation of project B). SoapUI is just a utility that runs a simple server, and WSDL defines how this server responds.

So, the WSDL file it's like a config of the SoapUI app. And SoapUI it's a web server simulator.

Your Project A should be able to send HTTP requests. Where to send it? - SoapUI

CodePudding user response:

Looks like Project B consumes SOAP requests. Your WSDL file tells you the requests it supports and the format of each request. Spring with help from the maven-jaxb2-plugin can make this easy for you. This plugin will create Java classes that represent the messages in the WSDL and Spring provides classes that make invoking the requests straight forward. See this for a full example of how to do this.

CodePudding user response:

You can generate classes from given wsdl file. And you can see methods which you must send data.

You can try some ways for generate java classes from wsdl. IntelljIdea or Eclipse or Netbeans or other tools.

Or try reficio lib https://github.com/reficio/soap-ws

  • Related