JAX-WS mit javax.jws
Endpoint und Annotationen verwenden den javax-Namespace.
Vollständiger Legacy-Modern-Vergleich aller Java-Klassen, Tests, Maven-POMs und relevanten Ressourcen dieses Moduls. Jede Datei ist genau einmal einer fachlich passenden Vergleichsgruppe zugeordnet.
Endpoint und Annotationen verwenden den javax-Namespace.
Endpoint und Annotationen verwenden die Jakarta-API.
Die Ähnlichkeit ist eine technische Orientierung auf normalisiertem Quelltext. Sie ersetzt keine fachliche Bewertung.
| Vergleichsgruppe | Legacy-Dateien | Modern-Dateien | Legacy-Zeilen | Modern-Zeilen | Ähnlichkeit |
|---|---|---|---|---|---|
| Build-Konfiguration | 1 | 1 | 46 | 46 | 43% |
| SOAP-Endpunkt und Test | 2 | 2 | 25 | 25 | 93% |
| Bootstrap | 1 | 1 | 16 | 16 | 75% |
Das Pair-POM bindet die Legacy- und Modern-Submodule zusammen und gehört deshalb ebenfalls zur vollständigen Codeabdeckung.
javax-/Jakarta-Webservice-Abhängigkeiten werden verglichen.
| Legacy-Dateien | Modern-Dateien | Einordnung |
|---|---|---|
| pom.xml | pom.xml | Direktvergleich Semantische Ähnlichkeit: 43% |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.aydin.academy</groupId>
<artifactId>10soap-pair</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>soap-legacy</artifactId>
<packaging>jar</packaging>
<name>SOAP Legacy (javax JAX-WS)</name>
<dependencies>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>javax.jws-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>${jaxws.legacy.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.aydin.academy</groupId>
<artifactId>10soap-pair</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>soap-modern</artifactId>
<packaging>jar</packaging>
<name>SOAP Modern (Jakarta XML Web Services)</name>
<dependencies>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>${jaxws.modern.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>Endpoint-Implementierung und Vertragstest werden direkt verglichen.
| Legacy-Dateien | Modern-Dateien | Einordnung |
|---|---|---|
| LegacyCalculatorEndpoint.java LegacyCalculatorEndpointTest.java | ModernCalculatorEndpoint.java ModernCalculatorEndpointTest.java | Direktvergleich Semantische Ähnlichkeit: 93% |
package at.aydin.lab.soap.legacy;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(serviceName = "LegacyCalculatorService")
// Design Pattern: Remote Facade
// Zweck: Eine grobe, stabile SOAP-Schnittstelle schützt die interne Fachlogik.
public class LegacyCalculatorEndpoint {
@WebMethod
public int add(int left, int right) {
return left + right;
}
}package at.aydin.lab.soap.legacy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class LegacyCalculatorEndpointTest {
@Test
void addsNumbers() {
assertEquals(7, new LegacyCalculatorEndpoint().add(3, 4));
}
}package at.aydin.lab.soap.modern;
import jakarta.jws.WebMethod;
import jakarta.jws.WebService;
@WebService(serviceName = "ModernCalculatorService")
// Design Pattern: Remote Facade
// Zweck: Der Vertrag bleibt stabil, während die Laufzeit auf Jakarta migriert wird.
public class ModernCalculatorEndpoint {
@WebMethod
public int add(int left, int right) {
return left + right;
}
}package at.aydin.lab.soap.modern;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class ModernCalculatorEndpointTest {
@Test
void addsNumbers() {
assertEquals(7, new ModernCalculatorEndpoint().add(3, 4));
}
}Publizieren und Starten des Endpunkts werden verglichen.
| Legacy-Dateien | Modern-Dateien | Einordnung |
|---|---|---|
| SoapLegacyApplication.java | SoapModernApplication.java | Direktvergleich Semantische Ähnlichkeit: 75% |
package at.aydin.lab.soap.legacy;
import javax.xml.ws.Endpoint;
public final class SoapLegacyApplication {
private SoapLegacyApplication() {
}
public static void main(String[] args) throws Exception {
Endpoint endpoint = Endpoint.publish("http://localhost:8085/calculator", new LegacyCalculatorEndpoint());
System.out.println("Legacy WSDL: http://localhost:8085/calculator?wsdl");
System.out.println("ENTER beendet den Server.");
System.in.read();
endpoint.stop();
}
}package at.aydin.lab.soap.modern;
import jakarta.xml.ws.Endpoint;
public final class SoapModernApplication {
private SoapModernApplication() {
}
public static void main(String[] args) throws Exception {
Endpoint endpoint = Endpoint.publish("http://localhost:8086/calculator", new ModernCalculatorEndpoint());
System.out.println("Modernes WSDL: http://localhost:8086/calculator?wsdl");
System.out.println("ENTER beendet den Server.");
System.in.read();
endpoint.stop();
}
}