Skip to content

Latest commit

 

History

History
153 lines (117 loc) · 4.34 KB

3.0.0-upgrade-notes.md

File metadata and controls

153 lines (117 loc) · 4.34 KB

Course Updates

Really excited to announce that the entire course is now upgraded to Spring Boot 3

FAQ

What are the new changes?

  • Updated all code for 3.0.0 RELEASE of Spring Boot
    • SOAP Web Services
    • REST API section is completely re-recorded with Spring Boot 3!

REST API Changes

SOAP Web Services Changes for Spring Boot 3

Important Changes

Jakarta EE

Use Jakarta EE instead of Java EE


import jakarta.*;
//import javax.*;

JAXB 2 Maven Plugin

Recommended Configuration

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>jaxb2-maven-plugin</artifactId>
	<version>3.1.0</version>
	<executions>
		<execution>
			<id>xjc</id>
			<goals>
				<goal>xjc</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<sources>
			<source>${project.basedir}/src/main/resources/course-details.xsd</source>
		</sources>
		<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
		<clearOutputDir>false</clearOutputDir>
	</configuration>

</plugin>

Key changes to note

  • Version - <version>3.1.0</version>
  • Source Configuration - <sources><source>${project.basedir}/src/main/resources/course-details.xsd</source></sources>

Dependencies for Spring Web Services Security

  • Focus on version <version>3.1.3</version>
  • xws-security and activation dependencies are not needed
<dependency>
	<groupId>org.springframework.ws</groupId>
	<artifactId>spring-ws-security</artifactId>
	<version>3.1.3</version> <!--Added for Spring Boot 3.0.x-->
	<exclusions>
		<exclusion>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
		</exclusion>
	</exclusions>
</dependency>

<!--
<dependency>
	<groupId>com.sun.xml.wss</groupId>
	<artifactId>xws-security</artifactId>
	<version>3.0</version>
	<exclusions>
              <exclusion>
	              <groupId>javax.xml.crypto</groupId>
	              <artifactId>xmldsig</artifactId>
              </exclusion>
	</exclusions>
</dependency>		
<dependency>
	<groupId>javax.activation</groupId>
	<artifactId>activation</artifactId>
	<version>1.1.1</version>
</dependency>
-->

Following dependencies are NOT NEEDED!

XwsSecurityInterceptor Replaced with Wss4jSecurityInterceptor

More details - https://spring.io/blog/2022/12/02/spring-ws-samples-upgraded-for-spring-boot-3-0

NEW CODE FOR Wss4jSecurityInterceptor

	// https://spring.io/blog/2022/12/02/spring-ws-samples-upgraded-for-spring-boot-3-0
	// XwsSecurity has been deprecated in JakartaEE 9+

		//XwsSecurityInterceptor
	//	@Bean
	//	public XwsSecurityInterceptor securityInterceptor(){
	//		XwsSecurityInterceptor securityInterceptor = new XwsSecurityInterceptor();
	//		//Callback Handler -> SimplePasswordValidationCallbackHandler
	//		securityInterceptor.setCallbackHandler(callbackHandler());
	//		//Security Policy -> securityPolicy.xml
	//		securityInterceptor.setPolicyConfiguration(new ClassPathResource("securityPolicy.xml"));
	//		return securityInterceptor;
	//	}

	@Bean
	public Wss4jSecurityInterceptor securityInterceptor() {
		Wss4jSecurityInterceptor securityInterceptor = new Wss4jSecurityInterceptor();
		securityInterceptor.setSecurementActions("UsernameToken");
		securityInterceptor.setSecurementUsername("user");
		securityInterceptor.setSecurementPassword("password");

		return securityInterceptor;
	}
	
	//	@Bean
	//	public SimplePasswordValidationCallbackHandler callbackHandler() {
	//		SimplePasswordValidationCallbackHandler handler = new SimplePasswordValidationCallbackHandler();
	//		handler.setUsersMap(Collections.singletonMap("user", "password"));
	//		return handler;
	//	}