SOAP (originally Simple Object Access Protocol) is a protocol specification for exchanging structured information when implementing web services on computer networks. SOAP allows you to process processes running on disparate operating systems (such as Windows and Linux) using an extensible markup language (XML). SOAP can be used in conjunction with WSDL, which is standardized, which means that people who know the standard (WSDL) can learn from it what operations the web service offers and how data is exchanged. This knowledge can be used to create tools that generate safe types / type binding objects from a WSDL file. These generated classes (for creating RPC) can be used without the need for manual implementation of queries and coding / analysis of data exchanged.
Using maven-jaxb2-plugin , we can generate the required classes needed from wsdl.
<plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>${maven-jaxb2-plugin.version}</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemaDirectory>${project.basedir}/src/main/resources/wsdl</schemaDirectory> <schemaIncludes> <include>*.wsdl</include> </schemaIncludes> </configuration> </plugin>
Next, using the ServletRegistrationBean, we register the MessageDispatcherServlet using the Spring Boot. During this registration, the URI template for the servlet is set to / javainuse / ws / *. Using this path, the web container will display incoming HTTP requests in the MessageDispatcherServlet. DefaultWsdl11Definition provides standard WSDL 1.1 using the specified Hello World WSDL file. MessageDispatcherServlet also automatically detects any WsdlDefinition defined in the application context.
A detailed explanation along with the video tutorial is available here: Spring First example of a download contract and web services SOAP
Gordan
source share