diff --git a/pom.xml b/pom.xml
index 6c30b28b..01517b9b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,7 @@
UTF-8UTF-80.0.5
+ 0.0.432.33.01.9.22
@@ -117,6 +118,21 @@
+
+
+ io.spring.javaformat
+ spring-javaformat-maven-plugin
+ ${spring-javaformat.version}
+
+
+ validate
+
+ validate
+
+
+
+
+
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/FaultAwareWebServiceMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/FaultAwareWebServiceMessage.java
index 9efb5eb0..7f83e9e5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/FaultAwareWebServiceMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/FaultAwareWebServiceMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,8 +19,9 @@ package org.springframework.ws;
import javax.xml.namespace.QName;
/**
- * Sub-interface of {@link WebServiceMessage} that can contain special Fault messages. Fault messages (such as
- * {@link org.springframework.ws.soap.SoapFault} SOAP Faults) often require different processing rules.
+ * Sub-interface of {@link WebServiceMessage} that can contain special Fault messages.
+ * Fault messages (such as {@link org.springframework.ws.soap.SoapFault} SOAP Faults)
+ * often require different processing rules.
*
* @author Arjen Poutsma
* @see org.springframework.ws.soap.SoapMessage
@@ -30,7 +31,6 @@ public interface FaultAwareWebServiceMessage extends WebServiceMessage {
/**
* Does this message have a fault?
- *
* @return {@code true} if the message has a fault.
* @see #getFaultReason()
*/
@@ -43,9 +43,10 @@ public interface FaultAwareWebServiceMessage extends WebServiceMessage {
/**
* Returns the fault reason message.
- *
- * @return the fault reason message, if any; returns {@code null} when no fault is present.
+ * @return the fault reason message, if any; returns {@code null} when no fault is
+ * present.
* @see #hasFault()
*/
String getFaultReason();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java b/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java
index b73e1f40..a183b39b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/InvalidXmlException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,8 +17,8 @@
package org.springframework.ws;
/**
- * Exception thrown when a {@link WebServiceMessageFactory} cannot parse the XML passed on to
- * {@link WebServiceMessageFactory#createWebServiceMessage(java.io.InputStream)}.
+ * Exception thrown when a {@link WebServiceMessageFactory} cannot parse the XML passed on
+ * to {@link WebServiceMessageFactory#createWebServiceMessage(java.io.InputStream)}.
*
* @author Arjen Poutsma
* @since 2.0.4
@@ -29,4 +29,5 @@ public final class InvalidXmlException extends WebServiceException {
public InvalidXmlException(String msg, Throwable ex) {
super(msg, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java b/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java
index 88e8ba46..410e4ac3 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/NoEndpointFoundException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,4 +28,5 @@ public final class NoEndpointFoundException extends WebServiceException {
public NoEndpointFoundException(WebServiceMessage request) {
super("No endpoint can be found for request [" + request + "]");
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java
index 6be4f4e5..33d432db 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public abstract class WebServiceException extends NestedRuntimeException {
/**
* Create a new instance of the {@code WebServiceException} class.
- *
* @param msg the detail message
*/
public WebServiceException(String msg) {
@@ -38,7 +37,6 @@ public abstract class WebServiceException extends NestedRuntimeException {
/**
* Create a new instance of the {@code WebServiceException} class.
- *
* @param msg the detail message
* @param ex the root {@link Throwable exception}
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessage.java
index c75ed0f5..677427e7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,8 +37,8 @@ public interface WebServiceMessage {
/**
* Returns the contents of the message as a {@link Source}.
*
- * Depending on the implementation, this can be retrieved multiple times, or just a single time.
- *
+ * Depending on the implementation, this can be retrieved multiple times, or just a
+ * single time.
* @return the message contents
*/
Source getPayloadSource();
@@ -48,8 +48,8 @@ public interface WebServiceMessage {
*
* Calling this method removes the current payload.
*
- * Implementations that are read-only will throw an {@link UnsupportedOperationException}.
- *
+ * Implementations that are read-only will throw an
+ * {@link UnsupportedOperationException}.
* @return the message contents
* @throws UnsupportedOperationException if the message is read-only
*/
@@ -58,9 +58,9 @@ public interface WebServiceMessage {
/**
* Writes the entire message to the given output stream.
*
- * If the given stream is an instance of {@link org.springframework.ws.transport.TransportOutputStream}, the
- * corresponding headers will be written as well.
- *
+ * If the given stream is an instance of
+ * {@link org.springframework.ws.transport.TransportOutputStream}, the corresponding
+ * headers will be written as well.
* @param outputStream the stream to write to
* @throws IOException if an I/O exception occurs
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java
index 689e981c..ff51413d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@ public abstract class WebServiceMessageException extends WebServiceException {
public WebServiceMessageException(String msg, Throwable ex) {
super(msg, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java
index 370db05c..031c6aac 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,8 +20,8 @@ import java.io.IOException;
import java.io.InputStream;
/**
- * The {@code WebServiceMessageFactory} serves as a factory for {@link org.springframework.ws.WebServiceMessage
- * WebServiceMessages}.
+ * The {@code WebServiceMessageFactory} serves as a factory for
+ * {@link org.springframework.ws.WebServiceMessage WebServiceMessages}.
*
* Allows the creation of empty messages, or messages based on {@code InputStream}s.
*
@@ -33,7 +33,6 @@ public interface WebServiceMessageFactory {
/**
* Creates a new, empty {@code WebServiceMessage}.
- *
* @return the empty message
*/
WebServiceMessage createWebServiceMessage();
@@ -41,9 +40,9 @@ public interface WebServiceMessageFactory {
/**
* Reads a {@link WebServiceMessage} from the given input stream.
*
- * If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream
- * TransportInputStream}, the headers will be read from the request.
- *
+ * If the given stream is an instance of
+ * {@link org.springframework.ws.transport.TransportInputStream TransportInputStream},
+ * the headers will be read from the request.
* @param inputStream the input stream to read the message from
* @return the created message
* @throws InvalidXmlException if the XML read from the input stream is invalid
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java
index 273f09a0..39a77bf5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceClientException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public abstract class WebServiceClientException extends WebServiceException {
/**
* Create a new instance of the {@code WebServiceClientException} class.
- *
* @param msg the detail message
*/
public WebServiceClientException(String msg) {
@@ -38,7 +37,6 @@ public abstract class WebServiceClientException extends WebServiceException {
/**
* Create a new instance of the {@code WebServiceClientException} class.
- *
* @param msg the detail message
* @param ex the root {@link Throwable exception}
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java
index cedb7b0c..18c9c535 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceFaultException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,7 +37,6 @@ public class WebServiceFaultException extends WebServiceClientException {
/**
* Create a new instance of the {@code WebServiceFaultException} class.
- *
* @param faultMessage the fault message
*/
public WebServiceFaultException(FaultAwareWebServiceMessage faultMessage) {
@@ -49,4 +48,5 @@ public class WebServiceFaultException extends WebServiceClientException {
public FaultAwareWebServiceMessage getWebServiceMessage() {
return faultMessage;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java
index 517cff09..5003d62e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceIOException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public class WebServiceIOException extends WebServiceClientException {
/**
* Create a new instance of the {@code WebServiceIOException} class.
- *
* @param msg the detail message
*/
public WebServiceIOException(String msg) {
@@ -38,7 +37,6 @@ public class WebServiceIOException extends WebServiceClientException {
/**
* Create a new instance of the {@code WebServiceIOException} class.
- *
* @param msg the detail message
* @param ex the root {@link IOException}
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java
index 94fcdaf2..14dc5e66 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransformerException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public class WebServiceTransformerException extends WebServiceClientException {
/**
* Create a new instance of the {@code WebServiceTransformerException} class.
- *
* @param msg the detail message
*/
public WebServiceTransformerException(String msg) {
@@ -38,7 +37,6 @@ public class WebServiceTransformerException extends WebServiceClientException {
/**
* Create a new instance of the {@code WebServiceTransformerException} class.
- *
* @param msg the detail message
* @param ex the root {@link Throwable exception}
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java
index 74abcccb..891d95de 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/WebServiceTransportException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public class WebServiceTransportException extends WebServiceIOException {
/**
* Create a new instance of the {@code WebServiceTransportException} class.
- *
* @param msg the detail message
*/
public WebServiceTransportException(String msg) {
@@ -38,7 +37,6 @@ public class WebServiceTransportException extends WebServiceIOException {
/**
* Create a new instance of the {@code WebServiceTransportException} class.
- *
* @param msg the detail message
* @param ex the root {@link TransportException}
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/FaultMessageResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/FaultMessageResolver.java
index 32701e07..c7b07351 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/FaultMessageResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/FaultMessageResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,7 +30,6 @@ public interface FaultMessageResolver {
/**
* Try to resolve the given fault message that got received.
- *
* @param message the fault message
*/
void resolveFault(WebServiceMessage message) throws IOException;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java
index 31003eb2..131c0420 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SimpleFaultMessageResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,8 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.client.WebServiceFaultException;
/**
- * Simple fault resolver that simply throws a {@link WebServiceFaultException} when a fault occurs.
+ * Simple fault resolver that simply throws a {@link WebServiceFaultException} when a
+ * fault occurs.
*
* @author Arjen Poutsma
* @see WebServiceFaultException
@@ -34,8 +35,10 @@ public class SimpleFaultMessageResolver implements FaultMessageResolver {
public void resolveFault(WebServiceMessage message) {
if (message instanceof FaultAwareWebServiceMessage) {
throw new WebServiceFaultException((FaultAwareWebServiceMessage) message);
- } else {
+ }
+ else {
throw new WebServiceFaultException("Message has unknown fault: " + message);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SourceExtractor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SourceExtractor.java
index 43720b9a..ea732050 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/SourceExtractor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/SourceExtractor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,15 +22,17 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
/**
- * Callback interface for extracting a result object from a {@link javax.xml.transform.Source} instance.
+ * Callback interface for extracting a result object from a
+ * {@link javax.xml.transform.Source} instance.
*
- * Used for output object creation in {@link WebServiceTemplate}. Alternatively, output sources can also be returned to
- * client code as-is. In case of a source as execution result, you will almost always want to implement a
- * {@code SourceExtractor}, to be able to read the message content in a managed fashion, with the connection still open
- * while reading the message.
+ * Used for output object creation in {@link WebServiceTemplate}. Alternatively, output
+ * sources can also be returned to client code as-is. In case of a source as execution
+ * result, you will almost always want to implement a {@code SourceExtractor}, to be able
+ * to read the message content in a managed fashion, with the connection still open while
+ * reading the message.
*
- * Implementations of this interface perform the actual work of extracting results, but don't need to worry about
- * exception handling, or resource handling.
+ * Implementations of this interface perform the actual work of extracting results, but
+ * don't need to worry about exception handling, or resource handling.
*
* @author Arjen Poutsma
* @see org.springframework.ws.client.core.WebServiceTemplate
@@ -39,11 +41,11 @@ import javax.xml.transform.TransformerException;
public interface SourceExtractor {
/**
- * Process the data in the given {@code Source}, creating a corresponding result object.
- *
+ * Process the data in the given {@code Source}, creating a corresponding result
+ * object.
* @param source the message payload to extract data from
- * @return an arbitrary result object, or {@code null} if none (the extractor will typically be stateful in the latter
- * case)
+ * @return an arbitrary result object, or {@code null} if none (the extractor will
+ * typically be stateful in the latter case)
* @throws IOException in case of I/O errors
*/
T extractData(Source source) throws IOException, TransformerException;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageCallback.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageCallback.java
index 9c41f0bf..c34a5caf 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageCallback.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageCallback.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,8 +25,8 @@ import org.springframework.ws.WebServiceMessage;
/**
* Generic callback interface for code that operates on a {@link WebServiceMessage}.
*
- * Implementations can execute any number of operations on the message, such as set the contents of the message, or set
- * the {@code SOAPAction} header.
+ * Implementations can execute any number of operations on the message, such as set the
+ * contents of the message, or set the {@code SOAPAction} header.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -35,7 +35,6 @@ public interface WebServiceMessageCallback {
/**
* Execute any number of operations on the supplied {@code message}.
- *
* @param message the message
* @throws IOException in case of I/O errors
* @throws TransformerException in case of transformation errors
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageExtractor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageExtractor.java
index 4d3352f8..14ce76d7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageExtractor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceMessageExtractor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,15 +23,17 @@ import javax.xml.transform.TransformerException;
import org.springframework.ws.WebServiceMessage;
/**
- * Callback interface for extracting a result object from a {@link WebServiceMessage} instance.
+ * Callback interface for extracting a result object from a {@link WebServiceMessage}
+ * instance.
*
- * Used for output object creation in {@link WebServiceTemplate}. Alternatively, output messages can also be returned to
- * client code as-is. In case of a message as execution result, you will almost always want to implement a
- * {@code WebServiceMessageExtractor}, to be able to read the message in a managed fashion, with the connection still
- * open while reading the message.
+ * Used for output object creation in {@link WebServiceTemplate}. Alternatively, output
+ * messages can also be returned to client code as-is. In case of a message as execution
+ * result, you will almost always want to implement a {@code WebServiceMessageExtractor},
+ * to be able to read the message in a managed fashion, with the connection still open
+ * while reading the message.
*
- * Implementations of this interface perform the actual work of extracting results, but don't need to worry about
- * exception handling, or resource handling.
+ * Implementations of this interface perform the actual work of extracting results, but
+ * don't need to worry about exception handling, or resource handling.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -39,11 +41,11 @@ import org.springframework.ws.WebServiceMessage;
public interface WebServiceMessageExtractor {
/**
- * Process the data in the given {@code WebServiceMessage}, creating a corresponding result object.
- *
+ * Process the data in the given {@code WebServiceMessage}, creating a corresponding
+ * result object.
* @param message the message to extract data from (possibly a {@code SoapMessage})
- * @return an arbitrary result object, or {@code null} if none (the extractor will typically be stateful in the latter
- * case)
+ * @return an arbitrary result object, or {@code null} if none (the extractor will
+ * typically be stateful in the latter case)
* @throws IOException in case of I/O errors
* @throws TransformerException in case of transformation errors
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceOperations.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceOperations.java
index 12320f25..8ee2171e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceOperations.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceOperations.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,9 @@ import org.springframework.oxm.XmlMappingException;
import org.springframework.ws.client.WebServiceClientException;
/**
- * Specifies a basic set of Web service operations. Implemented by {@link WebServiceTemplate}. Not often used directly,
- * but a useful option to enhance testability, as it can easily be mocked or stubbed.
+ * Specifies a basic set of Web service operations. Implemented by
+ * {@link WebServiceTemplate}. Not often used directly, but a useful option to enhance
+ * testability, as it can easily be mocked or stubbed.
*
* @author Arjen Poutsma
* @see WebServiceTemplate
@@ -33,55 +34,61 @@ import org.springframework.ws.client.WebServiceClientException;
public interface WebServiceOperations {
/**
- * Sends a web service message that can be manipulated with the given callback, reading the result with a
- * {@code WebServiceMessageExtractor}.
+ * Sends a web service message that can be manipulated with the given callback,
+ * reading the result with a {@code WebServiceMessageExtractor}.
*
* This will only work with a default uri specified!
- *
- * @param requestCallback the requestCallback to be used for manipulating the request message
+ * @param requestCallback the requestCallback to be used for manipulating the request
+ * message
* @param responseExtractor object that will extract results
- * @return an arbitrary result object, as returned by the {@code WebServiceMessageExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @return an arbitrary result object, as returned by the
+ * {@code WebServiceMessageExtractor}
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor)
throws WebServiceClientException;
/**
- * Sends a web service message that can be manipulated with the given callback, reading the result with a
- * {@code WebServiceMessageExtractor}.
- *
+ * Sends a web service message that can be manipulated with the given callback,
+ * reading the result with a {@code WebServiceMessageExtractor}.
* @param uri the URI to send the message to
- * @param requestCallback the requestCallback to be used for manipulating the request message
+ * @param requestCallback the requestCallback to be used for manipulating the request
+ * message
* @param responseExtractor object that will extract results
- * @return an arbitrary result object, as returned by the {@code WebServiceMessageExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @return an arbitrary result object, as returned by the
+ * {@code WebServiceMessageExtractor}
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendAndReceive(String uri, WebServiceMessageCallback requestCallback,
WebServiceMessageExtractor responseExtractor) throws WebServiceClientException;
/**
- * Sends a web service message that can be manipulated with the given request callback, handling the response with a
- * response callback.
+ * Sends a web service message that can be manipulated with the given request
+ * callback, handling the response with a response callback.
*
* This will only work with a default uri specified!
- *
* @param requestCallback the callback to be used for manipulating the request message
- * @param responseCallback the callback to be used for manipulating the response message
+ * @param responseCallback the callback to be used for manipulating the response
+ * message
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback)
throws WebServiceClientException;
/**
- * Sends a web service message that can be manipulated with the given request callback, handling the response with a
- * response callback.
- *
+ * Sends a web service message that can be manipulated with the given request
+ * callback, handling the response with a response callback.
* @param uri the URI to send the message to
* @param requestCallback the callback to be used for manipulating the request message
- * @param responseCallback the callback to be used for manipulating the response message
+ * @param responseCallback the callback to be used for manipulating the response
+ * message
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendAndReceive(String uri, WebServiceMessageCallback requestCallback,
WebServiceMessageCallback responseCallback) throws WebServiceClientException;
@@ -91,46 +98,53 @@ public interface WebServiceOperations {
// -----------------------------------------------------------------------------------------------------------------
/**
- * Sends a web service message that contains the given payload, marshalled by the configured {@code Marshaller}.
- * Returns the unmarshalled payload of the response message, if any.
+ * Sends a web service message that contains the given payload, marshalled by the
+ * configured {@code Marshaller}. Returns the unmarshalled payload of the response
+ * message, if any.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the object to marshal into the request message payload
- * @return the unmarshalled payload of the response message, or {@code null} if no response is given
+ * @return the unmarshalled payload of the response message, or {@code null} if no
+ * response is given
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
Object marshalSendAndReceive(Object requestPayload) throws XmlMappingException, WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, marshalled by the configured {@code Marshaller}.
- * Returns the unmarshalled payload of the response message, if any.
- *
+ * Sends a web service message that contains the given payload, marshalled by the
+ * configured {@code Marshaller}. Returns the unmarshalled payload of the response
+ * message, if any.
* @param uri the URI to send the message to
* @param requestPayload the object to marshal into the request message payload
- * @return the unmarshalled payload of the response message, or {@code null} if no response is given
+ * @return the unmarshalled payload of the response message, or {@code null} if no
+ * response is given
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
- Object marshalSendAndReceive(String uri, Object requestPayload) throws XmlMappingException, WebServiceClientException;
+ Object marshalSendAndReceive(String uri, Object requestPayload)
+ throws XmlMappingException, WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, marshalled by the configured {@code Marshaller}.
- * Returns the unmarshalled payload of the response message, if any. The given callback allows changing of the request
- * message after the payload has been marshalled to it.
+ * Sends a web service message that contains the given payload, marshalled by the
+ * configured {@code Marshaller}. Returns the unmarshalled payload of the response
+ * message, if any. The given callback allows changing of the request message after
+ * the payload has been marshalled to it.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the object to marshal into the request message payload
* @param requestCallback callback to change message, can be {@code null}
- * @return the unmarshalled payload of the response message, or {@code null} if no response is given
+ * @return the unmarshalled payload of the response message, or {@code null} if no
+ * response is given
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
@@ -138,16 +152,18 @@ public interface WebServiceOperations {
throws XmlMappingException, WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, marshalled by the configured {@code Marshaller}.
- * Returns the unmarshalled payload of the response message, if any. The given callback allows changing of the request
- * message after the payload has been marshalled to it.
- *
+ * Sends a web service message that contains the given payload, marshalled by the
+ * configured {@code Marshaller}. Returns the unmarshalled payload of the response
+ * message, if any. The given callback allows changing of the request message after
+ * the payload has been marshalled to it.
* @param uri the URI to send the message to
* @param requestPayload the object to marshal into the request message payload
* @param requestCallback callback to change message, can be {@code null}
- * @return the unmarshalled payload of the response message, or {@code null} if no response is given
+ * @return the unmarshalled payload of the response message, or {@code null} if no
+ * response is given
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
@@ -159,57 +175,63 @@ public interface WebServiceOperations {
// -----------------------------------------------------------------------------------------------------------------
/**
- * Sends a web service message that contains the given payload, reading the result with a {@code SourceExtractor}.
+ * Sends a web service message that contains the given payload, reading the result
+ * with a {@code SourceExtractor}.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the payload of the request message
* @param responseExtractor object that will extract results
* @return an arbitrary result object, as returned by the {@code SourceExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendSourceAndReceive(Source requestPayload, SourceExtractor responseExtractor)
throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, reading the result with a {@code SourceExtractor}.
- *
+ * Sends a web service message that contains the given payload, reading the result
+ * with a {@code SourceExtractor}.
* @param uri the URI to send the message to
* @param requestPayload the payload of the request message
* @param responseExtractor object that will extract results
* @return an arbitrary result object, as returned by the {@code SourceExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendSourceAndReceive(String uri, Source requestPayload, SourceExtractor responseExtractor)
throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, reading the result with a {@code SourceExtractor}.
+ * Sends a web service message that contains the given payload, reading the result
+ * with a {@code SourceExtractor}.
*
- * The given callback allows changing of the request message after the payload has been written to it.
+ * The given callback allows changing of the request message after the payload has
+ * been written to it.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the payload of the request message
* @param requestCallback callback to change message, can be {@code null}
* @param responseExtractor object that will extract results
* @return an arbitrary result object, as returned by the {@code SourceExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendSourceAndReceive(Source requestPayload, WebServiceMessageCallback requestCallback,
SourceExtractor responseExtractor) throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload, reading the result with a {@code SourceExtractor}.
+ * Sends a web service message that contains the given payload, reading the result
+ * with a {@code SourceExtractor}.
*
- * The given callback allows changing of the request message after the payload has been written to it.
- *
+ * The given callback allows changing of the request message after the payload has
+ * been written to it.
* @param uri the URI to send the message to
* @param requestPayload the payload of the request message
* @param requestCallback callback to change message, can be {@code null}
* @param responseExtractor object that will extract results
* @return an arbitrary result object, as returned by the {@code SourceExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
T sendSourceAndReceive(String uri, Source requestPayload, WebServiceMessageCallback requestCallback,
SourceExtractor responseExtractor) throws WebServiceClientException;
@@ -219,60 +241,62 @@ public interface WebServiceOperations {
// -----------------------------------------------------------------------------------------------------------------
/**
- * Sends a web service message that contains the given payload. Writes the response, if any, to the given
- * {@code Result}.
+ * Sends a web service message that contains the given payload. Writes the response,
+ * if any, to the given {@code Result}.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the payload of the request message
* @param responseResult the result to write the response payload to
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendSourceAndReceiveToResult(Source requestPayload, Result responseResult) throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload. Writes the response, if any, to the given
- * {@code Result}.
- *
+ * Sends a web service message that contains the given payload. Writes the response,
+ * if any, to the given {@code Result}.
* @param uri the URI to send the message to
* @param requestPayload the payload of the request message
* @param responseResult the result to write the response payload to
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, Result responseResult)
throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload. Writes the response, if any, to the given
- * {@code Result}.
+ * Sends a web service message that contains the given payload. Writes the response,
+ * if any, to the given {@code Result}.
*
- * The given callback allows changing of the request message after the payload has been written to it.
+ * The given callback allows changing of the request message after the payload has
+ * been written to it.
*
* This will only work with a default uri specified!
- *
* @param requestPayload the payload of the request message
* @param requestCallback callback to change message, can be {@code null}
* @param responseResult the result to write the response payload to
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendSourceAndReceiveToResult(Source requestPayload, WebServiceMessageCallback requestCallback,
Result responseResult) throws WebServiceClientException;
/**
- * Sends a web service message that contains the given payload. Writes the response, if any, to the given
- * {@code Result}.
+ * Sends a web service message that contains the given payload. Writes the response,
+ * if any, to the given {@code Result}.
*
- * The given callback allows changing of the request message after the payload has been written to it.
- *
+ * The given callback allows changing of the request message after the payload has
+ * been written to it.
* @param uri the URI to send the message to
* @param requestPayload the payload of the request message
* @param requestCallback callback to change message, can be {@code null}
* @param responseResult the result to write the response payload to
* @return {@code true} if a response was received; {@code false} otherwise
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
*/
boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, WebServiceMessageCallback requestCallback,
Result responseResult) throws WebServiceClientException;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java
index 9eefaec8..c53a8c2b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/WebServiceTemplate.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,10 +22,15 @@ import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import javax.xml.transform.*;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
@@ -57,47 +62,57 @@ import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender;
import org.springframework.ws.transport.support.TransportUtils;
/**
- * The central class for client-side Web services. It provides a message-driven approach to sending and
- * receiving {@link WebServiceMessage} instances.
+ * The central class for client-side Web services. It provides a
+ * message-driven approach to sending and receiving {@link WebServiceMessage} instances.
*
- * Code using this class need only implement callback interfaces, provide {@link Source} objects to read data from, or
- * use the pluggable {@link Marshaller} support. For invoking the {@link #marshalSendAndReceive marshalling methods},
- * the {@link #setMarshaller(Marshaller) marshaller} and {@link #setUnmarshaller(Unmarshaller) unmarshaller} properties
- * must be set.
+ * Code using this class need only implement callback interfaces, provide {@link Source}
+ * objects to read data from, or use the pluggable {@link Marshaller} support. For
+ * invoking the {@link #marshalSendAndReceive marshalling methods}, the
+ * {@link #setMarshaller(Marshaller) marshaller} and {@link #setUnmarshaller(Unmarshaller)
+ * unmarshaller} properties must be set.
*
- * This template uses a {@link SoapFaultMessageResolver} to handle fault response messages. Another
- * {@link FaultMessageResolver} can be defined with with {@link #setFaultMessageResolver(FaultMessageResolver)
- * faultMessageResolver} property. If this property is set to {@code null}, no fault resolving is performed.
+ * This template uses a {@link SoapFaultMessageResolver} to handle fault response
+ * messages. Another {@link FaultMessageResolver} can be defined with with
+ * {@link #setFaultMessageResolver(FaultMessageResolver) faultMessageResolver} property.
+ * If this property is set to {@code null}, no fault resolving is performed.
*
* This template uses the following algorithm for sending and receiving.
*
Call {@link WebServiceMessageFactory#createWebServiceMessage() createWebServiceMessage()} on the registered
- * message factory to create a request message.
- *
Invoke {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage()} on the request
- * callback, if any. This step stores content in the request message, based on {@code Source}, marshalling, etc.
- *
Invoke {@link ClientInterceptor#handleRequest(MessageContext) handleRequest()} on the registered
- * {@link #setInterceptors(ClientInterceptor[]) interceptors}. Interceptors are executed in order. If any of the
- * interceptors creates a response message in the message context, skip to step 7.
- *
Call {@link WebServiceConnection#send(WebServiceMessage) send()} on the connection.
- *
Call {@link #hasError(WebServiceConnection,WebServiceMessage) hasError()} to check if the connection has an
- * error. For an HTTP transport, a status code other than {@code 2xx} indicates an error. However, since a status code
- * of 500 can also indicate a SOAP fault, the template verifies whether the error is not a fault.
+ *
Call {@link WebServiceMessageFactory#createWebServiceMessage()
+ * createWebServiceMessage()} on the registered message factory to create a request
+ * message.
+ *
Invoke {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage)
+ * doWithMessage()} on the request callback, if any. This step stores content in the
+ * request message, based on {@code Source}, marshalling, etc.
+ *
Invoke {@link ClientInterceptor#handleRequest(MessageContext) handleRequest()} on
+ * the registered {@link #setInterceptors(ClientInterceptor[]) interceptors}. Interceptors
+ * are executed in order. If any of the interceptors creates a response message in the
+ * message context, skip to step 7.
+ *
Call {@link WebServiceConnection#send(WebServiceMessage) send()} on the
+ * connection.
+ *
Call {@link #hasError(WebServiceConnection,WebServiceMessage) hasError()} to check
+ * if the connection has an error. For an HTTP transport, a status code other than
+ * {@code 2xx} indicates an error. However, since a status code of 500 can also indicate a
+ * SOAP fault, the template verifies whether the error is not a fault.
*
- *
If the connection has an error, call the {@link #handleError handleError()} method, which by default throws a
- * {@link WebServiceTransportException}.
+ *
If the connection has an error, call the {@link #handleError handleError()} method,
+ * which by default throws a {@link WebServiceTransportException}.
*
If the connection has no error, continue with the next step.
*
- *
Invoke {@link WebServiceConnection#receive(WebServiceMessageFactory) receive} on the connection to read the
- * response message, if any.
+ *
Invoke {@link WebServiceConnection#receive(WebServiceMessageFactory) receive} on
+ * the connection to read the response message, if any.
*
*
If no response was received, return {@code null} or {@code false}
- *
Call {@link #hasFault(WebServiceConnection,WebServiceMessage) hasFault()} to determine whether the response has a
- * fault. If it has, call {@link ClientInterceptor#handleFault(MessageContext)} and the {@link #handleFault
+ *
Call {@link #hasFault(WebServiceConnection,WebServiceMessage) hasFault()} to
+ * determine whether the response has a fault. If it has, call
+ * {@link ClientInterceptor#handleFault(MessageContext)} and the {@link #handleFault
* handleFault()} method.
*
Otherwise, invoke {@link ClientInterceptor#handleResponse(MessageContext)} and
- * {@link WebServiceMessageExtractor#extractData(WebServiceMessage) extractData()} on the response extractor, or
- * {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage} on the response callback.
+ * {@link WebServiceMessageExtractor#extractData(WebServiceMessage) extractData()} on the
+ * response extractor, or
+ * {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage} on the
+ * response callback.
*
*
Call to {@link WebServiceConnection#close() close} on the connection.
*
@@ -112,11 +127,11 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/** Additional logger to use for sent message tracing. */
protected static final Log sentMessageTracingLogger = LogFactory
- .getLog(WebServiceTemplate.MESSAGE_TRACING_LOG_CATEGORY + ".sent");
+ .getLog(WebServiceTemplate.MESSAGE_TRACING_LOG_CATEGORY + ".sent");
/** Additional logger to use for received message tracing. */
protected static final Log receivedMessageTracingLogger = LogFactory
- .getLog(WebServiceTemplate.MESSAGE_TRACING_LOG_CATEGORY + ".received");
+ .getLog(WebServiceTemplate.MESSAGE_TRACING_LOG_CATEGORY + ".received");
private Marshaller marshaller;
@@ -139,7 +154,6 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/**
* Creates a new {@code WebServiceTemplate} based on the given message factory.
- *
* @param messageFactory the message factory to use
*/
public WebServiceTemplate(WebServiceMessageFactory messageFactory) {
@@ -148,15 +162,15 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Creates a new {@code WebServiceTemplate} with the given marshaller. If the given {@link Marshaller} also implements
- * the {@link Unmarshaller} interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is
- * thrown.
+ * Creates a new {@code WebServiceTemplate} with the given marshaller. If the given
+ * {@link Marshaller} also implements the {@link Unmarshaller} interface, it is used
+ * for both marshalling and unmarshalling. Otherwise, an exception is thrown.
*
- * Note that all {@link Marshaller} implementations in Spring also implement the {@link Unmarshaller} interface, so
- * that you can safely use this constructor.
- *
+ * Note that all {@link Marshaller} implementations in Spring also implement the
+ * {@link Unmarshaller} interface, so that you can safely use this constructor.
* @param marshaller object used as marshaller and unmarshaller
- * @throws IllegalArgumentException when {@code marshaller} does not implement the {@link Unmarshaller} interface
+ * @throws IllegalArgumentException when {@code marshaller} does not implement the
+ * {@link Unmarshaller} interface
* @since 2.0.3
*/
public WebServiceTemplate(Marshaller marshaller) {
@@ -165,7 +179,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller "
+ "interface. Please set an Unmarshaller explicitly by using the "
+ "WebServiceTemplate(Marshaller, Unmarshaller) constructor.");
- } else {
+ }
+ else {
this.setMarshaller(marshaller);
this.setUnmarshaller((Unmarshaller) marshaller);
}
@@ -173,8 +188,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller and unmarshaller.
- *
+ * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller
+ * and unmarshaller.
* @param marshaller the marshaller to use
* @param unmarshaller the unmarshaller to use
* @since 2.0.3
@@ -187,12 +202,15 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
initDefaultStrategies();
}
- /** Returns the default URI to be used on operations that do not have a URI parameter. */
+ /**
+ * Returns the default URI to be used on operations that do not have a URI parameter.
+ */
public String getDefaultUri() {
if (destinationProvider != null) {
URI uri = destinationProvider.getDestination();
return uri != null ? uri.toString() : null;
- } else {
+ }
+ else {
return null;
}
}
@@ -200,8 +218,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/**
* Set the default URI to be used on operations that do not have a URI parameter.
*
- * Typically, either this property is set, or {@link #setDestinationProvider(DestinationProvider)}, but not both.
- *
+ * Typically, either this property is set, or
+ * {@link #setDestinationProvider(DestinationProvider)}, but not both.
* @see #marshalSendAndReceive(Object)
* @see #marshalSendAndReceive(Object,WebServiceMessageCallback)
* @see #sendSourceAndReceiveToResult(Source,Result)
@@ -219,16 +237,20 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
};
}
- /** Returns the destination provider used on operations that do not have a URI parameter. */
+ /**
+ * Returns the destination provider used on operations that do not have a URI
+ * parameter.
+ */
public DestinationProvider getDestinationProvider() {
return destinationProvider;
}
/**
- * Set the destination provider URI to be used on operations that do not have a URI parameter.
+ * Set the destination provider URI to be used on operations that do not have a URI
+ * parameter.
*
- * Typically, either this property is set, or {@link #setDefaultUri(String)}, but not both.
- *
+ * Typically, either this property is set, or {@link #setDefaultUri(String)}, but not
+ * both.
* @see #marshalSendAndReceive(Object)
* @see #marshalSendAndReceive(Object,WebServiceMessageCallback)
* @see #sendSourceAndReceiveToResult(Source,Result)
@@ -268,52 +290,60 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/**
* Sets the fault resolver for this template. Default is the
- * {@link org.springframework.ws.soap.client.core.SoapFaultMessageResolver SoapFaultMessageResolver}, but may be set
- * to {@code null} to disable fault handling.
+ * {@link org.springframework.ws.soap.client.core.SoapFaultMessageResolver
+ * SoapFaultMessageResolver}, but may be set to {@code null} to disable fault
+ * handling.
*/
public void setFaultMessageResolver(FaultMessageResolver faultMessageResolver) {
this.faultMessageResolver = faultMessageResolver;
}
/**
- * Indicates whether the {@linkplain WebServiceConnection#hasError() connection} should be checked for error
- * indicators ({@code true}), or whether these should be ignored ({@code false}). The default is {@code true}.
+ * Indicates whether the {@linkplain WebServiceConnection#hasError() connection}
+ * should be checked for error indicators ({@code true}), or whether these should be
+ * ignored ({@code false}). The default is {@code true}.
*
- * When using an HTTP transport, this property defines whether to check the HTTP response status code is in the 2xx
- * Successful range. Both the SOAP specification and the WS-I Basic Profile define that a Web service must return a
- * "200 OK" or "202 Accepted" HTTP status code for a normal response. Setting this property to {@code false} allows
- * this template to deal with non-conforming services.
- *
+ * When using an HTTP transport, this property defines whether to check the HTTP
+ * response status code is in the 2xx Successful range. Both the SOAP specification
+ * and the WS-I Basic Profile define that a Web service must return a "200 OK" or "202
+ * Accepted" HTTP status code for a normal response. Setting this property to
+ * {@code false} allows this template to deal with non-conforming services.
* @see #hasError(WebServiceConnection, WebServiceMessage)
- * @see SOAP 1.1 specification
- * @see WS-I Basic Profile
+ * @see SOAP 1.1
+ * specification
+ * @see WS-I
+ * Basic Profile
*/
public void setCheckConnectionForError(boolean checkConnectionForError) {
this.checkConnectionForError = checkConnectionForError;
}
/**
- * Indicates whether the {@linkplain FaultAwareWebServiceConnection#hasFault() connection} should be checked for fault
- * indicators ({@code true}), or whether we should rely on the {@link FaultAwareWebServiceMessage#hasFault() message}
- * only ({@code false}). The default is {@code true}.
+ * Indicates whether the {@linkplain FaultAwareWebServiceConnection#hasFault()
+ * connection} should be checked for fault indicators ({@code true}), or whether we
+ * should rely on the {@link FaultAwareWebServiceMessage#hasFault() message} only
+ * ({@code false}). The default is {@code true}.
*
- * When using an HTTP transport, this property defines whether to check the HTTP response status code for fault
- * indicators. Both the SOAP specification and the WS-I Basic Profile define that a Web service must return a "500
- * Internal Server Error" HTTP status code if the response envelope is a Fault. Setting this property to {@code false}
- * allows this template to deal with non-conforming services.
- *
+ * When using an HTTP transport, this property defines whether to check the HTTP
+ * response status code for fault indicators. Both the SOAP specification and the WS-I
+ * Basic Profile define that a Web service must return a "500 Internal Server Error"
+ * HTTP status code if the response envelope is a Fault. Setting this property to
+ * {@code false} allows this template to deal with non-conforming services.
* @see #hasFault(WebServiceConnection,WebServiceMessage)
- * @see SOAP 1.1 specification
- * @see WS-I Basic
- * Profile
+ * @see SOAP 1.1
+ * specification
+ * @see WS-I
+ * Basic Profile
*/
public void setCheckConnectionForFault(boolean checkConnectionForFault) {
this.checkConnectionForFault = checkConnectionForFault;
}
/**
- * Returns the client interceptors to apply to all web service invocations made by this template.
- *
+ * Returns the client interceptors to apply to all web service invocations made by
+ * this template.
* @return array of endpoint interceptors, or {@code null} if none
*/
public ClientInterceptor[] getInterceptors() {
@@ -321,8 +351,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Sets the client interceptors to apply to all web service invocations made by this template.
- *
+ * Sets the client interceptors to apply to all web service invocations made by this
+ * template.
* @param interceptors array of endpoint interceptors, or {@code null} if none
*/
public final void setInterceptors(ClientInterceptor[] interceptors) {
@@ -330,9 +360,10 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Initialize the default implementations for the template's strategies: {@link SoapFaultMessageResolver},
- * {@link org.springframework.ws.soap.saaj.SaajSoapMessageFactory}, and {@link HttpUrlConnectionMessageSender}.
- *
+ * Initialize the default implementations for the template's strategies:
+ * {@link SoapFaultMessageResolver},
+ * {@link org.springframework.ws.soap.saaj.SaajSoapMessageFactory}, and
+ * {@link HttpUrlConnectionMessageSender}.
* @throws BeanInitializationException in case of initalization errors
* @see #setFaultMessageResolver(FaultMessageResolver)
* @see #setMessageFactory(WebServiceMessageFactory)
@@ -394,7 +425,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
if (requestPayload != null) {
Marshaller marshaller = getMarshaller();
if (marshaller == null) {
- throw new IllegalStateException("No marshaller registered. Check configuration of WebServiceTemplate.");
+ throw new IllegalStateException(
+ "No marshaller registered. Check configuration of WebServiceTemplate.");
}
MarshallingUtils.marshal(marshaller, requestPayload, request);
if (requestCallback != null) {
@@ -407,7 +439,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
public Object extractData(WebServiceMessage response) throws IOException {
Unmarshaller unmarshaller = getUnmarshaller();
if (unmarshaller == null) {
- throw new IllegalStateException("No unmarshaller registered. Check configuration of WebServiceTemplate.");
+ throw new IllegalStateException(
+ "No unmarshaller registered. Check configuration of WebServiceTemplate.");
}
return MarshallingUtils.unmarshal(unmarshaller, response);
}
@@ -450,7 +483,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
});
return retVal != null && retVal;
- } catch (TransformerConfigurationException ex) {
+ }
+ catch (TransformerConfigurationException ex) {
throw new WebServiceTransformerException("Could not create transformer", ex);
}
}
@@ -482,7 +516,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
try {
return doSendAndReceive(uri, createTransformer(), requestPayload, requestCallback, responseExtractor);
- } catch (TransformerConfigurationException ex) {
+ }
+ catch (TransformerConfigurationException ex) {
throw new WebServiceTransformerException("Could not create transformer", ex);
}
}
@@ -505,7 +540,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
//
@Override
- public boolean sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback) {
+ public boolean sendAndReceive(WebServiceMessageCallback requestCallback,
+ WebServiceMessageCallback responseCallback) {
return sendAndReceive(getDefaultUri(), requestCallback, responseCallback);
}
@@ -537,32 +573,39 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
MessageContext messageContext = new DefaultMessageContext(getMessageFactory());
return doSendAndReceive(messageContext, connection, requestCallback, responseExtractor);
- } catch (TransportException ex) {
+ }
+ catch (TransportException ex) {
throw new WebServiceTransportException("Could not use transport: " + ex.getMessage(), ex);
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
throw new WebServiceIOException("I/O error: " + ex.getMessage(), ex);
- } finally {
+ }
+ finally {
TransportUtils.closeConnection(connection);
TransportContextHolder.setTransportContext(previousTransportContext);
}
}
/**
- * Sends and receives a {@link MessageContext}. Sends the {@link MessageContext#getRequest() request message}, and
- * received to the {@link MessageContext#getResponse() repsonse message}. Invocates the defined
+ * Sends and receives a {@link MessageContext}. Sends the
+ * {@link MessageContext#getRequest() request message}, and received to the
+ * {@link MessageContext#getResponse() repsonse message}. Invocates the defined
* {@link #setInterceptors(ClientInterceptor[]) interceptors} as part of the process.
- *
* @param messageContext the message context
* @param connection the connection to use
- * @param requestCallback the requestCallback to be used for manipulating the request message
+ * @param requestCallback the requestCallback to be used for manipulating the request
+ * message
* @param responseExtractor object that will extract results
- * @return an arbitrary result object, as returned by the {@code WebServiceMessageExtractor}
- * @throws WebServiceClientException if there is a problem sending or receiving the message
+ * @return an arbitrary result object, as returned by the
+ * {@code WebServiceMessageExtractor}
+ * @throws WebServiceClientException if there is a problem sending or receiving the
+ * message
* @throws IOException in case of I/O errors
*/
@SuppressWarnings("unchecked")
protected T doSendAndReceive(MessageContext messageContext, WebServiceConnection connection,
- WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor) throws IOException {
+ WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor)
+ throws IOException {
int interceptorIndex = -1;
try {
if (requestCallback != null) {
@@ -596,19 +639,23 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
triggerHandleResponse(interceptorIndex, messageContext);
triggerAfterCompletion(interceptorIndex, messageContext, null);
return responseExtractor.extractData(messageContext.getResponse());
- } else {
+ }
+ else {
triggerHandleFault(interceptorIndex, messageContext);
triggerAfterCompletion(interceptorIndex, messageContext, null);
return (T) handleFault(connection, messageContext);
}
- } else {
+ }
+ else {
triggerAfterCompletion(interceptorIndex, messageContext, null);
return null;
}
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
triggerAfterCompletion(interceptorIndex, messageContext, ex);
throw new WebServiceTransformerException("Transformation error: " + ex.getMessage(), ex);
- } catch (RuntimeException | IOException ex) {
+ }
+ catch (RuntimeException | IOException ex) {
// Trigger after-completion for thrown exception.
triggerAfterCompletion(interceptorIndex, messageContext, ex);
throw ex;
@@ -621,7 +668,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
ByteArrayOutputStream os = new ByteArrayOutputStream();
request.writeTo(os);
sentMessageTracingLogger.trace("Sent request [" + os.toString(StandardCharsets.UTF_8) + "]");
- } else if (sentMessageTracingLogger.isDebugEnabled()) {
+ }
+ else if (sentMessageTracingLogger.isDebugEnabled()) {
sentMessageTracingLogger.debug("Sent request [" + request + "]");
}
connection.send(request);
@@ -630,9 +678,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/**
* Determines whether the given connection or message context has an error.
*
- * This implementation checks the {@link WebServiceConnection#hasError() connection} first. If it indicates an error,
- * it makes sure that it is not a {@link FaultAwareWebServiceConnection#hasFault() fault}.
- *
+ * This implementation checks the {@link WebServiceConnection#hasError() connection}
+ * first. If it indicates an error, it makes sure that it is not a
+ * {@link FaultAwareWebServiceConnection#hasFault() fault}.
* @param connection the connection (possibly a {@link FaultAwareWebServiceConnection}
* @param request the response message (possibly a {@link FaultAwareWebServiceMessage}
* @return {@code true} if the connection has an error; {@code false} otherwise
@@ -644,7 +692,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
if (checkConnectionForFault && connection instanceof FaultAwareWebServiceConnection) {
FaultAwareWebServiceConnection faultConnection = (FaultAwareWebServiceConnection) connection;
return !(faultConnection.hasFault() && request instanceof FaultAwareWebServiceMessage);
- } else {
+ }
+ else {
return true;
}
}
@@ -652,12 +701,13 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Handles an error on the given connection. The default implementation throws a {@link WebServiceTransportException}.
- *
+ * Handles an error on the given connection. The default implementation throws a
+ * {@link WebServiceTransportException}.
* @param connection the erroneous connection
* @param request the corresponding request message
* @return the object to be returned from
- * {@link #sendAndReceive(String,WebServiceMessageCallback, WebServiceMessageExtractor)}, if any
+ * {@link #sendAndReceive(String,WebServiceMessageCallback, WebServiceMessageExtractor)},
+ * if any
*/
protected Object handleError(WebServiceConnection connection, WebServiceMessage request) throws IOException {
if (logger.isDebugEnabled()) {
@@ -673,15 +723,19 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
messageContext.getRequest().writeTo(requestStream);
ByteArrayOutputStream responseStream = new ByteArrayOutputStream();
messageContext.getResponse().writeTo(responseStream);
- receivedMessageTracingLogger.trace("Received response [" + responseStream.toString(StandardCharsets.UTF_8) + "] for request ["
- + requestStream.toString(StandardCharsets.UTF_8) + "]");
- } else if (receivedMessageTracingLogger.isDebugEnabled()) {
- receivedMessageTracingLogger.debug("Received response [" + messageContext.getResponse() + "] for request ["
- + messageContext.getRequest() + "]");
+ receivedMessageTracingLogger
+ .trace("Received response [" + responseStream.toString(StandardCharsets.UTF_8) + "] for request ["
+ + requestStream.toString(StandardCharsets.UTF_8) + "]");
}
- } else {
+ else if (receivedMessageTracingLogger.isDebugEnabled()) {
+ receivedMessageTracingLogger.debug("Received response [" + messageContext.getResponse()
+ + "] for request [" + messageContext.getRequest() + "]");
+ }
+ }
+ else {
if (receivedMessageTracingLogger.isDebugEnabled()) {
- receivedMessageTracingLogger.debug("Received no response for request [" + messageContext.getRequest() + "]");
+ receivedMessageTracingLogger
+ .debug("Received no response for request [" + messageContext.getRequest() + "]");
}
}
}
@@ -689,13 +743,15 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
/**
* Determines whether the given connection or message has a fault.
*
- * This implementation checks the {@link FaultAwareWebServiceConnection#hasFault() connection} if the
- * {@link #setCheckConnectionForFault(boolean) checkConnectionForFault} property is true, and defaults to the
+ * This implementation checks the {@link FaultAwareWebServiceConnection#hasFault()
+ * connection} if the {@link #setCheckConnectionForFault(boolean)
+ * checkConnectionForFault} property is true, and defaults to the
* {@link FaultAwareWebServiceMessage#hasFault() message} otherwise.
- *
* @param connection the connection (possibly a {@link FaultAwareWebServiceConnection}
- * @param response the response message (possibly a {@link FaultAwareWebServiceMessage}
- * @return {@code true} if either the connection or the message has a fault; {@code false} otherwise
+ * @param response the response message (possibly a
+ * {@link FaultAwareWebServiceMessage}
+ * @return {@code true} if either the connection or the message has a fault;
+ * {@code false} otherwise
* @throws IOException in case of I/O errors
*/
protected boolean hasFault(WebServiceConnection connection, WebServiceMessage response) throws IOException {
@@ -707,7 +763,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
}
if (response instanceof FaultAwareWebServiceMessage) {
- // either the connection has a fault, or checkConnectionForFault is false: let's verify the fault
+ // either the connection has a fault, or checkConnectionForFault is false:
+ // let's verify the fault
FaultAwareWebServiceMessage faultMessage = (FaultAwareWebServiceMessage) response;
return faultMessage.hasFault();
}
@@ -715,9 +772,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Trigger handleResponse on the defined ClientInterceptors. Will just invoke said method on all interceptors whose
- * handleRequest invocation returned {@code true}, in addition to the last interceptor who returned {@code false}.
- *
+ * Trigger handleResponse on the defined ClientInterceptors. Will just invoke said
+ * method on all interceptors whose handleRequest invocation returned {@code true}, in
+ * addition to the last interceptor who returned {@code false}.
* @param interceptorIndex index of last interceptor that was called
* @param messageContext the message context, whose request and response are filled
* @see ClientInterceptor#handleResponse(MessageContext)
@@ -734,9 +791,9 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Trigger handleFault on the defined ClientInterceptors. Will just invoke said method on all interceptors whose
- * handleRequest invocation returned {@code true}, in addition to the last interceptor who returned {@code false}.
- *
+ * Trigger handleFault on the defined ClientInterceptors. Will just invoke said method
+ * on all interceptors whose handleRequest invocation returned {@code true}, in
+ * addition to the last interceptor who returned {@code false}.
* @param interceptorIndex index of last interceptor that was called
* @param messageContext the message context, whose request and response are filled
* @see ClientInterceptor#handleResponse(MessageContext)
@@ -753,10 +810,10 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Trigger afterCompletion callbacks on the mapped ClientInterceptors. Will just invoke afterCompletion for all
- * interceptors whose handleRequest invocation has successfully completed and returned true, in addition to the last
- * interceptor who returned {@code false}.
- *
+ * Trigger afterCompletion callbacks on the mapped ClientInterceptors. Will just
+ * invoke afterCompletion for all interceptors whose handleRequest invocation has
+ * successfully completed and returned true, in addition to the last interceptor who
+ * returned {@code false}.
* @param interceptorIndex index of last interceptor that successfully completed
* @param messageContext the message context
* @param ex Exception thrown on handler execution, or {@code null} if none
@@ -772,13 +829,14 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
}
/**
- * Handles an fault in the given response message. The default implementation invokes the {@link FaultMessageResolver
- * fault resolver} if registered, or invokes {@link #handleError(WebServiceConnection, WebServiceMessage)} otherwise.
- *
+ * Handles an fault in the given response message. The default implementation invokes
+ * the {@link FaultMessageResolver fault resolver} if registered, or invokes
+ * {@link #handleError(WebServiceConnection, WebServiceMessage)} otherwise.
* @param connection the faulty connection
* @param messageContext the message context
* @return the object to be returned from
- * {@link #sendAndReceive(String,WebServiceMessageCallback, WebServiceMessageExtractor)}, if any
+ * {@link #sendAndReceive(String,WebServiceMessageCallback, WebServiceMessageExtractor)},
+ * if any
*/
protected Object handleFault(WebServiceConnection connection, MessageContext messageContext) throws IOException {
if (logger.isDebugEnabled()) {
@@ -787,12 +845,16 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
if (getFaultMessageResolver() != null) {
getFaultMessageResolver().resolveFault(messageContext.getResponse());
return null;
- } else {
+ }
+ else {
return handleError(connection, messageContext.getRequest());
}
}
- /** Adapter to enable use of a WebServiceMessageCallback inside a WebServiceMessageExtractor. */
+ /**
+ * Adapter to enable use of a WebServiceMessageCallback inside a
+ * WebServiceMessageExtractor.
+ */
private static class WebServiceMessageCallbackMessageExtractor implements WebServiceMessageExtractor {
private final WebServiceMessageCallback callback;
@@ -806,6 +868,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
callback.doWithMessage(message);
return Boolean.TRUE;
}
+
}
/** Adapter to enable use of a SourceExtractor inside a WebServiceMessageExtractor. */
@@ -821,6 +884,7 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
public T extractData(WebServiceMessage message) throws IOException, TransformerException {
return sourceExtractor.extractData(message.getPayloadSource());
}
+
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java b/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java
index 1cd4ae86..f0b39341 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/core/support/WebServiceGatewaySupport.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,17 +31,22 @@ import org.springframework.ws.transport.WebServiceMessageSender;
/**
* Convenient super class for application classes that need Web service access.
*
- * Requires a {@link WebServiceMessageFactory} or a {@link WebServiceTemplate} instance to be set. It will create its
- * own {@code WebServiceTemplate} if {@code WebServiceMessageFactory} is passed in.
+ * Requires a {@link WebServiceMessageFactory} or a {@link WebServiceTemplate} instance to
+ * be set. It will create its own {@code WebServiceTemplate} if
+ * {@code WebServiceMessageFactory} is passed in.
*
- * In addition to the message factory property, this gateway offers {@link Marshaller} and {@link Unmarshaller}
- * properties. Setting these is required when the {@link WebServiceTemplate#marshalSendAndReceive(Object) marshalling
- * methods} of the template are to be used.
+ * In addition to the message factory property, this gateway offers {@link Marshaller} and
+ * {@link Unmarshaller} properties. Setting these is required when the
+ * {@link WebServiceTemplate#marshalSendAndReceive(Object) marshalling methods} of the
+ * template are to be used.
*
- * Note that when {@link #setWebServiceTemplate(WebServiceTemplate) injecting a {@code WebServiceTemplate}} directly,
- * the convenience setters ({@link #setMarshaller(Marshaller)}, {@link #setUnmarshaller(Unmarshaller)},
- * {@link #setMessageSender(WebServiceMessageSender)}, {@link #setMessageSenders(WebServiceMessageSender[])}, and
- * {@link #setDefaultUri(String)}) should not be used on this class, but on the template directly.
+ * Note that when {@link #setWebServiceTemplate(WebServiceTemplate) injecting a
+ * {@code WebServiceTemplate}} directly, the convenience setters
+ * ({@link #setMarshaller(Marshaller)}, {@link #setUnmarshaller(Unmarshaller)},
+ * {@link #setMessageSender(WebServiceMessageSender)},
+ * {@link #setMessageSenders(WebServiceMessageSender[])}, and
+ * {@link #setDefaultUri(String)}) should not be used on this class, but on the template
+ * directly.
*
* @author Arjen Poutsma
* @see #setMessageFactory(WebServiceMessageFactory)
@@ -57,15 +62,16 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
private WebServiceTemplate webServiceTemplate;
/**
- * Creates a new instance of the {@code WebServiceGatewaySupport} class, with a default {@code WebServiceTemplate}.
+ * Creates a new instance of the {@code WebServiceGatewaySupport} class, with a
+ * default {@code WebServiceTemplate}.
*/
protected WebServiceGatewaySupport() {
webServiceTemplate = new WebServiceTemplate();
}
/**
- * Creates a new {@code WebServiceGatewaySupport} instance based on the given message factory.
- *
+ * Creates a new {@code WebServiceGatewaySupport} instance based on the given message
+ * factory.
* @param messageFactory the message factory to use
*/
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
@@ -125,10 +131,12 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
/**
* Sets the {@code WebServiceTemplate} to be used by the gateway.
*
- * When using this property, the convenience setters ({@link #setMarshaller(Marshaller)},
- * {@link #setUnmarshaller(Unmarshaller)}, {@link #setMessageSender(WebServiceMessageSender)},
- * {@link #setMessageSenders(WebServiceMessageSender[])}, and {@link #setDefaultUri(String)}) should not be set on
- * this class, but on the template directly.
+ * When using this property, the convenience setters
+ * ({@link #setMarshaller(Marshaller)}, {@link #setUnmarshaller(Unmarshaller)},
+ * {@link #setMessageSender(WebServiceMessageSender)},
+ * {@link #setMessageSenders(WebServiceMessageSender[])}, and
+ * {@link #setDefaultUri(String)}) should not be set on this class, but on the
+ * template directly.
*/
public final void setWebServiceTemplate(WebServiceTemplate webServiceTemplate) {
Assert.notNull(webServiceTemplate, "'webServiceTemplate' must not be null");
@@ -141,9 +149,9 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
}
/**
- * Sets the {@code Marshaller} used by the gateway. Setting this property is only required if the marshalling
- * functionality of {@code WebServiceTemplate} is to be used.
- *
+ * Sets the {@code Marshaller} used by the gateway. Setting this property is only
+ * required if the marshalling functionality of {@code WebServiceTemplate} is to be
+ * used.
* @see WebServiceTemplate#marshalSendAndReceive
*/
public final void setMarshaller(Marshaller marshaller) {
@@ -156,9 +164,9 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
}
/**
- * Sets the {@code Unmarshaller} used by the gateway. Setting this property is only required if the marshalling
- * functionality of {@code WebServiceTemplate} is to be used.
- *
+ * Sets the {@code Unmarshaller} used by the gateway. Setting this property is only
+ * required if the marshalling functionality of {@code WebServiceTemplate} is to be
+ * used.
* @see WebServiceTemplate#marshalSendAndReceive
*/
public final void setUnmarshaller(Unmarshaller unmarshaller) {
@@ -182,11 +190,11 @@ public abstract class WebServiceGatewaySupport implements InitializingBean {
}
/**
- * Subclasses can override this for custom initialization behavior. Gets called after population of this instance's
- * bean properties.
- *
+ * Subclasses can override this for custom initialization behavior. Gets called after
+ * population of this instance's bean properties.
* @throws java.lang.Exception if initialization fails
*/
- protected void initGateway() throws Exception {}
+ protected void initGateway() throws Exception {
+ }
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java
index 8529781e..8bd959f5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/WebServiceAccessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,10 +28,12 @@ import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Base class for {@code WebServiceTemplate} and other WS-accessing helpers. Defines common properties like the
- * {@link WebServiceMessageFactory} and {@link WebServiceMessageSender}.
+ * Base class for {@code WebServiceTemplate} and other WS-accessing helpers. Defines
+ * common properties like the {@link WebServiceMessageFactory} and
+ * {@link WebServiceMessageSender}.
*
- * Not intended to be used directly. See {@link org.springframework.ws.client.core.WebServiceTemplate}.
+ * Not intended to be used directly. See
+ * {@link org.springframework.ws.client.core.WebServiceTemplate}.
*
* @author Arjen Poutsma
* @see org.springframework.ws.client.core.WebServiceTemplate
@@ -61,8 +63,8 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
/**
* Sets the single message sender used for sending messages.
*
- * This message sender will be used to resolve an URI to a {@link WebServiceConnection}.
- *
+ * This message sender will be used to resolve an URI to a
+ * {@link WebServiceConnection}.
* @see #createConnection(URI)
*/
public void setMessageSender(WebServiceMessageSender messageSender) {
@@ -73,8 +75,8 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
/**
* Sets the message senders used for sending messages.
*
- * These message senders will be used to resolve an URI to a {@link WebServiceConnection}.
- *
+ * These message senders will be used to resolve an URI to a
+ * {@link WebServiceConnection}.
* @see #createConnection(URI)
*/
public void setMessageSenders(WebServiceMessageSender[] messageSenders) {
@@ -89,12 +91,13 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
}
/**
- * Creates a connection to the given URI, or throws an exception when it cannot be resolved.
+ * Creates a connection to the given URI, or throws an exception when it cannot be
+ * resolved.
*
- * Default implementation iterates over all configured {@link WebServiceMessageSender} objects, and calls
- * {@link WebServiceMessageSender#supports(URI)} for each of them. If the sender supports the parameter URI, it
- * creates a connection using {@link WebServiceMessageSender#createConnection(URI)} .
- *
+ * Default implementation iterates over all configured {@link WebServiceMessageSender}
+ * objects, and calls {@link WebServiceMessageSender#supports(URI)} for each of them.
+ * If the sender supports the parameter URI, it creates a connection using
+ * {@link WebServiceMessageSender#createConnection(URI)} .
* @param uri the URI to open a connection to
* @return the created connection
* @throws IllegalArgumentException when the uri cannot be resolved
@@ -109,7 +112,8 @@ public abstract class WebServiceAccessor extends TransformerObjectSupport implem
if (logger.isDebugEnabled()) {
try {
logger.debug("Opening [" + connection + "] to [" + connection.getUri() + "]");
- } catch (URISyntaxException e) {
+ }
+ catch (URISyntaxException e) {
// ignore
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java
index c9fed4f5..a54a149e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/AbstractCachingDestinationProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,10 +22,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- * Abstract base class for {@link DestinationProvider} implementations that cache destination URI.
+ * Abstract base class for {@link DestinationProvider} implementations that cache
+ * destination URI.
*
- * Caching can be disabled by setting the {@link #setCache(boolean) cache} property to {@code false}; forcing a
- * destination lookup for every call.
+ * Caching can be disabled by setting the {@link #setCache(boolean) cache} property to
+ * {@code false}; forcing a destination lookup for every call.
*
* @author Arjen Poutsma
* @since 1.5.4
@@ -40,9 +41,9 @@ public abstract class AbstractCachingDestinationProvider implements DestinationP
private boolean cache = true;
/**
- * Set whether to cache resolved destinations. Default is {@code true}. This flag can be turned off to re-lookup a
- * destination for each operation, which allows for hot restarting of destinations. This is mainly useful during
- * development.
+ * Set whether to cache resolved destinations. Default is {@code true}. This flag can
+ * be turned off to re-lookup a destination for each operation, which allows for hot
+ * restarting of destinations. This is mainly useful during development.
*/
public void setCache(boolean cache) {
this.cache = cache;
@@ -55,7 +56,8 @@ public abstract class AbstractCachingDestinationProvider implements DestinationP
cachedUri = lookupDestination();
}
return cachedUri;
- } else {
+ }
+ else {
return lookupDestination();
}
}
@@ -63,9 +65,10 @@ public abstract class AbstractCachingDestinationProvider implements DestinationP
/**
* Abstract template method that looks up the URI.
*
- * If {@linkplain #setCache(boolean) caching} is enabled, this method will only be called once.
- *
+ * If {@linkplain #setCache(boolean) caching} is enabled, this method will only be
+ * called once.
* @return the destination URI
*/
protected abstract URI lookupDestination();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvider.java
index cf95afb0..74cebf3b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,11 +19,12 @@ package org.springframework.ws.client.support.destination;
import java.net.URI;
/**
- * Strategy interface for providing a {@link org.springframework.ws.client.core.WebServiceTemplate} destination URI at
+ * Strategy interface for providing a
+ * {@link org.springframework.ws.client.core.WebServiceTemplate} destination URI at
* runtime.
*
- * Typically implemented by providers that use WSDL, a UDDI registry, or some other form to determine the destination
- * URI.
+ * Typically implemented by providers that use WSDL, a UDDI registry, or some other form
+ * to determine the destination URI.
*
* @author Arjen Poutsma
* @see org.springframework.ws.client.core.WebServiceTemplate#setDestinationProvider(DestinationProvider)
@@ -33,7 +34,6 @@ public interface DestinationProvider {
/**
* Return the destination URI.
- *
* @return the destination URI
*/
URI getDestination();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java
index cf5c3654..c7be31a8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/DestinationProvisionException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@ public class DestinationProvisionException extends WebServiceClientException {
public DestinationProvisionException(String msg, Throwable ex) {
super(msg, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProvider.java
index 786af275..04f6eeef 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,6 +26,8 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
+import org.w3c.dom.Document;
+
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.ws.client.WebServiceIOException;
@@ -34,14 +36,15 @@ import org.springframework.xml.transform.ResourceSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
import org.springframework.xml.xpath.XPathExpression;
import org.springframework.xml.xpath.XPathExpressionFactory;
-import org.w3c.dom.Document;
/**
- * Implementation of the {@link DestinationProvider} that resolves a destination URI from a WSDL file.
+ * Implementation of the {@link DestinationProvider} that resolves a destination URI from
+ * a WSDL file.
*
* The extraction relies on an XPath expression to locate the URI. By default, the
- * {@link #DEFAULT_WSDL_LOCATION_EXPRESSION} will be used, but this expression can be overridden by setting the
- * {@link #setLocationExpression(String) locationExpression} property.
+ * {@link #DEFAULT_WSDL_LOCATION_EXPRESSION} will be used, but this expression can be
+ * overridden by setting the {@link #setLocationExpression(String) locationExpression}
+ * property.
*
* @author Tareq Abed Rabbo
* @author Arjen Poutsma
@@ -49,7 +52,10 @@ import org.w3c.dom.Document;
*/
public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvider {
- /** Default XPath expression used for extracting all {@code location} attributes from the WSDL definition. */
+ /**
+ * Default XPath expression used for extracting all {@code location} attributes from
+ * the WSDL definition.
+ */
public static final String DEFAULT_WSDL_LOCATION_EXPRESSION = "/wsdl:definitions/wsdl:service/wsdl:port/soap:address/@location";
private static TransformerFactory transformerFactory = TransformerFactoryUtils.newInstance();
@@ -69,7 +75,10 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
expressionNamespaces);
}
- /** Sets a WSDL location from which the service destination {@code URI} will be resolved. */
+ /**
+ * Sets a WSDL location from which the service destination {@code URI} will be
+ * resolved.
+ */
public void setWsdl(Resource wsdlResource) {
Assert.notNull(wsdlResource, "'wsdl' must not be null");
Assert.isTrue(wsdlResource.exists(), wsdlResource + " does not exist");
@@ -77,7 +86,8 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
}
/**
- * Sets the XPath expression to use when extracting the service location {@code URI} from a WSDL.
+ * Sets the XPath expression to use when extracting the service location {@code URI}
+ * from a WSDL.
*
* The expression can use the following bound prefixes:
*
@@ -119,9 +129,11 @@ public class Wsdl11DestinationProvider extends AbstractCachingDestinationProvide
logger.debug("Found location [" + location + "] in " + wsdlResource);
}
return location != null ? URI.create(location) : null;
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
throw new WebServiceIOException("Error extracting location from WSDL [" + wsdlResource + "]", ex);
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
throw new WebServiceTransformerException("Error extracting location from WSDL [" + wsdlResource + "]", ex);
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java
index a0446f4a..bdb79a0e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/AbstractValidatingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,6 +20,8 @@ import java.io.IOException;
import javax.xml.transform.Source;
+import org.xml.sax.SAXParseException;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
@@ -34,15 +36,15 @@ import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.validation.XmlValidatorFactory;
import org.springframework.xml.xsd.XsdSchema;
import org.springframework.xml.xsd.XsdSchemaCollection;
-import org.xml.sax.SAXParseException;
/**
- * Abstract base class for {@link ClientInterceptor} implementations that validate part of the message using a schema.
- * The exact message part is determined by the {@link #getValidationRequestSource(WebServiceMessage)} and
+ * Abstract base class for {@link ClientInterceptor} implementations that validate part of
+ * the message using a schema. The exact message part is determined by the
+ * {@link #getValidationRequestSource(WebServiceMessage)} and
* {@link #getValidationResponseSource(WebServiceMessage)} template methods.
*
- * By default, only the request message is validated, but this behaviour can be changed using the
- * {@code validateRequest} and {@code validateResponse} properties.
+ * By default, only the request message is validated, but this behaviour can be changed
+ * using the {@code validateRequest} and {@code validateResponse} properties.
*
* @author Arjen Poutsma
* @see #getValidationRequestSource(WebServiceMessage)
@@ -67,8 +69,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Sets the schema language. Default is the W3C XML Schema: {@code http://www.w3.org/2001/XMLSchema"}.
- *
+ * Sets the schema language. Default is the W3C XML Schema:
+ * {@code http://www.w3.org/2001/XMLSchema"}.
* @see XmlValidatorFactory#SCHEMA_W3C_XML
* @see XmlValidatorFactory#SCHEMA_RELAX_NG
*/
@@ -83,8 +85,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the schema resource to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
*/
public void setSchema(Resource schema) {
setSchemas(schema);
@@ -92,8 +95,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the schema resources to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
*/
public void setSchemas(Resource... schemas) {
Assert.notEmpty(schemas, "schemas must not be empty or null");
@@ -106,9 +110,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the {@link XsdSchema} to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
- *
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
* @param schema the xsd schema to use
* @throws java.io.IOException in case of I/O errors
*/
@@ -117,9 +121,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Sets the {@link XsdSchemaCollection} to use for validation. Setting this property, {@link #setXsdSchema(XsdSchema)
- * xsdSchema}, {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is required.
- *
+ * Sets the {@link XsdSchemaCollection} to use for validation. Setting this property,
+ * {@link #setXsdSchema(XsdSchema) xsdSchema}, {@link #setSchema(Resource) schema}, or
+ * {@link #setSchemas(Resource[]) schemas} is required.
* @param schemaCollection the xsd schema collection to use
* @throws java.io.IOException in case of I/O errors
*/
@@ -127,12 +131,18 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
this.validator = schemaCollection.createValidator();
}
- /** Indicates whether the request should be validated against the schema. Default is {@code true}. */
+ /**
+ * Indicates whether the request should be validated against the schema. Default is
+ * {@code true}.
+ */
public void setValidateRequest(boolean validateRequest) {
this.validateRequest = validateRequest;
}
- /** Indicates whether the response should be validated against the schema. Default is {@code false}. */
+ /**
+ * Indicates whether the response should be validated against the schema. Default is
+ * {@code false}.
+ */
public void setValidateResponse(boolean validateResponse) {
this.validateResponse = validateResponse;
}
@@ -153,11 +163,11 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Validates the request message in the given message context. Validation only occurs if
- * {@link #setValidateRequest(boolean) validateRequest} is set to {@code true}, which is the default.
+ * Validates the request message in the given message context. Validation only occurs
+ * if {@link #setValidateRequest(boolean) validateRequest} is set to {@code true},
+ * which is the default.
*
* Returns {@code true} if the request is valid, or {@code false} if it isn't.
- *
* @param messageContext the message context
* @return {@code true} if the message is valid; {@code false} otherwise
* @see #setValidateRequest(boolean)
@@ -170,12 +180,14 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
SAXParseException[] errors;
try {
errors = validator.validate(requestSource);
- } catch (IOException e) {
+ }
+ catch (IOException e) {
throw new WebServiceIOException("Could not validate response: " + e.getMessage(), e);
}
if (!ObjectUtils.isEmpty(errors)) {
return handleRequestValidationErrors(messageContext, errors);
- } else if (logger.isDebugEnabled()) {
+ }
+ else if (logger.isDebugEnabled()) {
logger.debug("Request message validated");
}
}
@@ -186,9 +198,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Template method that is called when the request message contains validation errors.
*
- * Default implementation logs all errors, and throws a {@link WebServiceValidationException}. Subclasses can override
- * this method to customize this behavior.
- *
+ * Default implementation logs all errors, and throws a
+ * {@link WebServiceValidationException}. Subclasses can override this method to
+ * customize this behavior.
* @param messageContext the message context
* @param errors the validation errors
* @return {@code true} to continue processing the request, {@code false} otherwise
@@ -201,12 +213,11 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Validates the response message in the given message context. Validation only occurs if
- * {@link #setValidateResponse(boolean) validateResponse} is set to {@code true}, which is not the
- * default.
+ * Validates the response message in the given message context. Validation only occurs
+ * if {@link #setValidateResponse(boolean) validateResponse} is set to {@code true},
+ * which is not the default.
*
* Returns {@code true} if the request is valid, or {@code false} if it isn't.
- *
* @param messageContext the message context.
* @return {@code true} if the response is valid; {@code false} otherwise
* @see #setValidateResponse(boolean)
@@ -219,12 +230,14 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
SAXParseException[] errors;
try {
errors = validator.validate(responseSource);
- } catch (IOException e) {
+ }
+ catch (IOException e) {
throw new WebServiceIOException("Could not validate response: " + e.getMessage(), e);
}
if (!ObjectUtils.isEmpty(errors)) {
return handleResponseValidationErrors(messageContext, errors);
- } else if (logger.isDebugEnabled()) {
+ }
+ else if (logger.isDebugEnabled()) {
logger.debug("Response message validated");
}
}
@@ -233,14 +246,15 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Template method that is called when the response message contains validation errors.
+ * Template method that is called when the response message contains validation
+ * errors.
*
- * Default implementation logs all errors, and returns {@code false}, i.e. do not cot continue to process the respone
- * interceptor chain.
- *
+ * Default implementation logs all errors, and returns {@code false}, i.e. do not cot
+ * continue to process the respone interceptor chain.
* @param messageContext the message context
* @param errors the validation errors
- * @return {@code true} to continue the reponse interceptor chain, {@code false} (the default) otherwise
+ * @return {@code true} to continue the reponse interceptor chain, {@code false} (the
+ * default) otherwise
*/
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors)
throws WebServiceValidationException {
@@ -258,21 +272,25 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/** Does nothing by default. */
@Override
- public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {}
+ public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {
+ }
/**
- * Abstract template method that returns the part of the request message that is to be validated.
- *
+ * Abstract template method that returns the part of the request message that is to be
+ * validated.
* @param request the request message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
protected abstract Source getValidationRequestSource(WebServiceMessage request);
/**
- * Abstract template method that returns the part of the response message that is to be validated.
- *
+ * Abstract template method that returns the part of the response message that is to
+ * be validated.
* @param response the response message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
protected abstract Source getValidationResponseSource(WebServiceMessage response);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptor.java
index d916df3b..58355b79 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,20 +22,24 @@ import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Workflow interface that allows for customized client-side message interception. Applications can register any number
- * of existing or custom interceptors on a {@link org.springframework.ws.client.core.WebServiceTemplate}, to add common
- * pre- and postprocessing behavior without needing to modify payload handling code.
+ * Workflow interface that allows for customized client-side message interception.
+ * Applications can register any number of existing or custom interceptors on a
+ * {@link org.springframework.ws.client.core.WebServiceTemplate}, to add common pre- and
+ * postprocessing behavior without needing to modify payload handling code.
*
* A {@code ClientInterceptor} gets called after payload creation (using
- * {@link org.springframework.ws.client.core.WebServiceTemplate#marshalSendAndReceive(Object)} or similar methods, and
- * after {@link org.springframework.ws.client.core.WebServiceMessageCallback callback} invocation, but before the
- * message is sent over the {@link WebServiceConnection}. This mechanism can be used for a large field of preprocessing
- * aspects, e.g. for authorization checks, or message header checks. Its main purpose is to allow for factoring out
- * meta-data (i.e. {@link SoapHeader}) related code.
+ * {@link org.springframework.ws.client.core.WebServiceTemplate#marshalSendAndReceive(Object)}
+ * or similar methods, and after
+ * {@link org.springframework.ws.client.core.WebServiceMessageCallback callback}
+ * invocation, but before the message is sent over the {@link WebServiceConnection}. This
+ * mechanism can be used for a large field of preprocessing aspects, e.g. for
+ * authorization checks, or message header checks. Its main purpose is to allow for
+ * factoring out meta-data (i.e. {@link SoapHeader}) related code.
*
- * Client interceptors are defined on a {@link org.springframework.ws.client.core.WebServiceTemplate}, using the
- * {@link org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[]) interceptors}
- * property.
+ * Client interceptors are defined on a
+ * {@link org.springframework.ws.client.core.WebServiceTemplate}, using the
+ * {@link org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[])
+ * interceptors} property.
*
* @author Giovanni Cuccu
* @author Arjen Poutsma
@@ -45,40 +49,41 @@ import org.springframework.ws.transport.WebServiceConnection;
public interface ClientInterceptor {
/**
- * Processes the outgoing request message. Called after payload creation and callback invocation, but before the
- * message is sent.
- *
+ * Processes the outgoing request message. Called after payload creation and callback
+ * invocation, but before the message is sent.
* @param messageContext contains the outgoing request message
- * @return {@code true} to continue processing of the request interceptors; {@code false} to indicate blocking of the
- * request endpoint chain
+ * @return {@code true} to continue processing of the request interceptors;
+ * {@code false} to indicate blocking of the request endpoint chain
* @throws WebServiceClientException in case of errors
* @see MessageContext#getRequest()
*/
boolean handleRequest(MessageContext messageContext) throws WebServiceClientException;
/**
- * Processes the incoming response message. Called for non-fault response messages before payload handling in the
+ * Processes the incoming response message. Called for non-fault response messages
+ * before payload handling in the
* {@link org.springframework.ws.client.core.WebServiceTemplate}.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
- *
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
* @param messageContext contains the outgoing request message
- * @return {@code true} to continue processing of the request interceptors; {@code false} to indicate blocking of the
- * response endpoint chain
+ * @return {@code true} to continue processing of the request interceptors;
+ * {@code false} to indicate blocking of the response endpoint chain
* @throws WebServiceClientException in case of errors
* @see MessageContext#getResponse()
*/
boolean handleResponse(MessageContext messageContext) throws WebServiceClientException;
/**
- * Processes the incoming response fault. Called for response fault messages before payload handling in the
+ * Processes the incoming response fault. Called for response fault messages before
+ * payload handling in the
* {@link org.springframework.ws.client.core.WebServiceTemplate}.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
- *
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
* @param messageContext contains the outgoing request message
- * @return {@code true} to continue processing of the request interceptors; {@code false} to indicate blocking of the
- * request endpoint chain
+ * @return {@code true} to continue processing of the request interceptors;
+ * {@code false} to indicate blocking of the request endpoint chain
* @throws WebServiceClientException in case of errors
* @see MessageContext#getResponse()
* @see org.springframework.ws.FaultAwareWebServiceMessage#hasFault()
@@ -86,12 +91,13 @@ public interface ClientInterceptor {
boolean handleFault(MessageContext messageContext) throws WebServiceClientException;
/**
- * Callback after completion of request and response (fault) processing. Will be called on any outcome, thus allows
- * for proper resource cleanup.
+ * Callback after completion of request and response (fault) processing. Will be
+ * called on any outcome, thus allows for proper resource cleanup.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
- *
- * @param messageContext contains both request and response messages, the response should contains a Fault
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
+ * @param messageContext contains both request and response messages, the response
+ * should contains a Fault
* @param ex exception thrown on handler execution, if any
* @throws WebServiceClientException in case of errors
* @since 2.2
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapter.java
index 59b11261..4ef9fe79 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,8 +21,8 @@ import org.springframework.ws.client.WebServiceClientException;
import org.springframework.ws.context.MessageContext;
/**
- * Default implementation of the {@code ClientInterceptor} interface, for simplified implementation of
- * pre-only/post-only interceptors.
+ * Default implementation of the {@code ClientInterceptor} interface, for simplified
+ * implementation of pre-only/post-only interceptors.
*
* @author Marten Deinum
* @since 2.2.5
@@ -56,4 +56,5 @@ public abstract class ClientInterceptorAdapter implements ClientInterceptor {
public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptor.java
index 07a64431..3e268b79 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,14 +21,16 @@ import javax.xml.transform.Source;
import org.springframework.ws.WebServiceMessage;
/**
- * Client-side interceptor that validates the contents of {@code WebServiceMessage}s using a schema. Allows for both W3C
- * XML and RELAX NG schemas.
+ * Client-side interceptor that validates the contents of {@code WebServiceMessage}s using
+ * a schema. Allows for both W3C XML and RELAX NG schemas.
*
- * When the payload is invalid, this interceptor stops processing of the interceptor chain.
+ * When the payload is invalid, this interceptor stops processing of the interceptor
+ * chain.
*
- * The schema to validate against is set with the {@code schema} property or {@code schemas} property. By default, only
- * the request message is validated, but this behaviour can be changed using the {@code validateRequest} and
- * {@code validateResponse} properties. Responses that contains faults are not validated.
+ * The schema to validate against is set with the {@code schema} property or
+ * {@code schemas} property. By default, only the request message is validated, but this
+ * behaviour can be changed using the {@code validateRequest} and {@code validateResponse}
+ * properties. Responses that contains faults are not validated.
*
* @author Stefan Schmidt
* @author Arjen Poutsma
@@ -42,9 +44,9 @@ public class PayloadValidatingInterceptor extends AbstractValidatingInterceptor
/**
* Returns the part of the request message that is to be validated. Default
- *
* @param request the request message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
@Override
protected Source getValidationRequestSource(WebServiceMessage request) {
@@ -53,12 +55,13 @@ public class PayloadValidatingInterceptor extends AbstractValidatingInterceptor
/**
* Returns the part of the response message that is to be validated.
- *
* @param response the response message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
@Override
protected Source getValidationResponseSource(WebServiceMessage response) {
return response.getPayloadSource();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java
index 5d511170..1fd25958 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/client/support/interceptor/WebServiceValidationException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,10 @@
package org.springframework.ws.client.support.interceptor;
-import org.springframework.ws.client.WebServiceClientException;
import org.xml.sax.SAXParseException;
+import org.springframework.ws.client.WebServiceClientException;
+
/**
* Exception thrown whenever a validation error occurs on the client-side.
*
@@ -52,4 +53,5 @@ public class WebServiceValidationException extends WebServiceClientException {
public SAXParseException[] getValidationErrors() {
return validationErrors;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java
index d3db7cd0..448ace96 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,6 +16,8 @@
package org.springframework.ws.config;
+import org.w3c.dom.Element;
+
import org.springframework.beans.BeanMetadataElement;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
@@ -46,10 +48,10 @@ import org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionR
import org.springframework.ws.soap.server.endpoint.adapter.method.SoapHeaderElementMethodArgumentResolver;
import org.springframework.ws.soap.server.endpoint.adapter.method.SoapMethodArgumentResolver;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping;
-import org.w3c.dom.Element;
/**
- * {@link BeanDefinitionParser} that parses the {@code annotation-driven} element to configure a Spring WS application.
+ * {@link BeanDefinitionParser} that parses the {@code annotation-driven} element to
+ * configure a Spring WS application.
*
* @author Arjen Poutsma
* @since 2.0
@@ -90,8 +92,8 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
}
private void registerEndpointMappings(Object source, ParserContext parserContext) {
- RootBeanDefinition payloadRootMappingDef = createBeanDefinition(PayloadRootAnnotationMethodEndpointMapping.class,
- source);
+ RootBeanDefinition payloadRootMappingDef = createBeanDefinition(
+ PayloadRootAnnotationMethodEndpointMapping.class, source);
payloadRootMappingDef.getPropertyValues().add("order", 0);
parserContext.getReaderContext().registerWithGeneratedName(payloadRootMappingDef);
@@ -135,18 +137,19 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
returnValueHandlers.add(dom4jProcessor);
}
if (jaxb2Present) {
- RuntimeBeanReference xmlRootElementProcessor = createBeanReference(XmlRootElementPayloadMethodProcessor.class,
- source, parserContext);
+ RuntimeBeanReference xmlRootElementProcessor = createBeanReference(
+ XmlRootElementPayloadMethodProcessor.class, source, parserContext);
argumentResolvers.add(xmlRootElementProcessor);
returnValueHandlers.add(xmlRootElementProcessor);
- RuntimeBeanReference jaxbElementProcessor = createBeanReference(JaxbElementPayloadMethodProcessor.class, source,
- parserContext);
+ RuntimeBeanReference jaxbElementProcessor = createBeanReference(JaxbElementPayloadMethodProcessor.class,
+ source, parserContext);
argumentResolvers.add(jaxbElementProcessor);
returnValueHandlers.add(jaxbElementProcessor);
}
if (jdomPresent) {
- RuntimeBeanReference jdomProcessor = createBeanReference(JDomPayloadMethodProcessor.class, source, parserContext);
+ RuntimeBeanReference jdomProcessor = createBeanReference(JDomPayloadMethodProcessor.class, source,
+ parserContext);
argumentResolvers.add(jdomProcessor);
returnValueHandlers.add(jdomProcessor);
}
@@ -154,7 +157,8 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
argumentResolvers.add(createBeanDefinition(StaxPayloadMethodArgumentResolver.class, source));
}
if (xomPresent) {
- RuntimeBeanReference xomProcessor = createBeanReference(XomPayloadMethodProcessor.class, source, parserContext);
+ RuntimeBeanReference xomProcessor = createBeanReference(XomPayloadMethodProcessor.class, source,
+ parserContext);
argumentResolvers.add(xomProcessor);
returnValueHandlers.add(xomProcessor);
}
@@ -163,7 +167,8 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
RuntimeBeanReference unmarshallerReference;
if (element.hasAttribute("unmarshaller")) {
unmarshallerReference = new RuntimeBeanReference(element.getAttribute("unmarshaller"));
- } else {
+ }
+ else {
unmarshallerReference = marshallerReference;
}
@@ -182,7 +187,8 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
}
private void registerEndpointExceptionResolvers(Object source, ParserContext parserContext) {
- RootBeanDefinition annotationResolverDef = createBeanDefinition(SoapFaultAnnotationExceptionResolver.class, source);
+ RootBeanDefinition annotationResolverDef = createBeanDefinition(SoapFaultAnnotationExceptionResolver.class,
+ source);
annotationResolverDef.getPropertyValues().add("order", 0);
parserContext.getReaderContext().registerWithGeneratedName(annotationResolverDef);
@@ -204,4 +210,5 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
return beanDefinition;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/DynamicWsdlBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/DynamicWsdlBeanDefinitionParser.java
index 82917d7a..7636f01e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/DynamicWsdlBeanDefinitionParser.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/DynamicWsdlBeanDefinitionParser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,8 @@ package org.springframework.ws.config;
import java.util.List;
+import org.w3c.dom.Element;
+
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -31,7 +33,6 @@ import org.springframework.util.xml.DomUtils;
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import org.springframework.xml.xsd.SimpleXsdSchema;
import org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection;
-import org.w3c.dom.Element;
/**
* Parser for the {@code <sws:dynamic-wsdl/>} element.
@@ -75,10 +76,11 @@ class DynamicWsdlBeanDefinitionParser extends AbstractBeanDefinitionParser {
collectionDef.getPropertyValues().addPropertyValue("xsds", xsds);
String collectionName = parserContext.getReaderContext().registerWithGeneratedName(collectionDef);
wsdlBuilder.addPropertyReference("schemaCollection", collectionName);
- } else {
+ }
+ else {
if (schemas.size() > 1) {
- throw new IllegalArgumentException(
- "Multiple elements requires Commons XMLSchema." + "Please put Commons XMLSchema on the classpath.");
+ throw new IllegalArgumentException("Multiple elements requires Commons XMLSchema."
+ + "Please put Commons XMLSchema on the classpath.");
}
RootBeanDefinition schemaDef = createBeanDefinition(SimpleXsdSchema.class, source);
Element schema = schemas.iterator().next();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java
index 5c56ea2c..0f34c7a8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/InterceptorsBeanDefinitionParser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +18,8 @@ package org.springframework.ws.config;
import java.util.List;
+import org.w3c.dom.Element;
+
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.config.BeanReference;
@@ -33,7 +35,6 @@ import org.springframework.ws.server.SmartEndpointInterceptor;
import org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor;
import org.springframework.ws.soap.server.endpoint.interceptor.PayloadRootSmartSoapEndpointInterceptor;
import org.springframework.ws.soap.server.endpoint.interceptor.SoapActionSmartEndpointInterceptor;
-import org.w3c.dom.Element;
/**
* Parser for the {@code <sws:interceptors/>} element.
@@ -59,7 +60,8 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(0, interceptorDef);
registerSmartInterceptor(parserContext, smartInterceptorDef);
- } else if ("ref".equals(childElement.getLocalName())) {
+ }
+ else if ("ref".equals(childElement.getLocalName())) {
RootBeanDefinition smartInterceptorDef = createSmartInterceptorDefinition(
DelegatingSmartSoapEndpointInterceptor.class, childElement, parserContext);
@@ -69,13 +71,15 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
registerSmartInterceptor(parserContext, smartInterceptorDef);
- } else if ("payloadRoot".equals(childElement.getLocalName())) {
+ }
+ else if ("payloadRoot".equals(childElement.getLocalName())) {
List payloadRootChildren = DomUtils.getChildElements(childElement);
for (Element payloadRootChild : payloadRootChildren) {
if ("bean".equals(payloadRootChild.getLocalName())) {
RootBeanDefinition smartInterceptorDef = createSmartInterceptorDefinition(
PayloadRootSmartSoapEndpointInterceptor.class, childElement, parserContext);
- BeanDefinitionHolder interceptorDef = createInterceptorDefinition(parserContext, payloadRootChild);
+ BeanDefinitionHolder interceptorDef = createInterceptorDefinition(parserContext,
+ payloadRootChild);
String namespaceUri = childElement.getAttribute("namespaceUri");
String localPart = childElement.getAttribute("localPart");
@@ -85,7 +89,8 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(2, localPart);
registerSmartInterceptor(parserContext, smartInterceptorDef);
- } else if ("ref".equals(payloadRootChild.getLocalName())) {
+ }
+ else if ("ref".equals(payloadRootChild.getLocalName())) {
RootBeanDefinition smartInterceptorDef = createSmartInterceptorDefinition(
PayloadRootSmartSoapEndpointInterceptor.class, childElement, parserContext);
BeanReference interceptorRef = createInterceptorReference(parserContext, payloadRootChild);
@@ -100,13 +105,15 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
registerSmartInterceptor(parserContext, smartInterceptorDef);
}
}
- } else if ("soapAction".equals(childElement.getLocalName())) {
+ }
+ else if ("soapAction".equals(childElement.getLocalName())) {
List soapActionChildren = DomUtils.getChildElements(childElement);
for (Element soapActionChild : soapActionChildren) {
if ("bean".equals(soapActionChild.getLocalName())) {
RootBeanDefinition smartInterceptorDef = createSmartInterceptorDefinition(
SoapActionSmartEndpointInterceptor.class, childElement, parserContext);
- BeanDefinitionHolder interceptorDef = createInterceptorDefinition(parserContext, soapActionChild);
+ BeanDefinitionHolder interceptorDef = createInterceptorDefinition(parserContext,
+ soapActionChild);
String soapAction = childElement.getAttribute("value");
@@ -114,7 +121,8 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
smartInterceptorDef.getConstructorArgumentValues().addIndexedArgumentValue(1, soapAction);
registerSmartInterceptor(parserContext, smartInterceptorDef);
- } else if ("ref".equals(soapActionChild.getLocalName())) {
+ }
+ else if ("ref".equals(soapActionChild.getLocalName())) {
RootBeanDefinition smartInterceptorDef = createSmartInterceptorDefinition(
SoapActionSmartEndpointInterceptor.class, childElement, parserContext);
BeanReference interceptorRef = createInterceptorReference(parserContext, soapActionChild);
@@ -176,4 +184,5 @@ class InterceptorsBeanDefinitionParser implements BeanDefinitionParser {
private void error(ParserContext parserContext, String message, Object source) {
parserContext.getDelegate().getReaderContext().error(message, source);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/MarshallingEndpointsBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/MarshallingEndpointsBeanDefinitionParser.java
index 187ecb53..138a27fe 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/MarshallingEndpointsBeanDefinitionParser.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/MarshallingEndpointsBeanDefinitionParser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,21 @@
package org.springframework.ws.config;
+import org.w3c.dom.Element;
+
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
-import org.w3c.dom.Element;
/**
* Parser for the <sws:marshalling-endpoints/> element.
*
* @author Arjen Poutsma
* @since 1.5.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link AnnotationDrivenBeanDefinitionParser}
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link AnnotationDrivenBeanDefinitionParser}
*/
@Deprecated
class MarshallingEndpointsBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java
index 28ac79b1..f2a00dd9 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/WebServicesNamespaceHandler.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,4 +37,5 @@ public class WebServicesNamespaceHandler extends NamespaceHandlerSupport {
registerBeanDefinitionParser("marshalling-endpoints", new MarshallingEndpointsBeanDefinitionParser());
registerBeanDefinitionParser("xpath-endpoints", new XPathEndpointsBeanDefinitionParser());
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/XPathEndpointsBeanDefinitionParser.java b/spring-ws-core/src/main/java/org/springframework/ws/config/XPathEndpointsBeanDefinitionParser.java
index 9e1dc11e..b7b5be0d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/XPathEndpointsBeanDefinitionParser.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/XPathEndpointsBeanDefinitionParser.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,18 +19,20 @@ package org.springframework.ws.config;
import java.util.List;
import java.util.Properties;
+import org.w3c.dom.Element;
+
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
-import org.w3c.dom.Element;
/**
* Parser for the <sws:xpath-endpoints/> element.
*
* @author Arjen Poutsma
* @since 1.5.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link AnnotationDrivenBeanDefinitionParser}
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link AnnotationDrivenBeanDefinitionParser}
*/
@Deprecated
class XPathEndpointsBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/DelegatingWsConfiguration.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/DelegatingWsConfiguration.java
index 74f93b61..d2116be6 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/DelegatingWsConfiguration.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/DelegatingWsConfiguration.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.config.annotation;
import java.util.List;
@@ -9,9 +25,10 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResol
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
/**
- * A sub-class of {@code WsConfigurationSupport} that detects and delegates to all beans of type {@link WsConfigurer}
- * allowing them to customize the configuration provided by {@code WsConfigurationSupport}. This is the class actually
- * imported by {@link EnableWs @EnableWs}.
+ * A sub-class of {@code WsConfigurationSupport} that detects and delegates to all beans
+ * of type {@link WsConfigurer} allowing them to customize the configuration provided by
+ * {@code WsConfigurationSupport}. This is the class actually imported by
+ * {@link EnableWs @EnableWs}.
*
* @author Arjen Poutsma
* @since 2.2
@@ -42,4 +59,5 @@ public class DelegatingWsConfiguration extends WsConfigurationSupport {
protected void addReturnValueHandlers(List returnValueHandlers) {
this.configurers.addReturnValueHandlers(returnValueHandlers);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java
index 37ec0cad..fee584c7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/EnableWs.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,8 +26,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/**
- * Add this annotation to an {@link Configuration @Configuration} class to have the Spring Web Services configuration
- * defined in {@link WsConfigurationSupport} imported. For instance:
+ * Add this annotation to an {@link Configuration @Configuration} class to have the Spring
+ * Web Services configuration defined in {@link WsConfigurationSupport} imported. For
+ * instance:
*
*
- * Customize the imported configuration by implementing the {@link WsConfigurer} interface or more likely by extending
- * the {@link WsConfigurerAdapter} base class and overriding individual methods:
+ * Customize the imported configuration by implementing the {@link WsConfigurer} interface
+ * or more likely by extending the {@link WsConfigurerAdapter} base class and overriding
+ * individual methods:
*
*
- * If the customization options of {@link WsConfigurer} do not expose something you need to configure, consider removing
- * the {@code @EnableWs} annotation and extending directly from {@link WsConfigurationSupport} overriding selected
- * {@code @Bean} methods:
+ * If the customization options of {@link WsConfigurer} do not expose something you need
+ * to configure, consider removing the {@code @EnableWs} annotation and extending directly
+ * from {@link WsConfigurationSupport} overriding selected {@code @Bean} methods:
*
*
* @Configuration
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
index 64e5ff88..f8cc1d24 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurationSupport.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,30 +40,34 @@ import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping;
/**
- * This is the main class providing the configuration behind the Spring Web Services Java config. It is typically
- * imported by adding {@link EnableWs @EnableWs} to an application {@link Configuration @Configuration} class. An
- * alternative, more advanced option is to extend directly from this class and override methods as necessary remembering
- * to add {@link Configuration @Configuration} to the subclass and {@link Bean @Bean} to overridden {@link Bean @Bean}
- * methods. For more details see the Javadoc of {@link EnableWs @EnableWs}.
+ * This is the main class providing the configuration behind the Spring Web Services Java
+ * config. It is typically imported by adding {@link EnableWs @EnableWs} to an application
+ * {@link Configuration @Configuration} class. An alternative, more advanced option is to
+ * extend directly from this class and override methods as necessary remembering to add
+ * {@link Configuration @Configuration} to the subclass and {@link Bean @Bean} to
+ * overridden {@link Bean @Bean} methods. For more details see the Javadoc of
+ * {@link EnableWs @EnableWs}.
*
* This class registers the following {@link EndpointMapping}s:
*
- *
{@link PayloadRootAnnotationMethodEndpointMapping} ordered at 0 for mapping requests to
- * {@link PayloadRoot @PayloadRoot} annotated controller methods.
- *
{@link SoapActionAnnotationMethodEndpointMapping} ordered at 1 for mapping requests to
- * {@link SoapAction @SoapAction} annotated controller methods.
- *
{@link AnnotationActionEndpointMapping} ordered at 2 for mapping requests to {@link Action @Action} annotated
- * controller methods.
+ *
{@link PayloadRootAnnotationMethodEndpointMapping} ordered at 0 for mapping
+ * requests to {@link PayloadRoot @PayloadRoot} annotated controller methods.
+ *
{@link SoapActionAnnotationMethodEndpointMapping} ordered at 1 for mapping requests
+ * to {@link SoapAction @SoapAction} annotated controller methods.
+ *
{@link AnnotationActionEndpointMapping} ordered at 2 for mapping requests to
+ * {@link Action @Action} annotated controller methods.
*
*
* Registers one {@link EndpointAdapter}:
*
- *
{@link DefaultMethodEndpointAdapter} for processing requests with annotated endpoint methods.
+ *
{@link DefaultMethodEndpointAdapter} for processing requests with annotated
+ * endpoint methods.
*
*
* Registers the following {@link EndpointExceptionResolver}s:
*
- *
{@link SoapFaultAnnotationExceptionResolver} for handling exceptions annotated with {@link SoapFault @SoapFault}.
+ *
{@link SoapFaultAnnotationExceptionResolver} for handling exceptions annotated with
+ * {@link SoapFault @SoapFault}.
*
{@link SimpleSoapExceptionResolver} for creating default exceptions.
*
*
@@ -78,8 +82,8 @@ public class WsConfigurationSupport {
private List interceptors;
/**
- * Returns a {@link PayloadRootAnnotationMethodEndpointMapping} ordered at 0 for mapping requests to annotated
- * endpoints.
+ * Returns a {@link PayloadRootAnnotationMethodEndpointMapping} ordered at 0 for
+ * mapping requests to annotated endpoints.
*/
@Bean
public PayloadRootAnnotationMethodEndpointMapping payloadRootAnnotationMethodEndpointMapping() {
@@ -90,8 +94,8 @@ public class WsConfigurationSupport {
}
/**
- * Returns a {@link SoapActionAnnotationMethodEndpointMapping} ordered at 1 for mapping requests to annotated
- * endpoints.
+ * Returns a {@link SoapActionAnnotationMethodEndpointMapping} ordered at 1 for
+ * mapping requests to annotated endpoints.
*/
@Bean
public SoapActionAnnotationMethodEndpointMapping soapActionAnnotationMethodEndpointMapping() {
@@ -102,7 +106,8 @@ public class WsConfigurationSupport {
}
/**
- * Returns a {@link AnnotationActionEndpointMapping} ordered at 2 for mapping requests to annotated endpoints.
+ * Returns a {@link AnnotationActionEndpointMapping} ordered at 2 for mapping requests
+ * to annotated endpoints.
*/
@Bean
public AnnotationActionEndpointMapping annotationActionEndpointMapping() {
@@ -113,8 +118,9 @@ public class WsConfigurationSupport {
}
/**
- * Provide access to the shared handler interceptors used to configure {@link EndpointMapping} instances with. This
- * method cannot be overridden, use {@link #addInterceptors(List)} instead.
+ * Provide access to the shared handler interceptors used to configure
+ * {@link EndpointMapping} instances with. This method cannot be overridden, use
+ * {@link #addInterceptors(List)} instead.
*/
protected final EndpointInterceptor[] getInterceptors() {
if (interceptors == null) {
@@ -125,14 +131,16 @@ public class WsConfigurationSupport {
}
/**
- * Template method to add endpoint interceptors. Override this method to add Spring-WS interceptors for pre- and
- * post-processing of endpoint invocation.
+ * Template method to add endpoint interceptors. Override this method to add Spring-WS
+ * interceptors for pre- and post-processing of endpoint invocation.
*/
- protected void addInterceptors(List interceptors) {}
+ protected void addInterceptors(List interceptors) {
+ }
/**
- * Returns a {@link DefaultMethodEndpointAdapter} for processing requests through annotated endpoint methods. Consider
- * overriding one of these other more fine-grained methods:
+ * Returns a {@link DefaultMethodEndpointAdapter} for processing requests through
+ * annotated endpoint methods. Consider overriding one of these other more
+ * fine-grained methods:
*
*
{@link #addArgumentResolvers(List)} for adding custom argument resolvers.
*
{@link #addReturnValueHandlers(List)} for adding custom return value handlers.
@@ -154,21 +162,24 @@ public class WsConfigurationSupport {
}
/**
- * Add custom {@link MethodArgumentResolver}s to use in addition to the ones registered by default.
- *
+ * Add custom {@link MethodArgumentResolver}s to use in addition to the ones
+ * registered by default.
* @param argumentResolvers the list of custom converters; initially an empty list.
*/
- protected void addArgumentResolvers(List argumentResolvers) {}
+ protected void addArgumentResolvers(List argumentResolvers) {
+ }
/**
- * Add custom {@link MethodReturnValueHandler}s in addition to the ones registered by default.
- *
+ * Add custom {@link MethodReturnValueHandler}s in addition to the ones registered by
+ * default.
* @param returnValueHandlers the list of custom handlers; initially an empty list.
*/
- protected void addReturnValueHandlers(List returnValueHandlers) {}
+ protected void addReturnValueHandlers(List returnValueHandlers) {
+ }
/**
- * Returns a {@link SoapFaultAnnotationExceptionResolver} ordered at 0 for handling endpoint exceptions.
+ * Returns a {@link SoapFaultAnnotationExceptionResolver} ordered at 0 for handling
+ * endpoint exceptions.
*/
@Bean
public SoapFaultAnnotationExceptionResolver soapFaultAnnotationExceptionResolver() {
@@ -179,8 +190,9 @@ public class WsConfigurationSupport {
}
/**
- * Returns a {@link SimpleSoapExceptionResolver} ordered at {@linkplain Ordered#LOWEST_PRECEDENCE lowest precedence}
- * for handling endpoint exceptions.
+ * Returns a {@link SimpleSoapExceptionResolver} ordered at
+ * {@linkplain Ordered#LOWEST_PRECEDENCE lowest precedence} for handling endpoint
+ * exceptions.
*/
@Bean
public SimpleSoapExceptionResolver simpleSoapExceptionResolver() {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
index 26e217e2..cfb67aba 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurer.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.config.annotation;
import java.util.List;
@@ -7,12 +23,13 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResol
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
/**
- * Defines callback methods to customize the Java-based configuration for Spring Web Services enabled via
- * {@link EnableWs @EnableWs}.
+ * Defines callback methods to customize the Java-based configuration for Spring Web
+ * Services enabled via {@link EnableWs @EnableWs}.
*
- * {@code @EnableWs}-annotated configuration classes may implement this interface to be called back and given a chance
- * to customize the default configuration. Consider extending {@link WsConfigurerAdapter}, which provides a stub
- * implementation of all interface methods.
+ * {@code @EnableWs}-annotated configuration classes may implement this interface to be
+ * called back and given a chance to customize the default configuration. Consider
+ * extending {@link WsConfigurerAdapter}, which provides a stub implementation of all
+ * interface methods.
*
* @author Arjen Poutsma
* @since 2.2
@@ -20,13 +37,13 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHa
public interface WsConfigurer {
/**
- * Add {@link EndpointInterceptor}s for pre- and post-processing of endpoint method invocations.
+ * Add {@link EndpointInterceptor}s for pre- and post-processing of endpoint method
+ * invocations.
*/
void addInterceptors(List interceptors);
/**
* Add resolvers to support custom endpoint method argument types.
- *
* @param argumentResolvers initially an empty list
*/
void addArgumentResolvers(List argumentResolvers);
@@ -34,10 +51,11 @@ public interface WsConfigurer {
/**
* Add handlers to support custom controller method return value types.
*
- * Using this option does not override the built-in support for handling return values. To customize the built-in
- * support for handling return values, configure RequestMappingHandlerAdapter directly.
- *
+ * Using this option does not override the built-in support for handling return
+ * values. To customize the built-in support for handling return values, configure
+ * RequestMappingHandlerAdapter directly.
* @param returnValueHandlers initially an empty list
*/
void addReturnValueHandlers(List returnValueHandlers);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
index 9d1974d1..652ea143 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerAdapter.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.config.annotation;
import java.util.List;
@@ -7,8 +23,8 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResol
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
/**
- * An default implementation of {@link WsConfigurer} with empty methods allowing sub-classes to override only the
- * methods they're interested in.
+ * An default implementation of {@link WsConfigurer} with empty methods allowing
+ * sub-classes to override only the methods they're interested in.
*
* @author Arjen Poutsma
* @since 2.2
@@ -21,7 +37,8 @@ public class WsConfigurerAdapter implements WsConfigurer {
* This implementation is empty.
*/
@Override
- public void addInterceptors(List interceptors) {}
+ public void addInterceptors(List interceptors) {
+ }
/**
* {@inheritDoc}
@@ -29,7 +46,8 @@ public class WsConfigurerAdapter implements WsConfigurer {
* This implementation is empty.
*/
@Override
- public void addArgumentResolvers(List argumentResolvers) {}
+ public void addArgumentResolvers(List argumentResolvers) {
+ }
/**
* {@inheritDoc}
@@ -40,4 +58,5 @@ public class WsConfigurerAdapter implements WsConfigurer {
public void addReturnValueHandlers(List returnValueHandlers) {
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerComposite.java b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerComposite.java
index 04cca7c1..f41841bf 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerComposite.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/config/annotation/WsConfigurerComposite.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.config.annotation;
import java.util.ArrayList;
@@ -8,7 +24,8 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResol
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
/**
- * An {@link WsConfigurer} implementation that delegates to other {@link WsConfigurer} instances.
+ * An {@link WsConfigurer} implementation that delegates to other {@link WsConfigurer}
+ * instances.
*
* @author Arjen Poutsma
* @since 2.2
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java b/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java
index 54d15374..a452a80d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/context/AbstractMessageContext.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,7 +30,8 @@ import org.springframework.util.StringUtils;
public abstract class AbstractMessageContext implements MessageContext {
/**
- * Keys are {@code Strings}, values are {@code Objects}. Lazily initialized by {@code getProperties()}.
+ * Keys are {@code Strings}, values are {@code Objects}. Lazily initialized by
+ * {@code getProperties()}.
*/
private Map properties;
@@ -65,4 +66,5 @@ public abstract class AbstractMessageContext implements MessageContext {
}
return properties;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java b/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java
index 6e4e2b15..2189648f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/context/DefaultMessageContext.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,13 +37,17 @@ public class DefaultMessageContext extends AbstractMessageContext {
private WebServiceMessage response;
- /** Construct a new, empty instance of the {@code DefaultMessageContext} with the given message factory. */
+ /**
+ * Construct a new, empty instance of the {@code DefaultMessageContext} with the given
+ * message factory.
+ */
public DefaultMessageContext(WebServiceMessageFactory messageFactory) {
this(messageFactory.createWebServiceMessage(), messageFactory);
}
/**
- * Construct a new instance of the {@code DefaultMessageContext} with the given request message and message factory.
+ * Construct a new instance of the {@code DefaultMessageContext} with the given
+ * request message and message factory.
*/
public DefaultMessageContext(WebServiceMessage request, WebServiceMessageFactory messageFactory) {
Assert.notNull(request, "request must not be null");
@@ -96,4 +100,5 @@ public class DefaultMessageContext extends AbstractMessageContext {
throw new IllegalStateException("Response message already created");
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/context/MessageContext.java b/spring-ws-core/src/main/java/org/springframework/ws/context/MessageContext.java
index f3968b02..47cbd3a8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/context/MessageContext.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/context/MessageContext.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,11 +25,11 @@ import org.springframework.ws.server.EndpointInterceptor;
/**
* Context holder for message requests.
*
- * Contains both the message request as well as the response. Response message are usually lazily created (but do not
- * have to be).
+ * Contains both the message request as well as the response. Response message are usually
+ * lazily created (but do not have to be).
*
- * Also contains properties, which can be used to by {@link EndpointInterceptor interceptors} to pass information on to
- * endpoints.
+ * Also contains properties, which can be used to by {@link EndpointInterceptor
+ * interceptors} to pass information on to endpoints.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -38,21 +38,18 @@ public interface MessageContext {
/**
* Returns the request message.
- *
* @return the request message
*/
WebServiceMessage getRequest();
/**
* Indicates whether this context has a response.
- *
* @return {@code true} if this context has a response; {@code false} otherwise
*/
boolean hasResponse();
/**
* Returns the response message. Creates a new response if no response is present.
- *
* @return the response message
* @see #hasResponse()
*/
@@ -60,7 +57,6 @@ public interface MessageContext {
/**
* Sets the response message.
- *
* @param response the response message
* @throws IllegalStateException if a response has already been created
* @since 1.5.0
@@ -76,7 +72,6 @@ public interface MessageContext {
/**
* Reads a response message from the given input stream.
- *
* @param inputStream the stream to read the response from
* @throws IOException in case of I/O errors
* @throws IllegalStateException if a response has already been created
@@ -84,9 +79,9 @@ public interface MessageContext {
void readResponse(InputStream inputStream) throws IOException;
/**
- * Sets the name and value of a property associated with the {@code MessageContext}. If the {@code MessageContext}
- * contains a value of the same property, the old value is replaced.
- *
+ * Sets the name and value of a property associated with the {@code MessageContext}.
+ * If the {@code MessageContext} contains a value of the same property, the old value
+ * is replaced.
* @param name name of the property associated with the value
* @param value value of the property
*/
@@ -94,7 +89,6 @@ public interface MessageContext {
/**
* Gets the value of a specific property from the {@code MessageContext}.
- *
* @param name name of the property whose value is to be retrieved
* @return value of the property
*/
@@ -102,23 +96,22 @@ public interface MessageContext {
/**
* Removes a property from the {@code MessageContext}.
- *
* @param name name of the property to be removed
*/
void removeProperty(String name);
/**
* Check if this message context contains a property with the given name.
- *
* @param name the name of the property to look for
- * @return {@code true} if the {@code MessageContext} contains the property; {@code false} otherwise
+ * @return {@code true} if the {@code MessageContext} contains the property;
+ * {@code false} otherwise
*/
boolean containsProperty(String name);
/**
* Return the names of all properties in this {@code MessageContext}.
- *
- * @return the names of all properties in this context, or an empty array if none defined
+ * @return the names of all properties in this context, or an empty array if none
+ * defined
*/
String[] getPropertyNames();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java
index 5a9958a0..0744703f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/mime/AbstractMimeMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,21 +16,22 @@
package org.springframework.ws.mime;
-import jakarta.activation.DataHandler;
-import jakarta.activation.DataSource;
-import jakarta.activation.FileDataSource;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import jakarta.activation.DataHandler;
+import jakarta.activation.DataSource;
+import jakarta.activation.FileDataSource;
+
import org.springframework.core.io.InputStreamSource;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
/**
- * Abstract implementation of the {@link MimeMessage} interface. Contains convenient default implementations.
+ * Abstract implementation of the {@link MimeMessage} interface. Contains convenient
+ * default implementations.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -58,7 +59,8 @@ public abstract class AbstractMimeMessage implements MimeMessage {
}
/**
- * Activation framework {@code DataSource} that wraps a Spring {@code InputStreamSource}.
+ * Activation framework {@code DataSource} that wraps a Spring
+ * {@code InputStreamSource}.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -94,7 +96,8 @@ public abstract class AbstractMimeMessage implements MimeMessage {
if (inputStreamSource instanceof Resource) {
Resource resource = (Resource) inputStreamSource;
return resource.getFilename();
- } else {
+ }
+ else {
throw new UnsupportedOperationException("DataSource name not available");
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/mime/Attachment.java b/spring-ws-core/src/main/java/org/springframework/ws/mime/Attachment.java
index 7a7d2e1e..9079c10c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/mime/Attachment.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/mime/Attachment.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,11 +16,11 @@
package org.springframework.ws.mime;
-import jakarta.activation.DataHandler;
-
import java.io.IOException;
import java.io.InputStream;
+import jakarta.activation.DataHandler;
+
/**
* Represents an attachment to a {@link org.springframework.ws.mime.MimeMessage}
*
@@ -33,38 +33,36 @@ public interface Attachment {
/**
* Returns the content identifier of the attachment.
- *
* @return the content id, or {@code null} if empty or not defined
*/
String getContentId();
/**
* Returns the content type of the attachment.
- *
* @return the content type, or {@code null} if empty or not defined
*/
String getContentType();
/**
- * Return an {@code InputStream} to read the contents of the attachment from. The user is responsible for closing the
- * stream.
- *
+ * Return an {@code InputStream} to read the contents of the attachment from. The user
+ * is responsible for closing the stream.
* @return the contents of the file as stream, or an empty stream if empty
* @throws IOException in case of access I/O errors
*/
InputStream getInputStream() throws IOException;
/**
- * Returns the size of the attachment in bytes. Returns {@code -1} if the size cannot be determined.
- *
- * @return the size of the attachment, {@code 0} if empty, or {@code -1} if the size cannot be determined
+ * Returns the size of the attachment in bytes. Returns {@code -1} if the size cannot
+ * be determined.
+ * @return the size of the attachment, {@code 0} if empty, or {@code -1} if the size
+ * cannot be determined
*/
long getSize();
/**
* Returns the data handler of the attachment.
- *
* @return the data handler of the attachment
*/
DataHandler getDataHandler();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/mime/MimeMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/mime/MimeMessage.java
index ce0f2663..fa2d708e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/mime/MimeMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/mime/MimeMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,17 @@
package org.springframework.ws.mime;
-import jakarta.activation.DataHandler;
-
import java.io.File;
import java.util.Iterator;
+import jakarta.activation.DataHandler;
+
import org.springframework.core.io.InputStreamSource;
import org.springframework.ws.WebServiceMessage;
/**
- * Represents a Web service message with MIME attachments. Attachments can be added as a file, an
- * {@link InputStreamSource}, or a {@link DataHandler}.
+ * Represents a Web service message with MIME attachments. Attachments can be added as a
+ * file, an {@link InputStreamSource}, or a {@link DataHandler}.
*
* @author Arjen Poutsma
* @see Attachment
@@ -36,33 +36,33 @@ public interface MimeMessage extends WebServiceMessage {
/**
* Indicates whether this message is a XOP package.
- *
- * @return {@code true} when the constraints specified in
- * Identifying XOP
- * Documents are met.
- * @see XOP Packages
+ * @return {@code true} when the constraints specified in Identifying
+ * XOP Documents are met.
+ * @see XOP
+ * Packages
*/
boolean isXopPackage();
/**
* Turns this message into a XOP package.
- *
* @return {@code true} when the message is a XOP package
- * @see XOP Packages
+ * @see XOP
+ * Packages
*/
boolean convertToXopPackage();
/**
* Returns the {@link Attachment} with the specified content Id.
- *
- * @return the attachment with the specified content id; or {@code null} if it cannot be found
+ * @return the attachment with the specified content id; or {@code null} if it cannot
+ * be found
* @throws AttachmentException in case of errors
*/
Attachment getAttachment(String contentId) throws AttachmentException;
/**
- * Returns an {@code Iterator} over all {@link Attachment} objects that are part of this message.
- *
+ * Returns an {@code Iterator} over all {@link Attachment} objects that are part of
+ * this message.
* @return an iterator over all attachments
* @throws AttachmentException in case of errors
* @see Attachment
@@ -72,9 +72,9 @@ public interface MimeMessage extends WebServiceMessage {
/**
* Add an attachment to the message, taking the content from a {@link File}.
*
- * The content type will be determined by the name of the given content file. Do not use this for temporary files with
- * arbitrary filenames (possibly ending in ".tmp" or the like)!
- *
+ * The content type will be determined by the name of the given content file. Do not
+ * use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or
+ * the like)!
* @param contentId the content Id of the attachment
* @param file the file to take the content from
* @return the added attachment
@@ -83,14 +83,15 @@ public interface MimeMessage extends WebServiceMessage {
Attachment addAttachment(String contentId, File file) throws AttachmentException;
/**
- * Add an attachment to the message, taking the content from an {@link InputStreamSource}.
+ * Add an attachment to the message, taking the content from an
+ * {@link InputStreamSource}.
*
- * Note that the stream returned by the source needs to be a fresh one on each call, as underlying
- * implementations can invoke {@link InputStreamSource#getInputStream()} multiple times.
- *
+ * Note that the stream returned by the source needs to be a fresh one on each
+ * call, as underlying implementations can invoke
+ * {@link InputStreamSource#getInputStream()} multiple times.
* @param contentId the content Id of the attachment
- * @param inputStreamSource the resource to take the content from (all of Spring's Resource implementations can be
- * passed in here)
+ * @param inputStreamSource the resource to take the content from (all of Spring's
+ * Resource implementations can be passed in here)
* @param contentType the content type to use for the element
* @return the added attachment
* @throws AttachmentException in case of errors
@@ -100,10 +101,10 @@ public interface MimeMessage extends WebServiceMessage {
/**
* Add an attachment to the message, taking the content from a {@link DataHandler}.
- *
* @param dataHandler the data handler to take the content from
* @return the added attachment
* @throws AttachmentException in case of errors
*/
Attachment addAttachment(String contentId, DataHandler dataHandler);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java
index e53b4741..cae67110 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/PoxMessageException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@ public abstract class PoxMessageException extends WebServiceMessageException {
public PoxMessageException(String msg, Throwable ex) {
super(msg, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java
index b0817894..9422ae7e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,14 +27,15 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
import org.springframework.util.Assert;
import org.springframework.ws.pox.PoxMessage;
import org.springframework.ws.transport.TransportConstants;
import org.springframework.ws.transport.TransportOutputStream;
import org.springframework.xml.namespace.QNameUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
/**
* Implementation of the {@code PoxMessage} interface that is based on a DOM Document.
@@ -53,7 +54,6 @@ public class DomPoxMessage implements PoxMessage {
/**
* Constructs a new instance of the {@code DomPoxMessage} with the given document.
- *
* @param document the document to base the message on
*/
public DomPoxMessage(Document document, Transformer transformer, String contentType) {
@@ -110,8 +110,10 @@ public class DomPoxMessage implements PoxMessage {
transportOutputStream.addHeader(TransportConstants.HEADER_CONTENT_TYPE, contentType);
}
transformer.transform(getPayloadSource(), new StreamResult(outputStream));
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
throw new DomPoxMessageException("Could write document: " + ex.getMessage(), ex);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java
index 0d1dbb2d..f1971c27 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@ public class DomPoxMessageException extends PoxMessageException {
public DomPoxMessageException(String msg, Throwable ex) {
super(msg, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java
index a0e09e36..7a611b41 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,15 +24,17 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.TransformerObjectSupport;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
/**
- * Implementation of the {@link WebServiceMessageFactory} interface that creates a {@link DomPoxMessage}.
+ * Implementation of the {@link WebServiceMessageFactory} interface that creates a
+ * {@link DomPoxMessage}.
*
* @author Arjen Poutsma
* @see org.springframework.ws.pox.dom.DomPoxMessage
@@ -56,7 +58,6 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
/**
* Provide your own {@link DocumentBuilderFactory}.
- *
* @param documentBuilderFactory
*/
public DomPoxMessageFactory(DocumentBuilderFactory documentBuilderFactory) {
@@ -73,7 +74,10 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
this.contentType = contentType;
}
- /** Set whether or not the XML parser should be XML namespace aware. Default is {@code true}. */
+ /**
+ * Set whether or not the XML parser should be XML namespace aware. Default is
+ * {@code true}.
+ */
public void setNamespaceAware(boolean namespaceAware) {
documentBuilderFactory.setNamespaceAware(namespaceAware);
}
@@ -84,7 +88,8 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
}
/**
- * Set if the XML parser should expand entity reference nodes. Default is {@code false}.
+ * Set if the XML parser should expand entity reference nodes. Default is
+ * {@code false}.
*/
public void setExpandEntityReferences(boolean expandEntityRef) {
documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
@@ -96,9 +101,11 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document request = documentBuilder.newDocument();
return new DomPoxMessage(request, createTransformer(), contentType);
- } catch (ParserConfigurationException ex) {
+ }
+ catch (ParserConfigurationException ex) {
throw new DomPoxMessageException("Could not create message context", ex);
- } catch (TransformerConfigurationException ex) {
+ }
+ catch (TransformerConfigurationException ex) {
throw new DomPoxMessageException("Could not create transformer", ex);
}
}
@@ -109,12 +116,16 @@ public class DomPoxMessageFactory extends TransformerObjectSupport implements We
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document request = documentBuilder.parse(inputStream);
return new DomPoxMessage(request, createTransformer(), contentType);
- } catch (ParserConfigurationException ex) {
+ }
+ catch (ParserConfigurationException ex) {
throw new DomPoxMessageException("Could not create message context", ex);
- } catch (SAXException ex) {
+ }
+ catch (SAXException ex) {
throw new DomPoxMessageException("Could not parse request message", ex);
- } catch (TransformerConfigurationException ex) {
+ }
+ catch (TransformerConfigurationException ex) {
throw new DomPoxMessageException("Could not create transformer", ex);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointAdapter.java
index f73eb3ea..bd0c577f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,12 +19,13 @@ package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
/**
- * Interface that must be implemented for each endpoint type to handle a message request. This interface is used to
- * allow the {@code MessageDispatcher} to be indefinitely extensible. It accesses all installed endpoints through this
- * interface, meaning that is does not contain code specific to any endpoint type.
+ * Interface that must be implemented for each endpoint type to handle a message request.
+ * This interface is used to allow the {@code MessageDispatcher} to be indefinitely
+ * extensible. It accesses all installed endpoints through this interface, meaning that is
+ * does not contain code specific to any endpoint type.
*
- * This interface is not intended for application developers. It is available for those who want to develop their own
- * message flow.
+ * This interface is not intended for application developers. It is available for those
+ * who want to develop their own message flow.
*
* @author Arjen Poutsma
* @see MessageDispatcher
@@ -36,19 +37,20 @@ public interface EndpointAdapter {
* Does this {@code EndpointAdapter} support the given {@code endpoint}?
*
* Typical {@code EndpointAdapters} will base the decision on the endpoint type.
- *
* @param endpoint endpoint object to check
- * @return {@code true} if this {@code EndpointAdapter} supports the supplied {@code endpoint}
+ * @return {@code true} if this {@code EndpointAdapter} supports the supplied
+ * {@code endpoint}
*/
boolean supports(Object endpoint);
/**
* Use the given {@code endpoint} to handle the request.
- *
* @param messageContext the current message context
- * @param endpoint the endpoint to use. This object must have previously been passed to the {@link #supports(Object)}
- * method of this interface, which must have returned {@code true}
+ * @param endpoint the endpoint to use. This object must have previously been passed
+ * to the {@link #supports(Object)} method of this interface, which must have returned
+ * {@code true}
* @throws Exception in case of errors
*/
void invoke(MessageContext messageContext, Object endpoint) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointExceptionResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointExceptionResolver.java
index c935429d..a63879b6 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointExceptionResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointExceptionResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,7 +19,8 @@ package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
/**
- * Defines the interface for objects than can resolve exceptions thrown during endpoint execution.
+ * Defines the interface for objects than can resolve exceptions thrown during endpoint
+ * execution.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -28,11 +29,12 @@ public interface EndpointExceptionResolver {
/**
* Try to resolve the given exception that got thrown during on endpoint execution.
- *
* @param messageContext current message context
- * @param endpoint the executed endpoint, or null if none chosen at the time of the exception
+ * @param endpoint the executed endpoint, or null if none chosen at the time of the
+ * exception
* @param ex the exception that got thrown during endpoint execution
* @return {@code true} if resolved; {@code false} otherwise
*/
boolean resolveException(MessageContext messageContext, Object endpoint, Exception ex);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInterceptor.java
index f0b95f76..995d1339 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,18 +19,23 @@ package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
/**
- * Workflow interface that allows for customized endpoint invocation chains. Applications can register any number of
- * existing or custom interceptors for certain groups of endpoints, to add common preprocessing behavior without needing
- * to modify each endpoint implementation.
+ * Workflow interface that allows for customized endpoint invocation chains. Applications
+ * can register any number of existing or custom interceptors for certain groups of
+ * endpoints, to add common preprocessing behavior without needing to modify each endpoint
+ * implementation.
*
- * An {@code EndpointInterceptor} gets called before the appropriate {@link EndpointAdapter} triggers the invocation of
- * the endpoint itself. This mechanism can be used for a large field of preprocessing aspects, e.g. for authorization
- * checks, or message header checks. Its main purpose is to allow for factoring out repetitive endpoint code.
+ * An {@code EndpointInterceptor} gets called before the appropriate
+ * {@link EndpointAdapter} triggers the invocation of the endpoint itself. This mechanism
+ * can be used for a large field of preprocessing aspects, e.g. for authorization checks,
+ * or message header checks. Its main purpose is to allow for factoring out repetitive
+ * endpoint code.
*
- * Typically an interceptor chain is defined per {@link EndpointMapping} bean, sharing its granularity. To be able to
- * apply a certain interceptor chain to a group of handlers, one needs to map the desired handlers via one
- * {@code EndpointMapping} bean. The interceptors themselves are defined as beans in the application context, referenced
- * by the mapping bean definition via its {@code interceptors} property (in XML: a <list> of <ref>).
+ * Typically an interceptor chain is defined per {@link EndpointMapping} bean, sharing its
+ * granularity. To be able to apply a certain interceptor chain to a group of handlers,
+ * one needs to map the desired handlers via one {@code EndpointMapping} bean. The
+ * interceptors themselves are defined as beans in the application context, referenced by
+ * the mapping bean definition via its {@code interceptors} property (in XML: a
+ * <list> of <ref>).
*
* @author Arjen Poutsma
* @see EndpointInvocationChain#getInterceptors()
@@ -41,36 +46,40 @@ import org.springframework.ws.context.MessageContext;
public interface EndpointInterceptor {
/**
- * Processes the incoming request message. Called after {@link EndpointMapping} determined an appropriate endpoint
- * object, but before {@link EndpointAdapter} invokes the endpoint.
+ * Processes the incoming request message. Called after {@link EndpointMapping}
+ * determined an appropriate endpoint object, but before {@link EndpointAdapter}
+ * invokes the endpoint.
*
- * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting of any number of interceptors,
- * with the endpoint itself at the end. With this method, each interceptor can decide to abort the chain, typically
- * creating a custom response.
- *
+ * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting
+ * of any number of interceptors, with the endpoint itself at the end. With this
+ * method, each interceptor can decide to abort the chain, typically creating a custom
+ * response.
* @param messageContext contains the incoming request message
* @param endpoint chosen endpoint to invoke
- * @return {@code true} to continue processing of the request interceptor chain; {@code false} to indicate blocking of
- * the request endpoint chain, without invoking the endpoint
+ * @return {@code true} to continue processing of the request interceptor chain;
+ * {@code false} to indicate blocking of the request endpoint chain, without
+ * invoking the endpoint
* @throws Exception in case of errors
* @see MessageContext#getRequest()
*/
boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception;
/**
- * Processes the outgoing response message. Called after {@link EndpointAdapter} actually invoked the endpoint. Can
- * manipulate the response, if any, by adding new headers, etc.
+ * Processes the outgoing response message. Called after {@link EndpointAdapter}
+ * actually invoked the endpoint. Can manipulate the response, if any, by adding new
+ * headers, etc.
*
- * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting of any number of interceptors,
- * with the endpoint itself at the end. With this method, each interceptor can post-process an invocation, getting
- * applied in inverse order of the execution chain.
+ * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting
+ * of any number of interceptors, with the endpoint itself at the end. With this
+ * method, each interceptor can post-process an invocation, getting applied in inverse
+ * order of the execution chain.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
- *
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
* @param messageContext contains both request and response messages
* @param endpoint chosen endpoint to invoke
- * @return {@code true} to continue processing of the response interceptor chain; {@code false} to indicate blocking
- * of the response endpoint chain.
+ * @return {@code true} to continue processing of the response interceptor chain;
+ * {@code false} to indicate blocking of the response endpoint chain.
* @throws Exception in case of errors
* @see MessageContext#getRequest()
* @see MessageContext#hasResponse()
@@ -79,36 +88,43 @@ public interface EndpointInterceptor {
boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception;
/**
- * Processes the outgoing response fault. Called after {@link EndpointAdapter} actually invoked the endpoint. Can
- * manipulate the response, if any, by adding new headers, etc.
+ * Processes the outgoing response fault. Called after {@link EndpointAdapter}
+ * actually invoked the endpoint. Can manipulate the response, if any, by adding new
+ * headers, etc.
*
- * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting of any number of interceptors,
- * with the endpoint itself at the end. With this method, each interceptor can post-process an invocation, getting
- * applied in inverse order of the execution chain.
+ * {@link MessageDispatcher} processes an endpoint in an invocation chain, consisting
+ * of any number of interceptors, with the endpoint itself at the end. With this
+ * method, each interceptor can post-process an invocation, getting applied in inverse
+ * order of the execution chain.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
- *
- * @param messageContext contains both request and response messages, the response should contains a Fault
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
+ * @param messageContext contains both request and response messages, the response
+ * should contains a Fault
* @param endpoint chosen endpoint to invoke
- * @return {@code true} to continue processing of the response interceptor chain; {@code false} to indicate blocking
- * of the response handler chain.
+ * @return {@code true} to continue processing of the response interceptor chain;
+ * {@code false} to indicate blocking of the response handler chain.
*/
boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception;
/**
- * Callback after completion of request and response (fault) processing. Will be called on any outcome of endpoint
- * invocation, thus allows for proper resource cleanup.
+ * Callback after completion of request and response (fault) processing. Will be
+ * called on any outcome of endpoint invocation, thus allows for proper resource
+ * cleanup.
*
- * Note: Will only be called if this interceptor's {@link #handleRequest} method has successfully completed.
+ * Note: Will only be called if this interceptor's {@link #handleRequest} method has
+ * successfully completed.
*
- * As with the {@link #handleResponse} method, the method will be invoked on each interceptor in the chain in reverse
- * order, so the first interceptor will be the last to be invoked.
- *
- * @param messageContext contains both request and response messages, the response should contains a Fault
+ * As with the {@link #handleResponse} method, the method will be invoked on each
+ * interceptor in the chain in reverse order, so the first interceptor will be the
+ * last to be invoked.
+ * @param messageContext contains both request and response messages, the response
+ * should contains a Fault
* @param endpoint chosen endpoint to invoke
* @param ex exception thrown on handler execution, if any
* @throws Exception in case of errors
* @since 2.0.2
*/
void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInvocationChain.java b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInvocationChain.java
index 64c9be07..4eb2c782 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInvocationChain.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointInvocationChain.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,7 +17,8 @@
package org.springframework.ws.server;
/**
- * Endpoint invocation chain, consisting of an endpoint object and any preprocessing interceptors.
+ * Endpoint invocation chain, consisting of an endpoint object and any preprocessing
+ * interceptors.
*
* @author Arjen Poutsma
* @see EndpointInterceptor
@@ -31,7 +32,6 @@ public class EndpointInvocationChain {
/**
* Create new {@code EndpointInvocationChain}.
- *
* @param endpoint the endpoint object to invoke
*/
public EndpointInvocationChain(Object endpoint) {
@@ -40,7 +40,6 @@ public class EndpointInvocationChain {
/**
* Create new {@code EndpointInvocationChain}.
- *
* @param endpoint the endpoint object to invoke
* @param interceptors the array of interceptors to apply
*/
@@ -51,7 +50,6 @@ public class EndpointInvocationChain {
/**
* Returns the endpoint object to invoke.
- *
* @return the endpoint object
*/
public Object getEndpoint() {
@@ -60,7 +58,6 @@ public class EndpointInvocationChain {
/**
* Returns the array of interceptors to apply before the handler executes.
- *
* @return the array of interceptors
*/
public EndpointInterceptor[] getInterceptors() {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointMapping.java
index 590a1ecb..eea56930 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/EndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,13 +21,16 @@ import org.springframework.ws.context.MessageContext;
/**
* Defines a mapping between message requests and endpoint objects.
*
- * This class can be implemented by application developers, although this is not always necessary, as
- * {@code PayloadRootQNameEndpointMapping} and {@code SoapActionEndpointMapping} are included.
+ * This class can be implemented by application developers, although this is not always
+ * necessary, as {@code PayloadRootQNameEndpointMapping} and
+ * {@code SoapActionEndpointMapping} are included.
*
- * HandlerMapping implementations can support mapped interceptors but do not have to. An endpoint will always be wrapped
- * in a {@code EndpointExecutionChain} instance, optionally accompanied by some {@code EndpointInterceptor} instances.
- * The {@code MessageDispacher} will first call each {@code EndpointInterceptor}'s {@code handlerRequest} method in the
- * given order, finally invoking the endpoint itself if all {@code handlerRequest} methods have returned {@code true}.
+ * HandlerMapping implementations can support mapped interceptors but do not have to. An
+ * endpoint will always be wrapped in a {@code EndpointExecutionChain} instance,
+ * optionally accompanied by some {@code EndpointInterceptor} instances. The
+ * {@code MessageDispacher} will first call each {@code EndpointInterceptor}'s
+ * {@code handlerRequest} method in the given order, finally invoking the endpoint itself
+ * if all {@code handlerRequest} methods have returned {@code true}.
*
* @author Arjen Poutsma
* @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
@@ -38,19 +41,20 @@ import org.springframework.ws.context.MessageContext;
public interface EndpointMapping {
/**
- * Returns an endpoint and any interceptors for this message context. The choice may be made on message contents,
- * transport request url, a routing table, or any factor the implementing class chooses.
+ * Returns an endpoint and any interceptors for this message context. The choice may
+ * be made on message contents, transport request url, a routing table, or any factor
+ * the implementing class chooses.
*
- * The returned {@code EndpointExecutionChain} contains an endpoint Object, rather than even a tag interface, so that
- * endpoints are not constrained in any way. For example, a {@code EndpointAdapter} could be written to allow another
- * framework's endpoint objects to be used.
+ * The returned {@code EndpointExecutionChain} contains an endpoint Object, rather
+ * than even a tag interface, so that endpoints are not constrained in any way. For
+ * example, a {@code EndpointAdapter} could be written to allow another framework's
+ * endpoint objects to be used.
*
- * Returns {@code null} if no match was found. This is by design. The {@code MessageDispatcher} will query all
- * registered {@code EndpointMapping} beans to find a match, and only decide there is an error if none can find an
- * endpoint.
- *
- * @return a HandlerExecutionChain instance containing endpoint object and any interceptors, or {@code null} if no
- * mapping is found
+ * Returns {@code null} if no match was found. This is by design. The
+ * {@code MessageDispatcher} will query all registered {@code EndpointMapping} beans
+ * to find a match, and only decide there is an error if none can find an endpoint.
+ * @return a HandlerExecutionChain instance containing endpoint object and any
+ * interceptors, or {@code null} if no mapping is found
* @throws Exception if there is an internal error
*/
EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java b/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java
index 6dc95f47..b02a3bcc 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/MessageDispatcher.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,6 +25,7 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.BeanNameAware;
@@ -47,24 +48,29 @@ import org.springframework.ws.support.DefaultStrategiesHelper;
import org.springframework.ws.transport.WebServiceMessageReceiver;
/**
- * Central dispatcher for use within Spring-WS, dispatching Web service messages to registered endpoints.
+ * Central dispatcher for use within Spring-WS, dispatching Web service messages to
+ * registered endpoints.
*
- * This dispatcher is quite similar to Spring MVCs {@link DispatcherServlet}. Just like its counterpart, this dispatcher
- * is very flexible. This class is SOAP agnostic; in typical SOAP Web Services, the {@link SoapMessageDispatcher}
- * subclass is used.
+ * This dispatcher is quite similar to Spring MVCs {@link DispatcherServlet}. Just like
+ * its counterpart, this dispatcher is very flexible. This class is SOAP agnostic; in
+ * typical SOAP Web Services, the {@link SoapMessageDispatcher} subclass is used.
*
- *
It can use any {@link EndpointMapping} implementation - whether standard, or provided as part of an application -
- * to control the routing of request messages to endpoint objects. Endpoint mappings can be registered using the
+ *
It can use any {@link EndpointMapping} implementation - whether standard, or
+ * provided as part of an application - to control the routing of request messages to
+ * endpoint objects. Endpoint mappings can be registered using the
* {@link #setEndpointMappings(List) endpointMappings} property.
- *
It can use any {@link EndpointAdapter}; this allows one to use any endpoint interface or form. Defaults to the
- * {@link MessageEndpointAdapter} and {@link PayloadEndpointAdapter}, for {@link MessageEndpoint} and
+ *
It can use any {@link EndpointAdapter}; this allows one to use any endpoint
+ * interface or form. Defaults to the {@link MessageEndpointAdapter} and
+ * {@link PayloadEndpointAdapter}, for {@link MessageEndpoint} and
* {@link PayloadEndpoint}, respectively, and the
- * {@link org.springframework.ws.server.endpoint.adapter.MessageMethodEndpointAdapter MessageMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.PayloadMethodEndpointAdapter PayloadMethodEndpointAdapter}.
- * Additional endpoint adapters can be added through the {@link #setEndpointAdapters(List) endpointAdapters}
- * property.
- *
Its exception resolution strategy can be specified via a {@link EndpointExceptionResolver}, for example mapping
- * certain exceptions to SOAP Faults. Default is none. Additional exception resolvers can be added through the
+ * {@link org.springframework.ws.server.endpoint.adapter.MessageMethodEndpointAdapter
+ * MessageMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.PayloadMethodEndpointAdapter
+ * PayloadMethodEndpointAdapter}. Additional endpoint adapters can be added through the
+ * {@link #setEndpointAdapters(List) endpointAdapters} property.
+ *
Its exception resolution strategy can be specified via a
+ * {@link EndpointExceptionResolver}, for example mapping certain exceptions to SOAP
+ * Faults. Default is none. Additional exception resolvers can be added through the
* {@link #setEndpointExceptionResolvers(List) endpointExceptionResolvers} property.
*
*
@@ -85,18 +91,18 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
/** Additional logger to use when no mapped endpoint is found for a request. */
protected static final Log endpointNotFoundLogger = LogFactory
- .getLog(MessageDispatcher.ENDPOINT_NOT_FOUND_LOG_CATEGORY);
+ .getLog(MessageDispatcher.ENDPOINT_NOT_FOUND_LOG_CATEGORY);
/** Log category to use for message tracing. */
public static final String MESSAGE_TRACING_LOG_CATEGORY = "org.springframework.ws.server.MessageTracing";
/** Additional logger to use for sent message tracing. */
protected static final Log sentMessageTracingLogger = LogFactory
- .getLog(MessageDispatcher.MESSAGE_TRACING_LOG_CATEGORY + ".sent");
+ .getLog(MessageDispatcher.MESSAGE_TRACING_LOG_CATEGORY + ".sent");
/** Additional logger to use for received message tracing. */
protected static final Log receivedMessageTracingLogger = LogFactory
- .getLog(MessageDispatcher.MESSAGE_TRACING_LOG_CATEGORY + ".received");
+ .getLog(MessageDispatcher.MESSAGE_TRACING_LOG_CATEGORY + ".received");
private final DefaultStrategiesHelper defaultStrategiesHelper;
@@ -127,12 +133,18 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
this.endpointAdapters = endpointAdapters;
}
- /** Returns the {@code EndpointExceptionResolver}s to use by this {@code MessageDispatcher}. */
+ /**
+ * Returns the {@code EndpointExceptionResolver}s to use by this
+ * {@code MessageDispatcher}.
+ */
public List getEndpointExceptionResolvers() {
return endpointExceptionResolvers;
}
- /** Sets the {@code EndpointExceptionResolver}s to use by this {@code MessageDispatcher}. */
+ /**
+ * Sets the {@code EndpointExceptionResolver}s to use by this
+ * {@code MessageDispatcher}.
+ */
public void setEndpointExceptionResolvers(List endpointExceptionResolvers) {
this.endpointExceptionResolvers = endpointExceptionResolvers;
}
@@ -161,14 +173,16 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
@Override
public void receive(MessageContext messageContext) throws Exception {
- // Let's keep a reference to the request content as it came in, it might be changed by interceptors in dispatch()
+ // Let's keep a reference to the request content as it came in, it might be
+ // changed by interceptors in dispatch()
String requestContent = "";
if (receivedMessageTracingLogger.isTraceEnabled() || sentMessageTracingLogger.isTraceEnabled()) {
requestContent = getMessageContent(messageContext.getRequest());
}
if (receivedMessageTracingLogger.isTraceEnabled()) {
receivedMessageTracingLogger.trace("Received request [" + requestContent + "]");
- } else if (receivedMessageTracingLogger.isDebugEnabled()) {
+ }
+ else if (receivedMessageTracingLogger.isDebugEnabled()) {
receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]");
}
dispatch(messageContext);
@@ -176,14 +190,17 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
WebServiceMessage response = messageContext.getResponse();
if (sentMessageTracingLogger.isTraceEnabled()) {
String responseContent = getMessageContent(response);
- sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");
- } else if (sentMessageTracingLogger.isDebugEnabled()) {
sentMessageTracingLogger
- .debug("Sent response [" + response + "] for request [" + messageContext.getRequest() + "]");
+ .trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");
}
- } else if (sentMessageTracingLogger.isDebugEnabled()) {
- sentMessageTracingLogger.debug("MessageDispatcher with name '" + beanName + "' sends no response for request ["
- + messageContext.getRequest() + "]");
+ else if (sentMessageTracingLogger.isDebugEnabled()) {
+ sentMessageTracingLogger
+ .debug("Sent response [" + response + "] for request [" + messageContext.getRequest() + "]");
+ }
+ }
+ else if (sentMessageTracingLogger.isDebugEnabled()) {
+ sentMessageTracingLogger.debug("MessageDispatcher with name '" + beanName
+ + "' sends no response for request [" + messageContext.getRequest() + "]");
}
}
@@ -195,10 +212,9 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
/**
* Dispatches the request in the given MessageContext according to the configuration.
- *
* @param messageContext the message context
- * @throws org.springframework.ws.NoEndpointFoundException thrown when an endpoint cannot be resolved for the incoming
- * message
+ * @throws org.springframework.ws.NoEndpointFoundException thrown when an endpoint
+ * cannot be resolved for the incoming message
*/
protected final void dispatch(MessageContext messageContext) throws Exception {
EndpointInvocationChain mappedEndpoint = null;
@@ -231,21 +247,25 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
// Apply handleResponse methods of registered interceptors
triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext);
- } catch (NoEndpointFoundException ex) {
+ }
+ catch (NoEndpointFoundException ex) {
// No triggering of interceptors if no endpoint is found
if (endpointNotFoundLogger.isWarnEnabled()) {
endpointNotFoundLogger.warn("No endpoint mapping found for [" + messageContext.getRequest() + "]");
}
throw ex;
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
Object endpoint = mappedEndpoint != null ? mappedEndpoint.getEndpoint() : null;
processEndpointException(messageContext, endpoint, ex);
triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext);
}
triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null);
- } catch (NoEndpointFoundException ex) {
+ }
+ catch (NoEndpointFoundException ex) {
throw ex;
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
// Trigger after-completion for thrown exception.
triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex);
throw ex;
@@ -254,19 +274,20 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
/**
* Returns the endpoint for this request. All endpoint mappings are tried, in order.
- *
- * @return the {@code EndpointInvocationChain}, or {@code null} if no endpoint could be found.
+ * @return the {@code EndpointInvocationChain}, or {@code null} if no endpoint could
+ * be found.
*/
protected EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
for (EndpointMapping endpointMapping : getEndpointMappings()) {
EndpointInvocationChain endpoint = endpointMapping.getEndpoint(messageContext);
if (endpoint != null) {
if (logger.isDebugEnabled()) {
- logger.debug(
- "Endpoint mapping [" + endpointMapping + "] maps request to endpoint [" + endpoint.getEndpoint() + "]");
+ logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint ["
+ + endpoint.getEndpoint() + "]");
}
return endpoint;
- } else if (logger.isDebugEnabled()) {
+ }
+ else if (logger.isDebugEnabled()) {
logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request");
}
}
@@ -275,7 +296,6 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
/**
* Returns the {@code EndpointAdapter} for the given endpoint.
- *
* @param endpoint the endpoint to find an adapter for
* @return the adapter
*/
@@ -293,11 +313,10 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Callback for pre-processing of given invocation chain and message context. Gets called before invocation of
- * {@code handleRequest} on the interceptors.
+ * Callback for pre-processing of given invocation chain and message context. Gets
+ * called before invocation of {@code handleRequest} on the interceptors.
*
* Default implementation does nothing, and returns {@code true}.
- *
* @param mappedEndpoint the mapped {@code EndpointInvocationChain}
* @param messageContext the message context
* @return {@code true} if processing should continue; {@code false} otherwise
@@ -307,11 +326,12 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. Most likely,
- * the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is rethrown.
- *
+ * Determine an error {@code SOAPMessage} response via the registered
+ * {@code EndpointExceptionResolvers}. Most likely, the response contains a
+ * {@code SOAPFault}. If no suitable resolver was found, the exception is rethrown.
* @param messageContext current SOAPMessage request
- * @param endpoint the executed endpoint, or null if none chosen at the time of the exception
+ * @param endpoint the executed endpoint, or null if none chosen at the time of the
+ * exception
* @param ex the exception that got thrown during handler execution
* @throws Exception if no suitable resolver is found
*/
@@ -332,10 +352,9 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Trigger handleResponse or handleFault on the mapped EndpointInterceptors. Will just invoke said method on all
- * interceptors whose handleRequest invocation returned {@code true}, in addition to the last interceptor who returned
- * {@code false}.
- *
+ * Trigger handleResponse or handleFault on the mapped EndpointInterceptors. Will just
+ * invoke said method on all interceptors whose handleRequest invocation returned
+ * {@code true}, in addition to the last interceptor who returned {@code false}.
* @param mappedEndpoint the mapped EndpointInvocationChain
* @param interceptorIndex index of last interceptor that was called
* @param messageContext the message context, whose request and response are filled
@@ -356,7 +375,8 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
EndpointInterceptor interceptor = mappedEndpoint.getInterceptors()[i];
if (!hasFault) {
resume = interceptor.handleResponse(messageContext, mappedEndpoint.getEndpoint());
- } else {
+ }
+ else {
resume = interceptor.handleFault(messageContext, mappedEndpoint.getEndpoint());
}
}
@@ -364,10 +384,10 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Trigger afterCompletion callbacks on the mapped EndpointInterceptors. Will just invoke afterCompletion for all
- * interceptors whose handleRequest invocation has successfully completed and returned true, in addition to the last
- * interceptor who returned {@code false}.
- *
+ * Trigger afterCompletion callbacks on the mapped EndpointInterceptors. Will just
+ * invoke afterCompletion for all interceptors whose handleRequest invocation has
+ * successfully completed and returned true, in addition to the last interceptor who
+ * returned {@code false}.
* @param mappedEndpoint the mapped EndpointInvocationChain
* @param interceptorIndex index of last interceptor that successfully completed
* @param ex Exception thrown on handler execution, or {@code null} if none
@@ -384,7 +404,8 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
EndpointInterceptor interceptor = interceptors[i];
try {
interceptor.afterCompletion(messageContext, mappedEndpoint.getEndpoint(), ex);
- } catch (Throwable ex2) {
+ }
+ catch (Throwable ex2) {
logger.error("EndpointInterceptor.afterCompletion threw exception", ex2);
}
}
@@ -393,20 +414,22 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Initialize the {@code EndpointAdapters} used by this class. If no adapter beans are explicitly set by using the
- * {@code endpointAdapters} property, we use the default strategies.
- *
+ * Initialize the {@code EndpointAdapters} used by this class. If no adapter beans are
+ * explicitly set by using the {@code endpointAdapters} property, we use the default
+ * strategies.
* @see #setEndpointAdapters(java.util.List)
*/
private void initEndpointAdapters(ApplicationContext applicationContext) throws BeansException {
if (endpointAdapters == null) {
- Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext,
- EndpointAdapter.class, true, false);
+ Map matchingBeans = BeanFactoryUtils
+ .beansOfTypeIncludingAncestors(applicationContext, EndpointAdapter.class, true, false);
if (!matchingBeans.isEmpty()) {
endpointAdapters = new ArrayList<>(matchingBeans.values());
endpointAdapters.sort(new OrderComparator());
- } else {
- endpointAdapters = defaultStrategiesHelper.getDefaultStrategies(EndpointAdapter.class, applicationContext);
+ }
+ else {
+ endpointAdapters = defaultStrategiesHelper.getDefaultStrategies(EndpointAdapter.class,
+ applicationContext);
if (logger.isDebugEnabled()) {
logger.debug("No EndpointAdapters found, using defaults");
}
@@ -415,21 +438,22 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Initialize the {@code EndpointExceptionResolver} used by this class. If no resolver beans are explicitly set by
- * using the {@code endpointExceptionResolvers} property, we use the default strategies.
- *
+ * Initialize the {@code EndpointExceptionResolver} used by this class. If no resolver
+ * beans are explicitly set by using the {@code endpointExceptionResolvers} property,
+ * we use the default strategies.
* @see #setEndpointExceptionResolvers(java.util.List)
*/
private void initEndpointExceptionResolvers(ApplicationContext applicationContext) throws BeansException {
if (endpointExceptionResolvers == null) {
Map matchingBeans = BeanFactoryUtils
- .beansOfTypeIncludingAncestors(applicationContext, EndpointExceptionResolver.class, true, false);
+ .beansOfTypeIncludingAncestors(applicationContext, EndpointExceptionResolver.class, true, false);
if (!matchingBeans.isEmpty()) {
endpointExceptionResolvers = new ArrayList<>(matchingBeans.values());
endpointExceptionResolvers.sort(new OrderComparator());
- } else {
- endpointExceptionResolvers = defaultStrategiesHelper.getDefaultStrategies(EndpointExceptionResolver.class,
- applicationContext);
+ }
+ else {
+ endpointExceptionResolvers = defaultStrategiesHelper
+ .getDefaultStrategies(EndpointExceptionResolver.class, applicationContext);
if (logger.isDebugEnabled()) {
logger.debug("No EndpointExceptionResolvers found, using defaults");
}
@@ -438,24 +462,27 @@ public class MessageDispatcher implements WebServiceMessageReceiver, BeanNameAwa
}
/**
- * Initialize the {@code EndpointMappings} used by this class. If no mapping beans are explictely set by using the
- * {@code endpointMappings} property, we use the default strategies.
- *
+ * Initialize the {@code EndpointMappings} used by this class. If no mapping beans are
+ * explictely set by using the {@code endpointMappings} property, we use the default
+ * strategies.
* @see #setEndpointMappings(java.util.List)
*/
private void initEndpointMappings(ApplicationContext applicationContext) throws BeansException {
if (endpointMappings == null) {
- Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext,
- EndpointMapping.class, true, false);
+ Map matchingBeans = BeanFactoryUtils
+ .beansOfTypeIncludingAncestors(applicationContext, EndpointMapping.class, true, false);
if (!matchingBeans.isEmpty()) {
endpointMappings = new ArrayList<>(matchingBeans.values());
endpointMappings.sort(new OrderComparator());
- } else {
- endpointMappings = defaultStrategiesHelper.getDefaultStrategies(EndpointMapping.class, applicationContext);
+ }
+ else {
+ endpointMappings = defaultStrategiesHelper.getDefaultStrategies(EndpointMapping.class,
+ applicationContext);
if (logger.isDebugEnabled()) {
logger.debug("No EndpointMappings found, using defaults");
}
}
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/SmartEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/SmartEndpointInterceptor.java
index 40d2b4db..ec3f71ed 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/SmartEndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/SmartEndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,8 +19,8 @@ package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
/**
- * Extension of the {@link EndpointInterceptor} interface that adds a way to decide whether the interceptor should
- * intercept a given message context.
+ * Extension of the {@link EndpointInterceptor} interface that adds a way to decide
+ * whether the interceptor should intercept a given message context.
*
* @author Arjen Poutsma
* @since 2.0
@@ -29,10 +29,10 @@ public interface SmartEndpointInterceptor extends EndpointInterceptor {
/**
* Indicates whether this interceptor should intercept the given message context.
- *
* @param messageContext contains the incoming request message
* @param endpoint chosen endpoint to invoke
- * @return {@code true} to indicate that this interceptor applies; {@code false} otherwise
+ * @return {@code true} to indicate that this interceptor applies; {@code false}
+ * otherwise
*/
boolean shouldIntercept(MessageContext messageContext, Object endpoint);
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java
index 25989dbf..538e5840 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDom4jPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,15 +26,17 @@ import org.dom4j.Element;
import org.dom4j.io.DOMReader;
import org.dom4j.io.DocumentResult;
import org.dom4j.io.DocumentSource;
-import org.springframework.xml.transform.TransformerObjectSupport;
import org.w3c.dom.Node;
+import org.springframework.xml.transform.TransformerObjectSupport;
+
/**
- * Abstract base class for endpoints that handle the message payload as dom4j elements. Offers the message payload as a
- * dom4j {@code Element}, and allows subclasses to create a response by returning an {@code Element}.
+ * Abstract base class for endpoints that handle the message payload as dom4j elements.
+ * Offers the message payload as a dom4j {@code Element}, and allows subclasses to create
+ * a response by returning an {@code Element}.
*
- * An {@code AbstractDom4JPayloadEndpoint} only accept one payload element. Multiple payload elements are not in
- * accordance with WS-I.
+ * An {@code AbstractDom4JPayloadEndpoint} only accept one payload element. Multiple
+ * payload elements are not in accordance with WS-I.
*
* @author Arjen Poutsma
* @see org.dom4j.Element
@@ -47,7 +49,8 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp
private boolean alwaysTransform = false;
/**
- * Set if the request {@link Source} should always be transformed into a new {@link DocumentResult}.
+ * Set if the request {@link Source} should always be transformed into a new
+ * {@link DocumentResult}.
*
* Default is {@code false}, which is faster.
*/
@@ -71,12 +74,13 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp
/**
* Returns the payload element of the given source.
*
- * Default implementation checks whether the source is a {@link javax.xml.transform.dom.DOMSource}, and uses a
- * {@link org.dom4j.io.DOMReader} to create a JDOM {@link org.dom4j.Element}. In all other cases, or when
- * {@linkplain #setAlwaysTransform(boolean) alwaysTransform} is {@code true}, the source is transformed into a
- * {@link org.dom4j.io.DocumentResult}, which is more expensive. If the passed source is {@code null}, {@code
+ * Default implementation checks whether the source is a
+ * {@link javax.xml.transform.dom.DOMSource}, and uses a
+ * {@link org.dom4j.io.DOMReader} to create a JDOM {@link org.dom4j.Element}. In all
+ * other cases, or when {@linkplain #setAlwaysTransform(boolean) alwaysTransform} is
+ * {@code true}, the source is transformed into a {@link org.dom4j.io.DocumentResult},
+ * which is more expensive. If the passed source is {@code null}, {@code
* null} is returned.
- *
* @param source the source to return the root element of; can be {@code null}
* @return the document element
* @throws javax.xml.transform.TransformerException in case of errors
@@ -100,14 +104,15 @@ public abstract class AbstractDom4jPayloadEndpoint extends TransformerObjectSupp
}
/**
- * Template method. Subclasses must implement this. Offers the request payload as a dom4j {@code Element}, and allows
- * subclasses to return a response {@code Element}.
+ * Template method. Subclasses must implement this. Offers the request payload as a
+ * dom4j {@code Element}, and allows subclasses to return a response {@code Element}.
*
- * The given dom4j {@code Document} is to be used for constructing a response element, by using {@code addElement}.
- *
+ * The given dom4j {@code Document} is to be used for constructing a response element,
+ * by using {@code addElement}.
* @param requestElement the contents of the SOAP message as dom4j elements
* @param responseDocument a dom4j document to be used for constructing a response
* @return the response element. Can be {@code null} to specify no response.
*/
protected abstract Element invokeInternal(Element requestElement, Document responseDocument) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java
index 304b0aa1..5ab66592 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractDomPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,20 +24,21 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
-import org.springframework.xml.DocumentBuilderFactoryUtils;
-import org.springframework.xml.transform.TransformerObjectSupport;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.springframework.xml.DocumentBuilderFactoryUtils;
+import org.springframework.xml.transform.TransformerObjectSupport;
+
/**
* Abstract base class for endpoints that handle the message payload as DOM elements.
*
- * Offers the message payload as a DOM {@code Element}, and allows subclasses to create a response by returning an
- * {@code Element}.
+ * Offers the message payload as a DOM {@code Element}, and allows subclasses to create a
+ * response by returning an {@code Element}.
*
- * An {@code AbstractDomPayloadEndpoint} only accept one payload element. Multiple payload elements are not in
- * accordance with WS-I.
+ * An {@code AbstractDomPayloadEndpoint} only accept one payload element.
+ * Multiple payload elements are not in accordance with WS-I.
*
* @author Arjen Poutsma
* @author Alef Arendsen
@@ -58,7 +59,10 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
private boolean alwaysTransform = false;
- /** Set whether or not the XML parser should be XML namespace aware. Default is {@code true}. */
+ /**
+ * Set whether or not the XML parser should be XML namespace aware. Default is
+ * {@code true}.
+ */
public void setNamespaceAware(boolean namespaceAware) {
this.namespaceAware = namespaceAware;
}
@@ -69,14 +73,16 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
}
/**
- * Set if the XML parser should expand entity reference nodes. Default is {@code false}.
+ * Set if the XML parser should expand entity reference nodes. Default is
+ * {@code false}.
*/
public void setExpandEntityReferences(boolean expandEntityRef) {
documentBuilderFactory.setExpandEntityReferences(expandEntityRef);
}
/**
- * Set if the request {@link Source} should always be transformed into a new {@link DOMResult}.
+ * Set if the request {@link Source} should always be transformed into a new
+ * {@link DOMResult}.
*
* Default is {@code false}, which is faster.
*/
@@ -97,22 +103,24 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
}
/**
- * Create a {@code DocumentBuilder} that this endpoint will use for parsing XML documents. Can be overridden in
- * subclasses, adding further initialization of the builder.
- *
- * @param factory the {@code DocumentBuilderFactory} that the DocumentBuilder should be created with
+ * Create a {@code DocumentBuilder} that this endpoint will use for parsing XML
+ * documents. Can be overridden in subclasses, adding further initialization of the
+ * builder.
+ * @param factory the {@code DocumentBuilderFactory} that the DocumentBuilder should
+ * be created with
* @return the {@code DocumentBuilder}
* @throws ParserConfigurationException if thrown by JAXP methods
*/
- protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory) throws ParserConfigurationException {
+ protected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory)
+ throws ParserConfigurationException {
return factory.newDocumentBuilder();
}
/**
- * Create a {@code DocumentBuilderFactory} that this endpoint will use for constructing XML documents. Can be
- * overridden in subclasses, adding further initialization of the factory. The resulting
- * {@code DocumentBuilderFactory} is cached, so this method will only be called once.
- *
+ * Create a {@code DocumentBuilderFactory} that this endpoint will use for
+ * constructing XML documents. Can be overridden in subclasses, adding further
+ * initialization of the factory. The resulting {@code DocumentBuilderFactory} is
+ * cached, so this method will only be called once.
* @return the DocumentBuilderFactory
* @throws ParserConfigurationException if thrown by JAXP methods
*/
@@ -127,11 +135,11 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
/**
* Returns the payload element of the given source.
*
- * Default implementation checks whether the source is a {@link DOMSource}, and returns the
- * {@linkplain DOMSource#getNode() node} of that. In all other cases, or when {@linkplain #setAlwaysTransform(boolean)
- * alwaysTransform} is {@code true}, the source is transformed into a {@link DOMResult}, which is more expensive. If
- * the passed source is {@code null}, {@code null} is returned.
- *
+ * Default implementation checks whether the source is a {@link DOMSource}, and
+ * returns the {@linkplain DOMSource#getNode() node} of that. In all other cases, or
+ * when {@linkplain #setAlwaysTransform(boolean) alwaysTransform} is {@code true}, the
+ * source is transformed into a {@link DOMResult}, which is more expensive. If the
+ * passed source is {@code null}, {@code null} is returned.
* @param source the source to return the root element of; can be {@code null}
* @param documentBuilder the document builder to be used for transformations
* @return the document element
@@ -145,7 +153,8 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
Node node = ((DOMSource) source).getNode();
if (node.getNodeType() == Node.ELEMENT_NODE) {
return (Element) node;
- } else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+ }
+ else if (node.getNodeType() == Node.DOCUMENT_NODE) {
return ((Document) node).getDocumentElement();
}
}
@@ -159,11 +168,11 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
/**
* Template method that subclasses must implement to process the request.
*
- * Offers the request payload as a DOM {@code Element}, and allows subclasses to return a response {@code Element}.
+ * Offers the request payload as a DOM {@code Element}, and allows subclasses to
+ * return a response {@code Element}.
*
- * The given DOM {@code Document} is to be used for constructing {@code Node}s, by using the various {@code create}
- * methods.
- *
+ * The given DOM {@code Document} is to be used for constructing {@code Node}s, by
+ * using the various {@code create} methods.
* @param requestElement the contents of the SOAP message as DOM elements
* @param responseDocument a DOM document to be used for constructing {@code Node}s
* @return the response element. Can be {@code null} to specify no response.
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java
index c5055959..003889aa 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,6 +20,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.core.Ordered;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointExceptionResolver;
@@ -47,23 +48,26 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
/**
* Specify the set of endpoints that this exception resolver should map.
*
- * The exception mappings and the default fault will only apply to the specified endpoints.
+ * The exception mappings and the default fault will only apply to the specified
+ * endpoints.
*
- * If no endpoints are set, both the exception mappings and the default fault will apply to all handlers. This means
- * that a specified default fault will be used as fallback for all exceptions; any further
- * {@code EndpointExceptionResolvers} in the chain will be ignored in this case.
+ * If no endpoints are set, both the exception mappings and the default fault will
+ * apply to all handlers. This means that a specified default fault will be used as
+ * fallback for all exceptions; any further {@code EndpointExceptionResolvers} in the
+ * chain will be ignored in this case.
*/
public void setMappedEndpoints(Set> mappedEndpoints) {
this.mappedEndpoints = mappedEndpoints;
}
/**
- * Set the log category for warn logging. The name will be passed to the underlying logger implementation through
- * Commons Logging, getting interpreted as log category according to the logger's configuration.
+ * Set the log category for warn logging. The name will be passed to the underlying
+ * logger implementation through Commons Logging, getting interpreted as log category
+ * according to the logger's configuration.
*
- * Default is no warn logging. Specify this setting to activate warn logging into a specific category. Alternatively,
- * override the {@link #logException} method for custom logging.
- *
+ * Default is no warn logging. Specify this setting to activate warn logging into a
+ * specific category. Alternatively, override the {@link #logException} method for
+ * custom logging.
* @see org.apache.commons.logging.LogFactory#getLog(String)
* @see org.apache.log4j.Logger#getLogger(String)
* @see java.util.logging.Logger#getLogger(String)
@@ -76,7 +80,6 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
* Specify the order value for this mapping.
*
* Default value is {@link Integer#MAX_VALUE}, meaning that it's non-ordered.
- *
* @see org.springframework.core.Ordered#getOrder()
*/
public final void setOrder(int order) {
@@ -89,9 +92,8 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
}
/**
- * Default implementation that checks whether the given {@code endpoint} is in the set of {@link #setMappedEndpoints
- * mapped endpoints}.
- *
+ * Default implementation that checks whether the given {@code endpoint} is in the set
+ * of {@link #setMappedEndpoints mapped endpoints}.
* @see #resolveExceptionInternal(MessageContext,Object,Exception)
*/
@Override
@@ -109,12 +111,11 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
}
/**
- * Log the given exception at warn level, provided that warn logging has been activated through the
- * {@link #setWarnLogCategory "warnLogCategory"} property.
+ * Log the given exception at warn level, provided that warn logging has been
+ * activated through the {@link #setWarnLogCategory "warnLogCategory"} property.
*
- * Calls {@link #buildLogMessage} in order to determine the concrete message to log. Always passes the full exception
- * to the logger.
- *
+ * Calls {@link #buildLogMessage} in order to determine the concrete message to log.
+ * Always passes the full exception to the logger.
* @param ex the exception that got thrown during handler execution
* @param messageContext current message context request
* @see #setWarnLogCategory
@@ -128,8 +129,8 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
}
/**
- * Build a log message for the given exception, occured during processing the given message context.
- *
+ * Build a log message for the given exception, occured during processing the given
+ * message context.
* @param ex the exception that got thrown during handler execution
* @param messageContext the message context
* @return the log message to use
@@ -139,10 +140,11 @@ public abstract class AbstractEndpointExceptionResolver implements EndpointExcep
}
/**
- * Template method for resolving exceptions that is called by {@link #resolveException}.
- *
+ * Template method for resolving exceptions that is called by
+ * {@link #resolveException}.
* @param messageContext current message context
- * @param endpoint the executed endpoint, or {@code null} if none chosen at the time of the exception
+ * @param endpoint the executed endpoint, or {@code null} if none chosen at the time
+ * of the exception
* @param ex the exception that got thrown during endpoint execution
* @return {@code true} if resolved; {@code false} otherwise
* @see #resolveException(MessageContext,Object,Exception)
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java
index 96842650..5b52cd29 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractJDomPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,15 +25,17 @@ import org.jdom2.Element;
import org.jdom2.input.DOMBuilder;
import org.jdom2.transform.JDOMResult;
import org.jdom2.transform.JDOMSource;
-import org.springframework.xml.transform.TransformerObjectSupport;
import org.w3c.dom.Node;
+import org.springframework.xml.transform.TransformerObjectSupport;
+
/**
* Abstract base class for endpoints that handle the message payload as JDOM elements.
*
- * Offers the message payload as a JDOM {@link Element}, and allows subclasses to create a response by returning an
- * {@code Element}. one payload element. Multiple
- * payload elements are not in accordance with WS-I.
+ * Offers the message payload as a JDOM {@link Element}, and allows subclasses to create a
+ * response by returning an {@code Element}. one payload element. Multiple payload elements are not in accordance
+ * with WS-I.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -45,7 +47,8 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
private boolean alwaysTransform = false;
/**
- * Set if the request {@link Source} should always be transformed into a new {@link JDOMResult}.
+ * Set if the request {@link Source} should always be transformed into a new
+ * {@link JDOMResult}.
*
* Default is {@code false}, which is faster.
*/
@@ -63,11 +66,11 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
/**
* Returns the payload element of the given source.
*
- * Default implementation checks whether the source is a {@link DOMSource}, and uses a {@link DOMBuilder} to create a
- * JDOM {@link Element}. In all other cases, or when {@linkplain #setAlwaysTransform(boolean) alwaysTransform} is
- * {@code true}, the source is transformed into a {@link JDOMResult}, which is more expensive. If the passed source is
- * {@code null}, {@code null} is returned.
- *
+ * Default implementation checks whether the source is a {@link DOMSource}, and uses a
+ * {@link DOMBuilder} to create a JDOM {@link Element}. In all other cases, or when
+ * {@linkplain #setAlwaysTransform(boolean) alwaysTransform} is {@code true}, the
+ * source is transformed into a {@link JDOMResult}, which is more expensive. If the
+ * passed source is {@code null}, {@code null} is returned.
* @param source the source to return the root element of; can be {@code null}
* @return the document element
* @throws TransformerException in case of errors
@@ -81,7 +84,8 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
DOMBuilder domBuilder = new DOMBuilder();
if (node.getNodeType() == Node.ELEMENT_NODE) {
return domBuilder.build((org.w3c.dom.Element) node);
- } else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+ }
+ else if (node.getNodeType() == Node.DOCUMENT_NODE) {
Document document = domBuilder.build((org.w3c.dom.Document) node);
return document.getRootElement();
}
@@ -93,11 +97,11 @@ public abstract class AbstractJDomPayloadEndpoint extends TransformerObjectSuppo
}
/**
- * Template method. Subclasses must implement this. Offers the request payload as a JDOM {@code Element}, and allows
- * subclasses to return a response {@code Element}.
- *
+ * Template method. Subclasses must implement this. Offers the request payload as a
+ * JDOM {@code Element}, and allows subclasses to return a response {@code Element}.
* @param requestElement the contents of the SOAP message as JDOM element
* @return the response element. Can be {@code null} to specify no response.
*/
protected abstract Element invokeInternal(Element requestElement) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java
index 9aa2b591..983cd0c3 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractLoggingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,15 +27,17 @@ import javax.xml.transform.stream.StreamResult;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Abstract base class for {@code EndpointInterceptor} instances that log a part of a {@code WebServiceMessage}. By
- * default, both request and response messages are logged, but this behaviour can be changed using the
- * {@code logRequest} and {@code logResponse} properties.
+ * Abstract base class for {@code EndpointInterceptor} instances that log a part of a
+ * {@code WebServiceMessage}. By default, both request and response messages are logged,
+ * but this behaviour can be changed using the {@code logRequest} and {@code logResponse}
+ * properties.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -43,8 +45,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
public abstract class AbstractLoggingInterceptor extends TransformerObjectSupport implements EndpointInterceptor {
/**
- * The default {@code Log} instance used to write trace messages. This instance is mapped to the implementing
- * {@code Class}.
+ * The default {@code Log} instance used to write trace messages. This instance is
+ * mapped to the implementing {@code Class}.
*/
protected transient Log logger = LogFactory.getLog(getClass());
@@ -63,11 +65,12 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
}
/**
- * Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons
- * Logging, getting interpreted as log category according to the logger's configuration.
+ * Set the name of the logger to use. The name will be passed to the underlying logger
+ * implementation through Commons Logging, getting interpreted as log category
+ * according to the logger's configuration.
*
- * This can be specified to not log into the category of a class but rather into a specific named category.
- *
+ * This can be specified to not log into the category of a class but rather into a
+ * specific named category.
* @see org.apache.commons.logging.LogFactory#getLog(String)
* @see org.apache.log4j.Logger#getLogger(String)
* @see java.util.logging.Logger#getLogger(String)
@@ -77,9 +80,8 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
}
/**
- * Logs the request message payload. Logging only occurs if {@code logRequest} is set to {@code true}, which is the
- * default.
- *
+ * Logs the request message payload. Logging only occurs if {@code logRequest} is set
+ * to {@code true}, which is the default.
* @param messageContext the message context
* @return {@code true}
* @throws TransformerException when the payload cannot be transformed to a string
@@ -93,9 +95,8 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
}
/**
- * Logs the response message payload. Logging only occurs if {@code logResponse} is set to {@code true}, which is the
- * default.
- *
+ * Logs the response message payload. Logging only occurs if {@code logResponse} is
+ * set to {@code true}, which is the default.
* @param messageContext the message context
* @return {@code true}
* @throws TransformerException when the payload cannot be transformed to a string
@@ -116,13 +117,14 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
/** Does nothing by default */
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
+ }
/**
* Determine whether the {@link #logger} field is enabled.
*
- * Default is {@code true} when the "debug" level is enabled. Subclasses can override this to change the level under
- * which logging occurs.
+ * Default is {@code true} when the "debug" level is enabled. Subclasses can override
+ * this to change the level under which logging occurs.
*/
protected boolean isLogEnabled() {
return logger.isDebugEnabled();
@@ -136,11 +138,11 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
}
/**
- * Logs the given {@link Source source} to the {@link #logger}, using the message as a prefix.
+ * Logs the given {@link Source source} to the {@link #logger}, using the message as a
+ * prefix.
*
- * By default, this message creates a string representation of the given source, and delegates to
- * {@link #logMessage(String)}.
- *
+ * By default, this message creates a string representation of the given source, and
+ * delegates to {@link #logMessage(String)}.
* @param logMessage the log message
* @param source the source to be logged
* @throws TransformerException in case of errors
@@ -158,9 +160,8 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
/**
* Logs the given string message.
*
- * By default, this method uses a "debug" level of logging. Subclasses can override this method to change the level of
- * logging used by the logger.
- *
+ * By default, this method uses a "debug" level of logging. Subclasses can override
+ * this method to change the level of logging used by the logger.
* @param message the message
*/
protected void logMessage(String message) {
@@ -168,10 +169,11 @@ public abstract class AbstractLoggingInterceptor extends TransformerObjectSuppor
}
/**
- * Abstract template method that returns the {@code Source} for the given {@code WebServiceMessage}.
- *
+ * Abstract template method that returns the {@code Source} for the given
+ * {@code WebServiceMessage}.
* @param message the message
* @return the source of the message
*/
protected abstract Source getSource(WebServiceMessage message);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
index d6dd7932..3b73a135 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,6 +20,7 @@ import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
@@ -29,9 +30,10 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.support.MarshallingUtils;
/**
- * Endpoint that unmarshals the request payload, and marshals the response object. This endpoint needs a
- * {@code Marshaller} and {@code Unmarshaller}, both of which can be set using properties. An abstract template method
- * is invoked using the request object as a parameter, and allows for a response object to be returned.
+ * Endpoint that unmarshals the request payload, and marshals the response object. This
+ * endpoint needs a {@code Marshaller} and {@code Unmarshaller}, both of which can be set
+ * using properties. An abstract template method is invoked using the request object as a
+ * parameter, and allows for a response object to be returned.
*
* @author Arjen Poutsma
* @see #setMarshaller(org.springframework.oxm.Marshaller)
@@ -53,24 +55,25 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
private Unmarshaller unmarshaller;
/**
- * Creates a new {@code AbstractMarshallingPayloadEndpoint}. The {@link Marshaller} and {@link Unmarshaller} must be
- * injected using properties.
- *
+ * Creates a new {@code AbstractMarshallingPayloadEndpoint}. The {@link Marshaller}
+ * and {@link Unmarshaller} must be injected using properties.
* @see #setMarshaller(org.springframework.oxm.Marshaller)
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
- protected AbstractMarshallingPayloadEndpoint() {}
+ protected AbstractMarshallingPayloadEndpoint() {
+ }
/**
- * Creates a new {@code AbstractMarshallingPayloadEndpoint} with the given marshaller. The given {@link Marshaller}
- * should also implements the {@link Unmarshaller}, since it is used for both marshalling and unmarshalling. If it is
- * not, an exception is thrown.
+ * Creates a new {@code AbstractMarshallingPayloadEndpoint} with the given marshaller.
+ * The given {@link Marshaller} should also implements the {@link Unmarshaller}, since
+ * it is used for both marshalling and unmarshalling. If it is not, an exception is
+ * thrown.
*
- * Note that all {@link Marshaller} implementations in Spring-WS also implement the {@link Unmarshaller} interface, so
- * that you can safely use this constructor.
- *
+ * Note that all {@link Marshaller} implementations in Spring-WS also implement the
+ * {@link Unmarshaller} interface, so that you can safely use this constructor.
* @param marshaller object used as marshaller and unmarshaller
- * @throws IllegalArgumentException when {@code marshaller} does not implement the {@link Unmarshaller} interface
+ * @throws IllegalArgumentException when {@code marshaller} does not implement the
+ * {@link Unmarshaller} interface
* @see #AbstractMarshallingPayloadEndpoint(Marshaller,Unmarshaller)
*/
protected AbstractMarshallingPayloadEndpoint(Marshaller marshaller) {
@@ -79,15 +82,16 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller "
+ "interface. Please set an Unmarshaller explicitly by using the "
+ "AbstractMarshallingPayloadEndpoint(Marshaller, Unmarshaller) constructor.");
- } else {
+ }
+ else {
setMarshaller(marshaller);
setUnmarshaller((Unmarshaller) marshaller);
}
}
/**
- * Creates a new {@code AbstractMarshallingPayloadEndpoint} with the given marshaller and unmarshaller.
- *
+ * Creates a new {@code AbstractMarshallingPayloadEndpoint} with the given marshaller
+ * and unmarshaller.
* @param marshaller the marshaller to use
* @param unmarshaller the unmarshaller to use
*/
@@ -148,14 +152,15 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
}
/**
- * Callback for post-processing in terms of unmarshalling. Called on each message request, after standard
- * unmarshalling.
+ * Callback for post-processing in terms of unmarshalling. Called on each message
+ * request, after standard unmarshalling.
*
* Default implementation returns {@code true}.
- *
* @param messageContext the message context
- * @param requestObject the object unmarshalled from the {@link MessageContext#getRequest() request}
- * @return {@code true} to continue and call {@link #invokeInternal(Object)}; {@code false} otherwise
+ * @param requestObject the object unmarshalled from the
+ * {@link MessageContext#getRequest() request}
+ * @return {@code true} to continue and call {@link #invokeInternal(Object)};
+ * {@code false} otherwise
*/
protected boolean onUnmarshalRequest(MessageContext messageContext, Object requestObject) throws Exception {
return true;
@@ -171,36 +176,41 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
}
/**
- * Callback for post-processing in terms of marshalling. Called on each message request, after standard marshalling of
- * the response. Only invoked when {@link #invokeInternal(Object)} returns an object.
+ * Callback for post-processing in terms of marshalling. Called on each message
+ * request, after standard marshalling of the response. Only invoked when
+ * {@link #invokeInternal(Object)} returns an object.
*
* Default implementation is empty.
- *
* @param messageContext the message context
- * @param requestObject the object unmarshalled from the {@link MessageContext#getRequest() request}
- * @param responseObject the object marshalled to the {@link MessageContext#getResponse()} request}
+ * @param requestObject the object unmarshalled from the
+ * {@link MessageContext#getRequest() request}
+ * @param responseObject the object marshalled to the
+ * {@link MessageContext#getResponse()} request}
*/
- protected void onMarshalResponse(MessageContext messageContext, Object requestObject, Object responseObject) {}
+ protected void onMarshalResponse(MessageContext messageContext, Object requestObject, Object responseObject) {
+ }
/**
- * Template method that gets called after the marshaller and unmarshaller have been set.
+ * Template method that gets called after the marshaller and unmarshaller have been
+ * set.
*
* The default implementation does nothing.
- *
- * @deprecated as of Spring Web Services 1.5: {@link #afterPropertiesSet()} is no longer final, so this can safely be
- * overridden in subclasses
+ * @deprecated as of Spring Web Services 1.5: {@link #afterPropertiesSet()} is no
+ * longer final, so this can safely be overridden in subclasses
*/
@Deprecated
- public void afterMarshallerSet() throws Exception {}
+ public void afterMarshallerSet() throws Exception {
+ }
/**
* Template method that subclasses must implement to process a request.
*
- * The unmarshalled request object is passed as a parameter, and the returned object is marshalled to a response. If
- * no response is required, return {@code null}.
- *
+ * The unmarshalled request object is passed as a parameter, and the returned object
+ * is marshalled to a response. If no response is required, return {@code null}.
* @param requestObject the unmarshalled message payload as an object
- * @return the object to be marshalled as response, or {@code null} if a response is not required
+ * @return the object to be marshalled as response, or {@code null} if a response is
+ * not required
*/
protected abstract Object invokeInternal(Object requestObject) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java
index c7da5c34..4d77b618 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractSaxPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,16 +19,18 @@ package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXResult;
-import org.springframework.xml.transform.TransformerObjectSupport;
import org.xml.sax.ContentHandler;
+import org.springframework.xml.transform.TransformerObjectSupport;
+
/**
- * Abstract base class for endpoints that handle the message payload with a SAX {@code ContentHandler}. Allows
- * subclasses to create a response by returning a {@code Source}.
+ * Abstract base class for endpoints that handle the message payload with a SAX
+ * {@code ContentHandler}. Allows subclasses to create a response by returning a
+ * {@code Source}.
*
- * Implementations of this class should create a new handler for each call of {@code createContentHandler}, because of
- * thread safety. The handlers is later passed on to {@code createResponse}, so it can be used for holding
- * request-specific state.
+ * Implementations of this class should create a new handler for each call of
+ * {@code createContentHandler}, because of thread safety. The handlers is later passed on
+ * to {@code createResponse}, so it can be used for holding request-specific state.
*
* @author Arjen Poutsma
* @see #createContentHandler()
@@ -40,9 +42,8 @@ import org.xml.sax.ContentHandler;
public abstract class AbstractSaxPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
/**
- * Invokes the provided {@code ContentHandler} on the given request. After parsing has been done, the provided
- * response is returned.
- *
+ * Invokes the provided {@code ContentHandler} on the given request. After parsing has
+ * been done, the provided response is returned.
* @see #createContentHandler()
* @see #getResponse(org.xml.sax.ContentHandler)
*/
@@ -58,24 +59,25 @@ public abstract class AbstractSaxPayloadEndpoint extends TransformerObjectSuppor
}
/**
- * Returns the SAX {@code ContentHandler} used to parse the incoming request payload. A new instance should be created
- * for each call, because of thread-safety. The content handler can be used to hold request-specific state.
+ * Returns the SAX {@code ContentHandler} used to parse the incoming request payload.
+ * A new instance should be created for each call, because of thread-safety. The
+ * content handler can be used to hold request-specific state.
*
* If an incoming message does not contain a payload, this method will not be invoked.
- *
* @return a SAX content handler to be used for parsing
*/
protected abstract ContentHandler createContentHandler() throws Exception;
/**
- * Returns the response to be given, if any. This method is called after the request payload has been parsed using the
- * SAX {@code ContentHandler}. The passed {@code ContentHandler} is created by {@link #createContentHandler()}: it can
- * be used to hold request-specific state.
+ * Returns the response to be given, if any. This method is called after the request
+ * payload has been parsed using the SAX {@code ContentHandler}. The passed
+ * {@code ContentHandler} is created by {@link #createContentHandler()}: it can be
+ * used to hold request-specific state.
*
- * If an incoming message does not contain a payload, this method will be invoked with {@code null} as content
- * handler.
- *
+ * If an incoming message does not contain a payload, this method will be invoked with
+ * {@code null} as content handler.
* @param contentHandler the content handler used to parse the request
*/
protected abstract Source getResponse(ContentHandler contentHandler) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java
index 21b11746..0b9f1559 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxEventPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,7 +20,11 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.*;
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.util.XMLEventConsumer;
import javax.xml.transform.Result;
@@ -34,12 +38,13 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
/**
- * Abstract base class for endpoints that handle the message payload with event-based StAX. Allows subclasses to read
- * the request with a {@code XMLEventReader}, and to create a response using a {@code XMLEventWriter}.
+ * Abstract base class for endpoints that handle the message payload with event-based
+ * StAX. Allows subclasses to read the request with a {@code XMLEventReader}, and to
+ * create a response using a {@code XMLEventWriter}.
*
* @author Arjen Poutsma
* @see #invokeInternal(javax.xml.stream.XMLEventReader,javax.xml.stream.util.XMLEventConsumer,
- * javax.xml.stream.XMLEventFactory)
+ * javax.xml.stream.XMLEventFactory)
* @see XMLEventReader
* @see XMLEventWriter
* @since 1.0.0
@@ -59,10 +64,10 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
}
/**
- * Create a {@code XMLEventFactory} that this endpoint will use to create {@code XMLEvent}s. Can be overridden in
- * subclasses, adding further initialization of the factory. The resulting {@code XMLEventFactory} is cached, so this
- * method will only be called once.
- *
+ * Create a {@code XMLEventFactory} that this endpoint will use to create
+ * {@code XMLEvent}s. Can be overridden in subclasses, adding further initialization
+ * of the factory. The resulting {@code XMLEventFactory} is cached, so this method
+ * will only be called once.
* @return the created {@code XMLEventFactory}
*/
protected XMLEventFactory createXmlEventFactory() {
@@ -89,7 +94,8 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
if (streamReader != null) {
try {
eventReader = getInputFactory().createXMLEventReader(streamReader);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
eventReader = null;
}
}
@@ -98,7 +104,8 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
if (eventReader == null) {
try {
eventReader = getInputFactory().createXMLEventReader(source);
- } catch (XMLStreamException | UnsupportedOperationException ex) {
+ }
+ catch (XMLStreamException | UnsupportedOperationException ex) {
eventReader = null;
}
}
@@ -120,7 +127,8 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
if (eventWriter == null) {
try {
eventWriter = getOutputFactory().createXMLEventWriter(result);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
// ignore
}
}
@@ -128,9 +136,9 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
}
/**
- * Template method. Subclasses must implement this. Offers the request payload as a {@code XMLEventReader}, and a
- * {@code XMLEventWriter} to write the response payload to.
- *
+ * Template method. Subclasses must implement this. Offers the request payload as a
+ * {@code XMLEventReader}, and a {@code XMLEventWriter} to write the response payload
+ * to.
* @param eventReader the reader to read the payload events from
* @param eventWriter the writer to write payload events to
* @param eventFactory an {@code XMLEventFactory} that can be used to create events
@@ -139,8 +147,9 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
XMLEventFactory eventFactory) throws Exception;
/**
- * Implementation of the {@code XMLEventWriter} interface that creates a response {@code WebServiceMessage} as soon as
- * any method is called, thus lazily creating the response.
+ * Implementation of the {@code XMLEventWriter} interface that creates a response
+ * {@code WebServiceMessage} as soon as any method is called, thus lazily creating the
+ * response.
*/
private class ResponseCreatingEventWriter implements XMLEventWriter {
@@ -180,11 +189,13 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
if (event.isEndDocument()) {
if (os != null) {
eventWriter.flush();
- // if we used an output stream cache, we have to transform it to the response again
+ // if we used an output stream cache, we have to transform it to the
+ // response again
try {
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
transform(new StreamSource(is), messageContext.getResponse().getPayloadResult());
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
throw new XMLStreamException(ex);
}
}
@@ -228,11 +239,14 @@ public abstract class AbstractStaxEventPayloadEndpoint extends AbstractStaxPaylo
WebServiceMessage response = messageContext.getResponse();
eventWriter = getEventWriter(response.getPayloadResult());
if (eventWriter == null) {
- // as a final resort, use a stream, and transform that at endDocument()
+ // as a final resort, use a stream, and transform that at
+ // endDocument()
os = new ByteArrayOutputStream();
eventWriter = getOutputFactory().createXMLEventWriter(os);
}
}
}
+
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxPayloadEndpoint.java
index e07e7585..12a0c416 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,7 +23,8 @@ import org.springframework.xml.XMLInputFactoryUtils;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Abstract base class for endpoints use StAX. Provides an {@code XMLInputFactory} and an {@code XMLOutputFactory}.
+ * Abstract base class for endpoints use StAX. Provides an {@code XMLInputFactory} and an
+ * {@code XMLOutputFactory}.
*
* @author Arjen Poutsma
* @see XMLInputFactory
@@ -56,10 +57,10 @@ public abstract class AbstractStaxPayloadEndpoint extends TransformerObjectSuppo
}
/**
- * Create a {@code XMLInputFactory} that this endpoint will use to create {@code XMLStreamReader}s or
- * {@code XMLEventReader}. Can be overridden in subclasses, adding further initialization of the factory. The
- * resulting {@code XMLInputFactory} is cached, so this method will only be called once.
- *
+ * Create a {@code XMLInputFactory} that this endpoint will use to create
+ * {@code XMLStreamReader}s or {@code XMLEventReader}. Can be overridden in
+ * subclasses, adding further initialization of the factory. The resulting
+ * {@code XMLInputFactory} is cached, so this method will only be called once.
* @return the created {@code XMLInputFactory}
*/
protected XMLInputFactory createXmlInputFactory() {
@@ -67,13 +68,14 @@ public abstract class AbstractStaxPayloadEndpoint extends TransformerObjectSuppo
}
/**
- * Create a {@code XMLOutputFactory} that this endpoint will use to create {@code XMLStreamWriters}s or
- * {@code XMLEventWriters}. Can be overridden in subclasses, adding further initialization of the factory. The
- * resulting {@code XMLOutputFactory} is cached, so this method will only be called once.
- *
+ * Create a {@code XMLOutputFactory} that this endpoint will use to create
+ * {@code XMLStreamWriters}s or {@code XMLEventWriters}. Can be overridden in
+ * subclasses, adding further initialization of the factory. The resulting
+ * {@code XMLOutputFactory} is cached, so this method will only be called once.
* @return the created {@code XMLOutputFactory}
*/
protected XMLOutputFactory createXmlOutputFactory() {
return XMLOutputFactory.newInstance();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java
index 387d4d9a..c482f93e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractStaxStreamPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,8 +35,9 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
/**
- * Abstract base class for endpoints that handle the message payload with streaming StAX. Allows subclasses to read the
- * request with a {@code XMLStreamReader}, and to create a response using a {@code XMLStreamWriter}.
+ * Abstract base class for endpoints that handle the message payload with streaming StAX.
+ * Allows subclasses to read the request with a {@code XMLStreamReader}, and to create a
+ * response using a {@code XMLStreamWriter}.
*
* @author Arjen Poutsma
* @see #invokeInternal(javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamWriter)
@@ -69,7 +70,8 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
if (eventReader != null) {
try {
streamReader = StaxUtils.createEventStreamReader(eventReader);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
streamReader = null;
}
}
@@ -79,7 +81,8 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
if (streamReader == null) {
try {
streamReader = getInputFactory().createXMLStreamReader(source);
- } catch (XMLStreamException | UnsupportedOperationException ex) {
+ }
+ catch (XMLStreamException | UnsupportedOperationException ex) {
// ignore
}
}
@@ -101,7 +104,8 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
if (streamWriter == null) {
try {
streamWriter = getOutputFactory().createXMLStreamWriter(result);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
// ignore
}
}
@@ -109,17 +113,18 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
}
/**
- * Template method. Subclasses must implement this. Offers the request payload as a {@code XMLStreamReader}, and a
- * {@code XMLStreamWriter} to write the response payload to.
- *
+ * Template method. Subclasses must implement this. Offers the request payload as a
+ * {@code XMLStreamReader}, and a {@code XMLStreamWriter} to write the response
+ * payload to.
* @param streamReader the reader to read the payload from
* @param streamWriter the writer to write the payload to
*/
protected abstract void invokeInternal(XMLStreamReader streamReader, XMLStreamWriter streamWriter) throws Exception;
/**
- * Implementation of the {@code XMLStreamWriter} interface that creates a response {@code WebServiceMessage} as soon
- * as any method is called, thus lazily creating the response.
+ * Implementation of the {@code XMLStreamWriter} interface that creates a response
+ * {@code WebServiceMessage} as soon as any method is called, thus lazily creating the
+ * response.
*/
private class ResponseCreatingStreamWriter implements XMLStreamWriter {
@@ -150,12 +155,14 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
streamWriter.close();
if (os != null) {
streamWriter.flush();
- // if we used an output stream cache, we have to transform it to the response again
+ // if we used an output stream cache, we have to transform it to the
+ // response again
try {
ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
transform(new StreamSource(is), messageContext.getResponse().getPayloadResult());
os = null;
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
throw new XMLStreamException(ex);
}
}
@@ -344,11 +351,14 @@ public abstract class AbstractStaxStreamPayloadEndpoint extends AbstractStaxPayl
WebServiceMessage response = messageContext.getResponse();
streamWriter = getStreamWriter(response.getPayloadResult());
if (streamWriter == null) {
- // as a final resort, use a stream, and transform that at endDocument()
+ // as a final resort, use a stream, and transform that at
+ // endDocument()
os = new ByteArrayOutputStream();
streamWriter = getOutputFactory().createXMLStreamWriter(os);
}
}
}
+
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java
index 346c445d..82ab631f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractValidatingMarshallingPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,9 +23,9 @@ import org.springframework.validation.Validator;
import org.springframework.ws.context.MessageContext;
/**
- * Extension of the {@link AbstractMarshallingPayloadEndpoint} which validates the request payload with
- * {@link Validator}(s). The desired validators can be set using properties, and must
- * {@link Validator#supports(Class) support} the request object.
+ * Extension of the {@link AbstractMarshallingPayloadEndpoint} which validates the request
+ * payload with {@link Validator}(s). The desired validators can be set using properties,
+ * and must {@link Validator#supports(Class) support} the request object.
*
* @author Arjen Poutsma
* @since 1.0.2
@@ -58,9 +58,10 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
}
/**
- * Set the primary {@link Validator} for this endpoint. The {@link Validator} is must support the unmarshalled class.
- * If there are one or more existing validators set already when this method is called, only the specified validator
- * will be kept. Use {@link #setValidators(Validator[])} to set multiple validators.
+ * Set the primary {@link Validator} for this endpoint. The {@link Validator} is must
+ * support the unmarshalled class. If there are one or more existing validators set
+ * already when this method is called, only the specified validator will be kept. Use
+ * {@link #setValidators(Validator[])} to set multiple validators.
*/
public void setValidator(Validator validator) {
this.validators = new Validator[] { validator };
@@ -71,7 +72,10 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
return validators;
}
- /** Set the Validators for this controller. The Validator must support the specified command class. */
+ /**
+ * Set the Validators for this controller. The Validator must support the specified
+ * command class.
+ */
public void setValidators(Validator[] validators) {
this.validators = validators;
}
@@ -92,12 +96,15 @@ public abstract class AbstractValidatingMarshallingPayloadEndpoint extends Abstr
}
/**
- * Callback for post-processing validation errors. Called when validator(s) have been specified, and validation fails.
- *
+ * Callback for post-processing validation errors. Called when validator(s) have been
+ * specified, and validation fails.
* @param messageContext the message context
- * @param requestObject the object unmarshalled from the {@link MessageContext#getRequest() request}
+ * @param requestObject the object unmarshalled from the
+ * {@link MessageContext#getRequest() request}
* @param errors validation errors holder
- * @return {@code true} to continue and call {@link #invokeInternal(Object)}; {@code false} otherwise
+ * @return {@code true} to continue and call {@link #invokeInternal(Object)};
+ * {@code false} otherwise
*/
protected abstract boolean onValidationErrors(MessageContext messageContext, Object requestObject, Errors errors);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java
index 740a6336..88309f13 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/AbstractXomPayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,12 @@
package org.springframework.ws.server.endpoint;
-import nu.xom.*;
-import nu.xom.converters.DOMConverter;
-
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
import java.util.Locale;
import javax.xml.stream.XMLEventReader;
@@ -29,21 +31,32 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
-import org.springframework.core.NestedRuntimeException;
-import org.springframework.xml.namespace.QNameUtils;
-import org.springframework.xml.transform.TransformerObjectSupport;
-import org.springframework.xml.transform.TraxUtils;
+import nu.xom.Attribute;
+import nu.xom.Builder;
+import nu.xom.Document;
+import nu.xom.Element;
+import nu.xom.NodeFactory;
+import nu.xom.ParentNode;
+import nu.xom.ParsingException;
+import nu.xom.Serializer;
+import nu.xom.converters.DOMConverter;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
+import org.springframework.core.NestedRuntimeException;
+import org.springframework.xml.namespace.QNameUtils;
+import org.springframework.xml.transform.TransformerObjectSupport;
+import org.springframework.xml.transform.TraxUtils;
+
/**
- * Abstract base class for endpoints that handle the message payload as XOM elements. Offers the message payload as a
- * XOM {@code Element}, and allows subclasses to create a response by returning an {@code Element}.
+ * Abstract base class for endpoints that handle the message payload as XOM elements.
+ * Offers the message payload as a XOM {@code Element}, and allows subclasses to create a
+ * response by returning an {@code Element}.
*
- * An {@code AbstractXomPayloadEndpoint} only accept one payload element. Multiple payload elements are not in
- * accordance with WS-I.
+ * An {@code AbstractXomPayloadEndpoint} only accept one payload element. Multiple payload
+ * elements are not in accordance with WS-I.
*
* @author Arjen Poutsma
* @see Element
@@ -61,7 +74,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
XomSourceCallback sourceCallback = new XomSourceCallback();
try {
TraxUtils.doWithSource(request, sourceCallback);
- } catch (XomParsingException ex) {
+ }
+ catch (XomParsingException ex) {
throw (ParsingException) ex.getCause();
}
requestElement = sourceCallback.element;
@@ -85,8 +99,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
/**
* Creates a {@link Serializer} to be used for writing the response to.
*
- * Default implementation uses the UTF-8 encoding and does not set any options, but this may be changed in subclasses.
- *
+ * Default implementation uses the UTF-8 encoding and does not set any options, but
+ * this may be changed in subclasses.
* @param outputStream the output stream to serialize to
* @return the serializer
*/
@@ -95,9 +109,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
}
/**
- * Template method. Subclasses must implement this. Offers the request payload as a XOM {@code Element}, and allows
- * subclasses to return a response {@code Element}.
- *
+ * Template method. Subclasses must implement this. Offers the request payload as a
+ * XOM {@code Element}, and allows subclasses to return a response {@code Element}.
* @param requestElement the contents of the SOAP message as XOM element
* @return the response element. Can be {@code null} to specify no response.
*/
@@ -111,10 +124,12 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
public void domSource(Node node) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
element = DOMConverter.convert((org.w3c.dom.Element) node);
- } else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+ }
+ else if (node.getNodeType() == Node.DOCUMENT_NODE) {
Document document = DOMConverter.convert((org.w3c.dom.Document) node);
element = document.getRootElement();
- } else {
+ }
+ else {
throw new IllegalArgumentException("DOMSource contains neither Document nor Element");
}
}
@@ -126,14 +141,17 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
Document document;
if (inputSource.getByteStream() != null) {
document = builder.build(inputSource.getByteStream());
- } else if (inputSource.getCharacterStream() != null) {
+ }
+ else if (inputSource.getCharacterStream() != null) {
document = builder.build(inputSource.getCharacterStream());
- } else {
+ }
+ else {
throw new IllegalArgumentException(
"InputSource in SAXSource contains neither byte stream nor character stream");
}
element = document.getRootElement();
- } catch (ParsingException e) {
+ }
+ catch (ParsingException e) {
throw new XomParsingException(e);
}
}
@@ -155,7 +173,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
Builder builder = new Builder();
Document document = builder.build(inputStream);
element = document.getRootElement();
- } catch (ParsingException ex) {
+ }
+ catch (ParsingException ex) {
throw new XomParsingException(ex);
}
}
@@ -166,7 +185,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
Builder builder = new Builder();
Document document = builder.build(reader);
element = document.getRootElement();
- } catch (ParsingException ex) {
+ }
+ catch (ParsingException ex) {
throw new XomParsingException(ex);
}
}
@@ -177,10 +197,12 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
Builder builder = new Builder();
Document document = builder.build(systemId);
element = document.getRootElement();
- } catch (ParsingException ex) {
+ }
+ catch (ParsingException ex) {
throw new XomParsingException(ex);
}
}
+
}
@SuppressWarnings("serial")
@@ -189,6 +211,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
private XomParsingException(ParsingException ex) {
super(ex.getMessage(), ex);
}
+
}
private static class StaxStreamConverter {
@@ -219,7 +242,8 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
if (element == null) {
element = nodeFactory.makeRootElement(name, streamReader.getNamespaceURI());
document.setRootElement(element);
- } else {
+ }
+ else {
element = nodeFactory.startMakingElement(name, streamReader.getNamespaceURI());
parent.appendChild(element);
}
@@ -275,28 +299,39 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
type = type.toUpperCase(Locale.ENGLISH);
if ("CDATA".equals(type)) {
return Attribute.Type.CDATA;
- } else if ("ENTITIES".equals(type)) {
+ }
+ else if ("ENTITIES".equals(type)) {
return Attribute.Type.ENTITIES;
- } else if ("ENTITY".equals(type)) {
+ }
+ else if ("ENTITY".equals(type)) {
return Attribute.Type.ENTITY;
- } else if ("ENUMERATION".equals(type)) {
+ }
+ else if ("ENUMERATION".equals(type)) {
return Attribute.Type.ENUMERATION;
- } else if ("ID".equals(type)) {
+ }
+ else if ("ID".equals(type)) {
return Attribute.Type.ID;
- } else if ("IDREF".equals(type)) {
+ }
+ else if ("IDREF".equals(type)) {
return Attribute.Type.IDREF;
- } else if ("IDREFS".equals(type)) {
+ }
+ else if ("IDREFS".equals(type)) {
return Attribute.Type.IDREFS;
- } else if ("NMTOKEN".equals(type)) {
+ }
+ else if ("NMTOKEN".equals(type)) {
return Attribute.Type.NMTOKEN;
- } else if ("NMTOKENS".equals(type)) {
+ }
+ else if ("NMTOKENS".equals(type)) {
return Attribute.Type.NMTOKENS;
- } else if ("NOTATION".equals(type)) {
+ }
+ else if ("NOTATION".equals(type)) {
return Attribute.Type.NOTATION;
- } else {
+ }
+ else {
return Attribute.Type.UNDECLARED;
}
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MessageEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MessageEndpoint.java
index aa6169a0..19850255 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MessageEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MessageEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,8 +21,9 @@ import org.springframework.ws.context.MessageContext;
/**
* Defines the basic contract for Web Services interested in the entire message payload.
*
- * The main entrypoint is {@link #invoke(MessageContext)}, which gets invoked with the message context. This context
- * contains the {@link MessageContext#getRequest() request}, and can be used to create a response.
+ * The main entrypoint is {@link #invoke(MessageContext)}, which gets invoked with the
+ * message context. This context contains the {@link MessageContext#getRequest() request},
+ * and can be used to create a response.
*
* @author Arjen Poutsma
* @see org.springframework.ws.server.endpoint.PayloadEndpoint
@@ -34,9 +35,9 @@ public interface MessageEndpoint {
* Invokes an operation.
*
* The given {@code messageContext} can be used to create a response.
- *
* @param messageContext the message context
* @throws Exception if an exception occurs
*/
void invoke(MessageContext messageContext) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MethodEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MethodEndpoint.java
index 1951a3e3..771d0074 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MethodEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/MethodEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,7 +25,8 @@ import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
/**
- * Represents a bean method that will be invoked as part of an incoming Web service message.
+ * Represents a bean method that will be invoked as part of an incoming Web service
+ * message.
*
* Consists of a {@link Method}, and a bean {@link Object}.
*
@@ -42,7 +43,6 @@ public final class MethodEndpoint {
/**
* Constructs a new method endpoint with the given bean and method.
- *
* @param bean the object bean
* @param method the method
*/
@@ -56,7 +56,6 @@ public final class MethodEndpoint {
/**
* Constructs a new method endpoint with the given bean, method name and parameters.
- *
* @param bean the object bean
* @param methodName the method name
* @param parameterTypes the method parameter types
@@ -71,9 +70,8 @@ public final class MethodEndpoint {
}
/**
- * Constructs a new method endpoint with the given bean name and method. The bean name will be lazily initialized when
- * {@link #invoke(Object...)} is called.
- *
+ * Constructs a new method endpoint with the given bean name and method. The bean name
+ * will be lazily initialized when {@link #invoke(Object...)} is called.
* @param beanName the bean name
* @param beanFactory the bean factory to use for bean initialization
* @param method the method
@@ -94,7 +92,8 @@ public final class MethodEndpoint {
if (beanFactory != null && bean instanceof String) {
String beanName = (String) bean;
return beanFactory.getBean(beanName);
- } else {
+ }
+ else {
return bean;
}
}
@@ -121,7 +120,6 @@ public final class MethodEndpoint {
/**
* Invokes this method endpoint with the given arguments.
- *
* @param args the arguments
* @return the invocation result
* @throws Exception when the method invocation results in an exception
@@ -131,7 +129,8 @@ public final class MethodEndpoint {
ReflectionUtils.makeAccessible(method);
try {
return method.invoke(endpoint, args);
- } catch (InvocationTargetException ex) {
+ }
+ catch (InvocationTargetException ex) {
handleInvocationTargetException(ex);
throw new IllegalStateException("Unexpected exception thrown by method - "
+ ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage());
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/PayloadEndpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/PayloadEndpoint.java
index 88ec7255..4def1d43 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/PayloadEndpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/PayloadEndpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,8 @@ import javax.xml.transform.Source;
/**
* Defines the basic contract for Web Services interested in just the message payload.
*
- * The main entrypoint is {@link #invoke(Source)}, which gets invoked with the contents of the requesting message.
+ * The main entrypoint is {@link #invoke(Source)}, which gets invoked with the contents of
+ * the requesting message.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -29,11 +30,13 @@ import javax.xml.transform.Source;
public interface PayloadEndpoint {
/**
- * Invokes the endpoint with the given request payload, and possibly returns a response.
- *
+ * Invokes the endpoint with the given request payload, and possibly returns a
+ * response.
* @param request the payload of the request message, may be {@code null}
- * @return the payload of the response message, may be {@code null} to indicate no response
+ * @return the payload of the response message, may be {@code null} to indicate no
+ * response
* @throws Exception if an exception occurs
*/
Source invoke(Source request) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java
index 8637e08a..ef412a82 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/AbstractMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,8 +22,8 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Abstract base class for {@link EndpointAdapter} implementations that support {@link MethodEndpoint}s. Contains
- * template methods for handling these method endpoints.
+ * Abstract base class for {@link EndpointAdapter} implementations that support
+ * {@link MethodEndpoint}s. Contains template methods for handling these method endpoints.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -31,8 +31,8 @@ import org.springframework.xml.transform.TransformerObjectSupport;
public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSupport implements EndpointAdapter {
/**
- * Delegates to {@link #supportsInternal(org.springframework.ws.server.endpoint.MethodEndpoint)}.
- *
+ * Delegates to
+ * {@link #supportsInternal(org.springframework.ws.server.endpoint.MethodEndpoint)}.
* @param endpoint endpoint object to check
* @return whether or not this adapter can adapt the given endpoint
*/
@@ -42,11 +42,12 @@ public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSup
}
/**
- * Delegates to {@link #invokeInternal(org.springframework.ws.context.MessageContext,MethodEndpoint)}.
- *
+ * Delegates to
+ * {@link #invokeInternal(org.springframework.ws.context.MessageContext,MethodEndpoint)}.
* @param messageContext the current message context
- * @param endpoint the endpoint to use. This object must have previously been passed to the {@code supportsInternal}
- * method of this interface, which must have returned {@code true}
+ * @param endpoint the endpoint to use. This object must have previously been passed
+ * to the {@code supportsInternal} method of this interface, which must have returned
+ * {@code true}
* @throws Exception in case of errors
*/
@Override
@@ -56,7 +57,6 @@ public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSup
/**
* Given a method endpoint, return whether or not this adapter can support it.
- *
* @param methodEndpoint method endpoint to check
* @return whether or not this adapter can adapt the given method
*/
@@ -64,11 +64,11 @@ public abstract class AbstractMethodEndpointAdapter extends TransformerObjectSup
/**
* Use the given method endpoint to handle the request.
- *
* @param messageContext the current message context
* @param methodEndpoint the method endpoint to use
* @throws Exception in case of errors
*/
- protected abstract void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception;
+ protected abstract void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint)
+ throws Exception;
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java
index 17e06ccb..002b0370 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,8 +43,8 @@ import org.springframework.ws.server.endpoint.adapter.method.jaxb.XmlRootElement
/**
* Default extension of {@link AbstractMethodEndpointAdapter} with support for pluggable
- * {@linkplain MethodArgumentResolver argument resolvers} and {@linkplain MethodReturnValueHandler return value
- * handlers}.
+ * {@linkplain MethodArgumentResolver argument resolvers} and
+ * {@linkplain MethodReturnValueHandler return value handlers}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -98,8 +98,9 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
}
/**
- * Sets the custom handlers for method arguments. Custom handlers are ordered after built-in ones. To override the
- * built-in support for return value handling use {@link #setMethodArgumentResolvers(List)}.
+ * Sets the custom handlers for method arguments. Custom handlers are ordered after
+ * built-in ones. To override the built-in support for return value handling use
+ * {@link #setMethodArgumentResolvers(List)}.
*/
public void setCustomMethodArgumentResolvers(List customMethodArgumentResolvers) {
this.customMethodArgumentResolvers = customMethodArgumentResolvers;
@@ -127,8 +128,9 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
}
/**
- * Sets the handlers for custom return value types. Custom handlers are ordered after built-in ones. To override the
- * built-in support for return value handling use {@link #setMethodReturnValueHandlers(List)}.
+ * Sets the handlers for custom return value types. Custom handlers are ordered after
+ * built-in ones. To override the built-in support for return value handling use
+ * {@link #setMethodReturnValueHandlers(List)}.
*/
public void setCustomMethodReturnValueHandlers(List customMethodReturnValueHandlers) {
this.customMethodReturnValueHandlers = customMethodReturnValueHandlers;
@@ -190,16 +192,17 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
}
/**
- * Certain (SOAP-specific) {@code MethodArgumentResolver}s have to be instantiated by class name, in order to not
- * introduce a cyclic dependency.
+ * Certain (SOAP-specific) {@code MethodArgumentResolver}s have to be instantiated by
+ * class name, in order to not introduce a cyclic dependency.
*/
@SuppressWarnings("unchecked")
private void addMethodArgumentResolver(String className, List methodArgumentResolvers) {
try {
Class methodArgumentResolverClass = (Class) ClassUtils
- .forName(className, getClassLoader());
+ .forName(className, getClassLoader());
methodArgumentResolvers.add(BeanUtils.instantiateClass(methodArgumentResolverClass));
- } catch (ClassNotFoundException e) {
+ }
+ catch (ClassNotFoundException e) {
logger.warn("Could not find \"" + className + "\" on the classpath");
}
}
@@ -297,15 +300,16 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
/**
* Returns the argument array for the given method endpoint.
*
- * This implementation iterates over the set {@linkplain #setMethodArgumentResolvers(List) argument resolvers} to
- * resolve each argument.
- *
+ * This implementation iterates over the set
+ * {@linkplain #setMethodArgumentResolvers(List) argument resolvers} to resolve each
+ * argument.
* @param messageContext the current message context
* @param methodEndpoint the method endpoint to get arguments for
* @return the arguments
* @throws Exception in case of errors
*/
- protected Object[] getMethodArguments(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception {
+ protected Object[] getMethodArguments(MessageContext messageContext, MethodEndpoint methodEndpoint)
+ throws Exception {
MethodParameter[] parameters = methodEndpoint.getMethodParameters();
Object[] args = new Object[parameters.length];
for (int i = 0; i < parameters.length; i++) {
@@ -322,9 +326,9 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
/**
* Handle the return value for the given method endpoint.
*
- * This implementation iterates over the set {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value
- * handlers} to resolve the return value.
- *
+ * This implementation iterates over the set
+ * {@linkplain #setMethodReturnValueHandlers(java.util.List)} return value handlers}
+ * to resolve the return value.
* @param messageContext the current message context
* @param returnValue the return value
* @param methodEndpoint the method endpoint to get arguments for
@@ -339,6 +343,8 @@ public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter
return;
}
}
- throw new IllegalStateException("Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler");
+ throw new IllegalStateException(
+ "Return value [" + returnValue + "] not resolved by any MethodReturnValueHandler");
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter.java
index 1d20e561..b1f80113 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,49 +26,53 @@ import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.ws.server.endpoint.MethodEndpoint;
/**
- * Subclass of {@link MarshallingMethodEndpointAdapter} that supports {@link GenericMarshaller} and
- * {@link GenericUnmarshaller}. More specifically, this adapter is aware of the
- * {@link Method#getGenericParameterTypes()} and {@link Method#getGenericReturnType()}.
+ * Subclass of {@link MarshallingMethodEndpointAdapter} that supports
+ * {@link GenericMarshaller} and {@link GenericUnmarshaller}. More specifically, this
+ * adapter is aware of the {@link Method#getGenericParameterTypes()} and
+ * {@link Method#getGenericReturnType()}.
*
- * Prefer to use this adapter rather than the plain {@link MarshallingMethodEndpointAdapter} in combination with Java 5
- * marshallers, such as the {@link Jaxb2Marshaller}.
+ * Prefer to use this adapter rather than the plain
+ * {@link MarshallingMethodEndpointAdapter} in combination with Java 5 marshallers, such
+ * as the {@link Jaxb2Marshaller}.
*
* @author Arjen Poutsma
* @since 1.0.2
- * @deprecated as of Spring Web Services 2.0, in favor of {@link DefaultMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
- * MarshallingPayloadMethodProcessor}.
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link DefaultMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
+ * MarshallingPayloadMethodProcessor}.
*/
@Deprecated
public class GenericMarshallingMethodEndpointAdapter extends MarshallingMethodEndpointAdapter {
/**
- * Creates a new {@code GenericMarshallingMethodEndpointAdapter}. The {@link Marshaller} and {@link Unmarshaller} must
- * be injected using properties.
- *
+ * Creates a new {@code GenericMarshallingMethodEndpointAdapter}. The
+ * {@link Marshaller} and {@link Unmarshaller} must be injected using properties.
* @see #setMarshaller(org.springframework.oxm.Marshaller)
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
- public GenericMarshallingMethodEndpointAdapter() {}
+ public GenericMarshallingMethodEndpointAdapter() {
+ }
/**
- * Creates a new {@code GenericMarshallingMethodEndpointAdapter} with the given marshaller. If the given
- * {@link Marshaller} also implements the {@link Unmarshaller} interface, it is used for both marshalling and
- * unmarshalling. Otherwise, an exception is thrown.
+ * Creates a new {@code GenericMarshallingMethodEndpointAdapter} with the given
+ * marshaller. If the given {@link Marshaller} also implements the
+ * {@link Unmarshaller} interface, it is used for both marshalling and unmarshalling.
+ * Otherwise, an exception is thrown.
*
- * Note that all {@link Marshaller} implementations in Spring-WS also implement the {@link Unmarshaller} interface, so
- * that you can safely use this constructor.
- *
+ * Note that all {@link Marshaller} implementations in Spring-WS also implement the
+ * {@link Unmarshaller} interface, so that you can safely use this constructor.
* @param marshaller object used as marshaller and unmarshaller
- * @throws IllegalArgumentException when {@code marshaller} does not implement the {@link Unmarshaller} interface
+ * @throws IllegalArgumentException when {@code marshaller} does not implement the
+ * {@link Unmarshaller} interface
*/
public GenericMarshallingMethodEndpointAdapter(Marshaller marshaller) {
super(marshaller);
}
/**
- * Creates a new {@code GenericMarshallingMethodEndpointAdapter} with the given marshaller and unmarshaller.
- *
+ * Creates a new {@code GenericMarshallingMethodEndpointAdapter} with the given
+ * marshaller and unmarshaller.
* @param marshaller the marshaller to use
* @param unmarshaller the unmarshaller to use
*/
@@ -85,10 +89,12 @@ public class GenericMarshallingMethodEndpointAdapter extends MarshallingMethodEn
private boolean supportsReturnType(Method method) {
if (Void.TYPE.equals(method.getReturnType())) {
return true;
- } else {
+ }
+ else {
if (getMarshaller() instanceof GenericMarshaller) {
return ((GenericMarshaller) getMarshaller()).supports(method.getGenericReturnType());
- } else {
+ }
+ else {
return getMarshaller().supports(method.getReturnType());
}
}
@@ -97,11 +103,14 @@ public class GenericMarshallingMethodEndpointAdapter extends MarshallingMethodEn
private boolean supportsParameters(Method method) {
if (method.getParameterTypes().length != 1) {
return false;
- } else if (getUnmarshaller() instanceof GenericUnmarshaller) {
+ }
+ else if (getUnmarshaller() instanceof GenericUnmarshaller) {
GenericUnmarshaller genericUnmarshaller = (GenericUnmarshaller) getUnmarshaller();
return genericUnmarshaller.supports(method.getGenericParameterTypes()[0]);
- } else {
+ }
+ else {
return getUnmarshaller().supports(method.getParameterTypes()[0]);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java
index 569fc1f8..af25e29c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,7 +30,8 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.support.MarshallingUtils;
/**
- * Adapter that supports endpoint methods that use marshalling. Supports methods with the following signature:
+ * Adapter that supports endpoint methods that use marshalling. Supports methods with the
+ * following signature:
*
*
*
- * I.e. methods that take a single parameter that {@link Unmarshaller#supports(Class) is supported} by the
- * {@link Unmarshaller}, and return either {@code void} or a type {@link Marshaller#supports(Class) supported} by the
- * {@link Marshaller}. The method can have any name, as long as it is mapped by an {@link EndpointMapping}.
+ * I.e. methods that take a single parameter that {@link Unmarshaller#supports(Class) is
+ * supported} by the {@link Unmarshaller}, and return either {@code void} or a type
+ * {@link Marshaller#supports(Class) supported} by the {@link Marshaller}. The method can
+ * have any name, as long as it is mapped by an {@link EndpointMapping}.
*
- * This endpoint needs a {@code Marshaller} and {@code Unmarshaller}, both of which can be set using properties.
+ * This endpoint needs a {@code Marshaller} and {@code Unmarshaller}, both of which can be
+ * set using properties.
*
* @author Arjen Poutsma
* @see #setMarshaller(org.springframework.oxm.Marshaller)
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
* @since 1.0.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link DefaultMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
- * MarshallingPayloadMethodProcessor}.
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link DefaultMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MarshallingPayloadMethodProcessor
+ * MarshallingPayloadMethodProcessor}.
*/
@Deprecated
public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdapter implements InitializingBean {
@@ -64,24 +68,25 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
private Unmarshaller unmarshaller;
/**
- * Creates a new {@code MarshallingMethodEndpointAdapter}. The {@link Marshaller} and {@link Unmarshaller} must be
- * injected using properties.
- *
+ * Creates a new {@code MarshallingMethodEndpointAdapter}. The {@link Marshaller} and
+ * {@link Unmarshaller} must be injected using properties.
* @see #setMarshaller(org.springframework.oxm.Marshaller)
* @see #setUnmarshaller(org.springframework.oxm.Unmarshaller)
*/
- public MarshallingMethodEndpointAdapter() {}
+ public MarshallingMethodEndpointAdapter() {
+ }
/**
- * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller. If the given {@link Marshaller}
- * also implements the {@link Unmarshaller} interface, it is used for both marshalling and unmarshalling. Otherwise,
- * an exception is thrown.
+ * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller.
+ * If the given {@link Marshaller} also implements the {@link Unmarshaller} interface,
+ * it is used for both marshalling and unmarshalling. Otherwise, an exception is
+ * thrown.
*
- * Note that all {@link Marshaller} implementations in Spring also implement the {@link Unmarshaller} interface, so
- * that you can safely use this constructor.
- *
+ * Note that all {@link Marshaller} implementations in Spring also implement the
+ * {@link Unmarshaller} interface, so that you can safely use this constructor.
* @param marshaller object used as marshaller and unmarshaller
- * @throws IllegalArgumentException when {@code marshaller} does not implement the {@link Unmarshaller} interface
+ * @throws IllegalArgumentException when {@code marshaller} does not implement the
+ * {@link Unmarshaller} interface
*/
public MarshallingMethodEndpointAdapter(Marshaller marshaller) {
Assert.notNull(marshaller, "marshaller must not be null");
@@ -89,15 +94,16 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller "
+ "interface. Please set an Unmarshaller explicitly by using the "
+ "MarshallingMethodEndpointAdapter(Marshaller, Unmarshaller) constructor.");
- } else {
+ }
+ else {
this.setMarshaller(marshaller);
this.setUnmarshaller((Unmarshaller) marshaller);
}
}
/**
- * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller and unmarshaller.
- *
+ * Creates a new {@code MarshallingMethodEndpointAdapter} with the given marshaller
+ * and unmarshaller.
* @param marshaller the marshaller to use
* @param unmarshaller the unmarshaller to use
*/
@@ -161,8 +167,8 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
}
/**
- * Supports a method with a single, unmarshallable parameter, and that return {@code void} or a marshallable type.
- *
+ * Supports a method with a single, unmarshallable parameter, and that return
+ * {@code void} or a marshallable type.
* @see Marshaller#supports(Class)
* @see Unmarshaller#supports(Class)
*/
@@ -179,8 +185,10 @@ public class MarshallingMethodEndpointAdapter extends AbstractMethodEndpointAdap
private boolean supportsParameters(Method method) {
if (method.getParameterTypes().length != 1) {
return false;
- } else {
+ }
+ else {
return getUnmarshaller().supports(method.getParameterTypes()[0]);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java
index 888524de..f40c9ae4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,9 +23,11 @@ import org.springframework.ws.server.endpoint.MessageEndpoint;
import org.springframework.ws.soap.server.SoapMessageDispatcher;
/**
- * Adapter to use a {@code MessageEndpoint} as the endpoint for a {@code EndpointInvocationChain}.
+ * Adapter to use a {@code MessageEndpoint} as the endpoint for a
+ * {@code EndpointInvocationChain}.
*
- * This adapter is registered by default by the {@link MessageDispatcher} and {@link SoapMessageDispatcher}.
+ * This adapter is registered by default by the {@link MessageDispatcher} and
+ * {@link SoapMessageDispatcher}.
*
* @author Arjen Poutsma
* @see org.springframework.ws.server.EndpointInvocationChain
@@ -42,4 +44,5 @@ public class MessageEndpointAdapter implements EndpointAdapter {
public void invoke(MessageContext messageContext, Object endpoint) throws Exception {
((MessageEndpoint) endpoint).invoke(messageContext);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapter.java
index 8667c009..b6fafae1 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,22 +24,26 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.soap.server.SoapMessageDispatcher;
/**
- * Adapter that supports endpoint methods with message contexts. Supports methods with the following signature:
+ * Adapter that supports endpoint methods with message contexts. Supports methods with the
+ * following signature:
*
*
* void handleMyMessage(MessageContext request);
*
*
- * I.e. methods that take a single {@link MessageContext} parameter, and return {@code void}. The method can have any
- * name, as long as it is mapped by an {@link org.springframework.ws.server.EndpointMapping}.
+ * I.e. methods that take a single {@link MessageContext} parameter, and return
+ * {@code void}. The method can have any name, as long as it is mapped by an
+ * {@link org.springframework.ws.server.EndpointMapping}.
*
- * This adapter is registered by default by the {@link MessageDispatcher} and {@link SoapMessageDispatcher}.
+ * This adapter is registered by default by the {@link MessageDispatcher} and
+ * {@link SoapMessageDispatcher}.
*
* @author Arjen Poutsma
* @since 1.0.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link DefaultMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.method.MessageContextMethodArgumentResolver
- * MessageContextMethodArgumentResolver}.
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link DefaultMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MessageContextMethodArgumentResolver
+ * MessageContextMethodArgumentResolver}.
*/
@Deprecated
public class MessageMethodEndpointAdapter extends AbstractMethodEndpointAdapter {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java
index 94d493c0..debe0bbf 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,9 +27,11 @@ import org.springframework.ws.soap.server.SoapMessageDispatcher;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Adapter to use a {@code PayloadEndpoint} as the endpoint for a {@code EndpointInvocationChain}.
+ * Adapter to use a {@code PayloadEndpoint} as the endpoint for a
+ * {@code EndpointInvocationChain}.
*
- * This adapter is registered by default by the {@link MessageDispatcher} and {@link SoapMessageDispatcher}.
+ * This adapter is registered by default by the {@link MessageDispatcher} and
+ * {@link SoapMessageDispatcher}.
*
* @author Arjen Poutsma
* @see org.springframework.ws.server.endpoint.PayloadEndpoint
@@ -53,4 +55,5 @@ public class PayloadEndpointAdapter extends TransformerObjectSupport implements
transform(responseSource, response.getPayloadResult());
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapter.java
index 19c43299..b537269a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,7 +27,8 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.soap.server.SoapMessageDispatcher;
/**
- * Adapter that supports endpoint methods that use marshalling. Supports methods with the following signature:
+ * Adapter that supports endpoint methods that use marshalling. Supports methods with the
+ * following signature:
*
*
*
- * I.e. methods that take a single {@link Source} parameter, and return either {@code void} or a {@link Source}. The
- * method can have any name, as long as it is mapped by an {@link org.springframework.ws.server.EndpointMapping}.
+ * I.e. methods that take a single {@link Source} parameter, and return either
+ * {@code void} or a {@link Source}. The method can have any name, as long as it is mapped
+ * by an {@link org.springframework.ws.server.EndpointMapping}.
*
- * This adapter is registered by default by the {@link MessageDispatcher} and {@link SoapMessageDispatcher}.
+ * This adapter is registered by default by the {@link MessageDispatcher} and
+ * {@link SoapMessageDispatcher}.
*
* @author Arjen Poutsma
* @since 1.0.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link DefaultMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.method.SourcePayloadMethodProcessor
- * SourcePayloadMethodProcessor}.
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link DefaultMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.SourcePayloadMethodProcessor
+ * SourcePayloadMethodProcessor}.
*/
@Deprecated
public class PayloadMethodEndpointAdapter extends AbstractMethodEndpointAdapter {
@@ -56,8 +60,9 @@ public class PayloadMethodEndpointAdapter extends AbstractMethodEndpointAdapter
@Override
protected boolean supportsInternal(MethodEndpoint methodEndpoint) {
Method method = methodEndpoint.getMethod();
- return (Void.TYPE.isAssignableFrom(method.getReturnType()) || Source.class.isAssignableFrom(method.getReturnType()))
- && method.getParameterTypes().length == 1 && Source.class.isAssignableFrom(method.getParameterTypes()[0]);
+ return (Void.TYPE.isAssignableFrom(method.getReturnType())
+ || Source.class.isAssignableFrom(method.getReturnType())) && method.getParameterTypes().length == 1
+ && Source.class.isAssignableFrom(method.getParameterTypes()[0]);
}
@@ -71,4 +76,5 @@ public class PayloadMethodEndpointAdapter extends AbstractMethodEndpointAdapter
transform(responseSource, response.getPayloadResult());
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java
index 163126b4..5a21e17d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,19 +29,21 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.server.endpoint.annotation.XPathParam;
import org.springframework.xml.namespace.SimpleNamespaceContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
- * Adapter that supports endpoint methods that use XPath expressions. Supports methods with the following signature:
+ * Adapter that supports endpoint methods that use XPath expressions. Supports methods
+ * with the following signature:
*
*
*
- * I.e. methods that return either {@code void} or a {@link Source}, and have parameters annotated with
- * {@link XPathParam} that specify the XPath expression that should be bound to that parameter. The parameter can be of
- * the following types:
+ * I.e. methods that return either {@code void} or a {@link Source}, and have parameters
+ * annotated with {@link XPathParam} that specify the XPath expression that should be
+ * bound to that parameter. The parameter can be of the following types:
*
*
{@code boolean}, or {@link Boolean}
*
{@code double}, or {@link Double}
@@ -67,9 +69,10 @@ import org.w3c.dom.NodeList;
*
* @author Arjen Poutsma
* @since 1.0.0
- * @deprecated as of Spring Web Services 2.0, in favor of {@link DefaultMethodEndpointAdapter} and
- * {@link org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
- * XPathParamMethodArgumentResolver}.
+ * @deprecated as of Spring Web Services 2.0, in favor of
+ * {@link DefaultMethodEndpointAdapter} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver
+ * XPathParamMethodArgumentResolver}.
*/
@Deprecated
public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEndpointAdapter
@@ -89,7 +92,10 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
xpathFactory = XPathFactory.newInstance();
}
- /** Supports methods with @XPathParam parameters, and return either {@code Source} or nothing. */
+ /**
+ * Supports methods with @XPathParam parameters, and return either {@code Source} or
+ * nothing.
+ */
@Override
protected boolean supportsInternal(MethodEndpoint methodEndpoint) {
Method method = methodEndpoint.getMethod();
@@ -142,15 +148,21 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
QName conversionType;
if (Boolean.class.isAssignableFrom(parameterTypes[i]) || Boolean.TYPE.isAssignableFrom(parameterTypes[i])) {
conversionType = XPathConstants.BOOLEAN;
- } else if (Double.class.isAssignableFrom(parameterTypes[i]) || Double.TYPE.isAssignableFrom(parameterTypes[i])) {
+ }
+ else if (Double.class.isAssignableFrom(parameterTypes[i])
+ || Double.TYPE.isAssignableFrom(parameterTypes[i])) {
conversionType = XPathConstants.NUMBER;
- } else if (Node.class.isAssignableFrom(parameterTypes[i])) {
+ }
+ else if (Node.class.isAssignableFrom(parameterTypes[i])) {
conversionType = XPathConstants.NODE;
- } else if (NodeList.class.isAssignableFrom(parameterTypes[i])) {
+ }
+ else if (NodeList.class.isAssignableFrom(parameterTypes[i])) {
conversionType = XPathConstants.NODESET;
- } else if (String.class.isAssignableFrom(parameterTypes[i])) {
+ }
+ else if (String.class.isAssignableFrom(parameterTypes[i])) {
conversionType = XPathConstants.STRING;
- } else {
+ }
+ else {
throw new IllegalArgumentException("Invalid parameter type [" + parameterTypes[i] + "]. "
+ "Supported are: Boolean, Double, Node, NodeList, and String.");
}
@@ -171,7 +183,6 @@ public class XPathParamAnnotationMethodEndpointAdapter extends AbstractMethodEnd
/**
* Returns the root element of the given source.
- *
* @param source the source to get the root element from
* @return the root element
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
index 0517fc30..b61eee08 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,8 +30,9 @@ import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Abstract base class for {@link MethodArgumentResolver} and {@link MethodReturnValueHandler} implementations based on
- * {@link RequestPayload} and {@link ResponsePayload} annotations.
+ * Abstract base class for {@link MethodArgumentResolver} and
+ * {@link MethodReturnValueHandler} implementations based on {@link RequestPayload} and
+ * {@link ResponsePayload} annotations.
*
* @author Arjen Poutsma
* @since 2.0
@@ -44,25 +45,28 @@ public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSu
/**
* {@inheritDoc}
*
- * This implementation gets checks if the given parameter is annotated with {@link RequestPayload}, and invokes
- * {@link #supportsRequestPayloadParameter(org.springframework.core.MethodParameter)} afterwards.
+ * This implementation gets checks if the given parameter is annotated with
+ * {@link RequestPayload}, and invokes
+ * {@link #supportsRequestPayloadParameter(org.springframework.core.MethodParameter)}
+ * afterwards.
*/
@Override
public final boolean supportsParameter(MethodParameter parameter) {
Assert.isTrue(parameter.getParameterIndex() >= 0, "Parameter index smaller than 0");
if (parameter.getParameterAnnotation(RequestPayload.class) == null) {
return false;
- } else {
+ }
+ else {
return supportsRequestPayloadParameter(parameter);
}
}
/**
- * Indicates whether the given {@linkplain MethodParameter method parameter}, annotated with {@link RequestPayload},
- * is supported by this resolver.
- *
+ * Indicates whether the given {@linkplain MethodParameter method parameter},
+ * annotated with {@link RequestPayload}, is supported by this resolver.
* @param parameter the method parameter to check
- * @return {@code true} if this resolver supports the supplied parameter; {@code false} otherwise
+ * @return {@code true} if this resolver supports the supplied parameter;
+ * {@code false} otherwise
*/
protected abstract boolean supportsRequestPayloadParameter(MethodParameter parameter);
@@ -71,31 +75,33 @@ public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSu
/**
* {@inheritDoc}
*
- * This implementation gets checks if the method of the given return type is annotated with {@link ResponsePayload},
- * and invokes {@link #supportsResponsePayloadReturnType(org.springframework.core.MethodParameter)} afterwards.
+ * This implementation gets checks if the method of the given return type is annotated
+ * with {@link ResponsePayload}, and invokes
+ * {@link #supportsResponsePayloadReturnType(org.springframework.core.MethodParameter)}
+ * afterwards.
*/
@Override
public final boolean supportsReturnType(MethodParameter returnType) {
Assert.isTrue(returnType.getParameterIndex() == -1, "Parameter index is not -1");
if (returnType.getMethodAnnotation(ResponsePayload.class) == null) {
return false;
- } else {
+ }
+ else {
return supportsResponsePayloadReturnType(returnType);
}
}
/**
- * Indicates whether the given {@linkplain MethodParameter method return type}, annotated with
- * {@link ResponsePayload}, is supported.
- *
+ * Indicates whether the given {@linkplain MethodParameter method return type},
+ * annotated with {@link ResponsePayload}, is supported.
* @param returnType the method parameter to check
- * @return {@code true} if this resolver supports the supplied return type; {@code false} otherwise
+ * @return {@code true} if this resolver supports the supplied return type;
+ * {@code false} otherwise
*/
protected abstract boolean supportsResponsePayloadReturnType(MethodParameter returnType);
/**
* Converts the given source to a byte array input stream.
- *
* @param source the source to convert
* @return the input stream
* @throws javax.xml.transform.TransformerException in case of transformation errors
@@ -105,4 +111,5 @@ public abstract class AbstractPayloadMethodProcessor extends TransformerObjectSu
transform(source, new StreamResult(bos));
return new ByteArrayInputStream(bos.toByteArray());
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
index dfc657dc..64f77fc2 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadSourceMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
/**
- * Abstract base class for {@link MethodArgumentResolver} and {@link MethodReturnValueHandler} implementations based on
- * {@link Source}s.
+ * Abstract base class for {@link MethodArgumentResolver} and
+ * {@link MethodReturnValueHandler} implementations based on {@link Source}s.
*
* @author Arjen Poutsma
* @since 2.0
@@ -47,8 +47,8 @@ public abstract class AbstractPayloadSourceMethodProcessor extends AbstractPaylo
}
/**
- * Resolves the given parameter, annotated with {@link RequestPayload}, into a method argument.
- *
+ * Resolves the given parameter, annotated with {@link RequestPayload}, into a method
+ * argument.
* @param parameter the parameter to resolve to an argument
* @param requestPayload the request payload
* @return the resolved argument. May be {@code null}.
@@ -73,7 +73,6 @@ public abstract class AbstractPayloadSourceMethodProcessor extends AbstractPaylo
/**
* Creates a response payload for the given return value.
- *
* @param returnType the return type to handle
* @param returnValue the return value to handle
* @return the response payload
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
index 41afd3a5..215e2cf4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,8 +27,8 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.support.MarshallingUtils;
/**
- * Implementation of {@link MethodArgumentResolver} and {@link MethodReturnValueHandler} that uses {@link Marshaller}
- * and {@link Unmarshaller} to support marshalled objects.
+ * Implementation of {@link MethodArgumentResolver} and {@link MethodReturnValueHandler}
+ * that uses {@link Marshaller} and {@link Unmarshaller} to support marshalled objects.
*
* @author Arjen Poutsma
* @since 2.0
@@ -40,24 +40,25 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
private Unmarshaller unmarshaller;
/**
- * Creates a new {@code MarshallingPayloadMethodProcessor}. The {@link Marshaller} and {@link Unmarshaller} must be
- * injected using properties.
- *
+ * Creates a new {@code MarshallingPayloadMethodProcessor}. The {@link Marshaller} and
+ * {@link Unmarshaller} must be injected using properties.
* @see #setMarshaller(Marshaller)
* @see #setUnmarshaller(Unmarshaller)
*/
- public MarshallingPayloadMethodProcessor() {}
+ public MarshallingPayloadMethodProcessor() {
+ }
/**
- * Creates a new {@code MarshallingPayloadMethodProcessor} with the given marshaller. If the given {@link Marshaller}
- * also implements the {@link Unmarshaller} interface, it is used for both marshalling and unmarshalling. Otherwise,
- * an exception is thrown.
+ * Creates a new {@code MarshallingPayloadMethodProcessor} with the given marshaller.
+ * If the given {@link Marshaller} also implements the {@link Unmarshaller} interface,
+ * it is used for both marshalling and unmarshalling. Otherwise, an exception is
+ * thrown.
*
- * Note that all {@link Marshaller} implementations in Spring also implement the {@link Unmarshaller} interface, so
- * that you can safely use this constructor.
- *
+ * Note that all {@link Marshaller} implementations in Spring also implement the
+ * {@link Unmarshaller} interface, so that you can safely use this constructor.
* @param marshaller object used as marshaller and unmarshaller
- * @throws IllegalArgumentException when {@code marshaller} does not implement the {@link Unmarshaller} interface
+ * @throws IllegalArgumentException when {@code marshaller} does not implement the
+ * {@link Unmarshaller} interface
*/
public MarshallingPayloadMethodProcessor(Marshaller marshaller) {
Assert.notNull(marshaller, "marshaller must not be null");
@@ -67,8 +68,8 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
}
/**
- * Creates a new {@code MarshallingPayloadMethodProcessor} with the given marshaller and unmarshaller.
- *
+ * Creates a new {@code MarshallingPayloadMethodProcessor} with the given marshaller
+ * and unmarshaller.
* @param marshaller the marshaller to use
* @param unmarshaller the unmarshaller to use
*/
@@ -112,9 +113,11 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
Unmarshaller unmarshaller = getUnmarshaller();
if (unmarshaller == null) {
return false;
- } else if (unmarshaller instanceof GenericUnmarshaller) {
+ }
+ else if (unmarshaller instanceof GenericUnmarshaller) {
return ((GenericUnmarshaller) unmarshaller).supports(parameter.getGenericParameterType());
- } else {
+ }
+ else {
return unmarshaller.supports(parameter.getParameterType());
}
}
@@ -137,10 +140,12 @@ public class MarshallingPayloadMethodProcessor extends AbstractPayloadMethodProc
Marshaller marshaller = getMarshaller();
if (marshaller == null) {
return false;
- } else if (marshaller instanceof GenericMarshaller) {
+ }
+ else if (marshaller instanceof GenericMarshaller) {
GenericMarshaller genericMarshaller = (GenericMarshaller) marshaller;
return genericMarshaller.supports(returnType.getGenericParameterType());
- } else {
+ }
+ else {
return marshaller.supports(returnType.getParameterType());
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
index d43b7eb5..4582c9fe 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,7 +20,8 @@ import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
/**
- * Implementation of {@link MethodArgumentResolver} that supports {@link MessageContext} arguments.
+ * Implementation of {@link MethodArgumentResolver} that supports {@link MessageContext}
+ * arguments.
*
* @author Arjen Poutsma
* @since 2.0
@@ -36,4 +37,5 @@ public class MessageContextMethodArgumentResolver implements MethodArgumentResol
public MessageContext resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
return messageContext;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodArgumentResolver.java
index 1c70ff24..f245b006 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodArgumentResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,9 +20,10 @@ import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
/**
- * Strategy interface used to resolve method parameters into arguments. This interface is used to allow the
- * {@link org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter DefaultMethodEndpointAdapter} to
- * be indefinitely extensible.
+ * Strategy interface used to resolve method parameters into arguments. This interface is
+ * used to allow the
+ * {@link org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter
+ * DefaultMethodEndpointAdapter} to be indefinitely extensible.
*
* @author Arjen Poutsma
* @since 2.0
@@ -30,20 +31,20 @@ import org.springframework.ws.context.MessageContext;
public interface MethodArgumentResolver {
/**
- * Indicates whether the given {@linkplain MethodParameter method parameter} is supported by this resolver.
- *
+ * Indicates whether the given {@linkplain MethodParameter method parameter} is
+ * supported by this resolver.
* @param parameter the method parameter to check
- * @return {@code true} if this resolver supports the supplied parameter; {@code false} otherwise
+ * @return {@code true} if this resolver supports the supplied parameter;
+ * {@code false} otherwise
*/
boolean supportsParameter(MethodParameter parameter);
/**
* Resolves the given parameter into a method argument.
- *
* @param messageContext the current message context
- * @param parameter the parameter to resolve to an argument. This parameter must have previously been passed to the
- * {@link #supportsParameter(MethodParameter)} method of this interface, which must have returned
- * {@code true}.
+ * @param parameter the parameter to resolve to an argument. This parameter must have
+ * previously been passed to the {@link #supportsParameter(MethodParameter)} method of
+ * this interface, which must have returned {@code true}.
* @return the resolved argument. May be {@code null}.
* @throws Exception in case of errors
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodReturnValueHandler.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodReturnValueHandler.java
index 08cbc80d..3f108c8f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodReturnValueHandler.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/MethodReturnValueHandler.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,9 +20,9 @@ import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
/**
- * Strategy interface used to handle method return values. This interface is used to allow the
- * {@link org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter DefaultMethodEndpointAdapter} to
- * be indefinitely extensible.
+ * Strategy interface used to handle method return values. This interface is used to allow
+ * the {@link org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter
+ * DefaultMethodEndpointAdapter} to be indefinitely extensible.
*
* @author Arjen Poutsma
* @since 2.0
@@ -30,20 +30,20 @@ import org.springframework.ws.context.MessageContext;
public interface MethodReturnValueHandler {
/**
- * Indicates whether the given {@linkplain MethodParameter method return type} is supported by this handler.
- *
+ * Indicates whether the given {@linkplain MethodParameter method return type} is
+ * supported by this handler.
* @param returnType the method return type to check
- * @return {@code true} if this handler supports the supplied return type; {@code false} otherwise
+ * @return {@code true} if this handler supports the supplied return type;
+ * {@code false} otherwise
*/
boolean supportsReturnType(MethodParameter returnType);
/**
* Handles the given return value.
- *
* @param messageContext the current message context
- * @param returnType the return type to handle. This type must have previously been passed to the
- * {@link #supportsReturnType(MethodParameter)} method of this interface, which must have returned
- * {@code true}.
+ * @param returnType the return type to handle. This type must have previously been
+ * passed to the {@link #supportsReturnType(MethodParameter)} method of this
+ * interface, which must have returned {@code true}.
* @param returnValue the return value to handle
* @throws Exception in case of errors
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessor.java
index a2a981af..90e7f17a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,16 +30,17 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.stream.StreamSource;
-import org.springframework.core.MethodParameter;
-import org.springframework.xml.JaxpVersion;
-import org.springframework.xml.XMLInputFactoryUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
+import org.springframework.core.MethodParameter;
+import org.springframework.xml.JaxpVersion;
+import org.springframework.xml.XMLInputFactoryUtils;
+
/**
- * Implementation of {@link MethodArgumentResolver} and {@link MethodReturnValueHandler} that supports {@link Source}
- * objects.
+ * Implementation of {@link MethodArgumentResolver} and {@link MethodReturnValueHandler}
+ * that supports {@link Source} objects.
*
* @author Arjen Poutsma
* @since 2.0
@@ -67,21 +68,26 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
Node node = domResult.getNode();
if (node.getNodeType() == Node.DOCUMENT_NODE) {
return new DOMSource(((Document) node).getDocumentElement());
- } else {
+ }
+ else {
return new DOMSource(domResult.getNode());
}
- } else if (SAXSource.class.isAssignableFrom(parameterType)) {
+ }
+ else if (SAXSource.class.isAssignableFrom(parameterType)) {
ByteArrayInputStream bis = convertToByteArrayInputStream(requestPayload);
InputSource inputSource = new InputSource(bis);
return new SAXSource(inputSource);
- } else if (StreamSource.class.isAssignableFrom(parameterType)) {
+ }
+ else if (StreamSource.class.isAssignableFrom(parameterType)) {
ByteArrayInputStream bis = convertToByteArrayInputStream(requestPayload);
return new StreamSource(bis);
- } else if (JaxpVersion.isAtLeastJaxp14() && Jaxp14StaxHandler.isStaxSource(parameterType)) {
+ }
+ else if (JaxpVersion.isAtLeastJaxp14() && Jaxp14StaxHandler.isStaxSource(parameterType)) {
XMLStreamReader streamReader;
try {
streamReader = inputFactory.createXMLStreamReader(requestPayload);
- } catch (UnsupportedOperationException | XMLStreamException ignored) {
+ }
+ catch (UnsupportedOperationException | XMLStreamException ignored) {
streamReader = null;
}
if (streamReader == null) {
@@ -110,12 +116,12 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
}
/**
- * Create a {@code XMLInputFactory} that this resolver will use to create {@link javax.xml.stream.XMLStreamReader} and
+ * Create a {@code XMLInputFactory} that this resolver will use to create
+ * {@link javax.xml.stream.XMLStreamReader} and
* {@link javax.xml.stream.XMLEventReader} objects.
*
- * Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so
- * this method will only be called once.
- *
+ * Can be overridden in subclasses, adding further initialization of the factory. The
+ * resulting factory is cached, so this method will only be called once.
* @return the created factory
*/
protected XMLInputFactory createXmlInputFactory() {
@@ -169,6 +175,7 @@ public class SourcePayloadMethodProcessor extends AbstractPayloadSourceMethodPro
}
};
}
+
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
index e8779768..6d8691c2 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,8 +35,8 @@ import org.springframework.xml.XMLInputFactoryUtils;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
- * Implementation of {@link MethodArgumentResolver} that supports StAX {@link XMLStreamReader} and
- * {@link XMLEventReader} arguments.
+ * Implementation of {@link MethodArgumentResolver} that supports StAX
+ * {@link XMLStreamReader} and {@link XMLEventReader} arguments.
*
* @author Arjen Poutsma
* @since 2.0
@@ -49,7 +49,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
public boolean supportsParameter(MethodParameter parameter) {
if (parameter.getParameterAnnotation(RequestPayload.class) == null) {
return false;
- } else {
+ }
+ else {
Class> parameterType = parameter.getParameterType();
return XMLStreamReader.class.equals(parameterType) || XMLEventReader.class.equals(parameterType);
}
@@ -65,7 +66,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
Class> parameterType = parameter.getParameterType();
if (XMLStreamReader.class.equals(parameterType)) {
return resolveStreamReader(source);
- } else if (XMLEventReader.class.equals(parameterType)) {
+ }
+ else if (XMLEventReader.class.equals(parameterType)) {
return resolveEventReader(source);
}
throw new UnsupportedOperationException();
@@ -80,7 +82,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
if (eventReader != null) {
try {
streamReader = StaxUtils.createEventStreamReader(eventReader);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
streamReader = null;
}
}
@@ -89,7 +92,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
if (streamReader == null) {
try {
streamReader = inputFactory.createXMLStreamReader(requestSource);
- } catch (XMLStreamException | UnsupportedOperationException ex) {
+ }
+ catch (XMLStreamException | UnsupportedOperationException ex) {
streamReader = null;
}
}
@@ -110,7 +114,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
if (streamReader != null) {
try {
eventReader = inputFactory.createXMLEventReader(streamReader);
- } catch (XMLStreamException ex) {
+ }
+ catch (XMLStreamException ex) {
eventReader = null;
}
}
@@ -120,7 +125,8 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
if (eventReader == null) {
try {
eventReader = inputFactory.createXMLEventReader(requestSource);
- } catch (XMLStreamException | UnsupportedOperationException ex) {
+ }
+ catch (XMLStreamException | UnsupportedOperationException ex) {
eventReader = null;
}
}
@@ -133,12 +139,11 @@ public class StaxPayloadMethodArgumentResolver extends TransformerObjectSupport
}
/**
- * Create a {@code XMLInputFactory} that this resolver will use to create {@link XMLStreamReader} and
- * {@link XMLEventReader} objects.
+ * Create a {@code XMLInputFactory} that this resolver will use to create
+ * {@link XMLStreamReader} and {@link XMLEventReader} objects.
*
- * Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so
- * this method will only be called once.
- *
+ * Can be overridden in subclasses, adding further initialization of the factory. The
+ * resulting factory is cached, so this method will only be called once.
* @return the created factory
*/
protected XMLInputFactory createXmlInputFactory() {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
index 59bd1aca..0a565e90 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,6 +25,11 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
import org.springframework.core.MethodParameter;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.ConversionServiceFactory;
@@ -33,18 +38,17 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.XPathParam;
import org.springframework.ws.server.endpoint.support.NamespaceUtils;
import org.springframework.xml.transform.TransformerHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
- * Implementation of {@link MethodArgumentResolver} that supports the {@link XPathParam @XPathParam} annotation.
+ * Implementation of {@link MethodArgumentResolver} that supports the
+ * {@link XPathParam @XPathParam} annotation.
*
- * This resolver supports parameters annotated with {@link XPathParam @XPathParam} that specifies the XPath expression
- * that should be bound to that parameter. The parameter can either a "natively supported" XPath type ({@link Boolean
- * boolean}, {@link Double double}, {@link String}, {@link Node}, or {@link NodeList}), or a type that is
- * {@linkplain ConversionService#canConvert(Class, Class) supported} by the {@link ConversionService}.
+ * This resolver supports parameters annotated with {@link XPathParam @XPathParam} that
+ * specifies the XPath expression that should be bound to that parameter. The parameter
+ * can either a "natively supported" XPath type ({@link Boolean boolean}, {@link Double
+ * double}, {@link String}, {@link Node}, or {@link NodeList}), or a type that is
+ * {@linkplain ConversionService#canConvert(Class, Class) supported} by the
+ * {@link ConversionService}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -60,7 +64,9 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
/**
* Sets the conversion service to use.
*
- * Defaults to the {@linkplain ConversionServiceFactory#createDefaultConversionService() default conversion service}.
+ * Defaults to the
+ * {@linkplain ConversionServiceFactory#createDefaultConversionService() default
+ * conversion service}.
*/
public void setConversionService(ConversionService conversionService) {
this.conversionService = conversionService;
@@ -76,11 +82,13 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
return false;
}
Class> parameterType = parameter.getParameterType();
- if (Boolean.class.equals(parameterType) || Boolean.TYPE.equals(parameterType) || Double.class.equals(parameterType)
- || Double.TYPE.equals(parameterType) || Node.class.isAssignableFrom(parameterType)
- || NodeList.class.isAssignableFrom(parameterType) || String.class.isAssignableFrom(parameterType)) {
+ if (Boolean.class.equals(parameterType) || Boolean.TYPE.equals(parameterType)
+ || Double.class.equals(parameterType) || Double.TYPE.equals(parameterType)
+ || Node.class.isAssignableFrom(parameterType) || NodeList.class.isAssignableFrom(parameterType)
+ || String.class.isAssignableFrom(parameterType)) {
return true;
- } else {
+ }
+ else {
return conversionService.canConvert(String.class, parameterType);
}
}
@@ -108,15 +116,20 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
private QName getReturnType(Class> parameterType) {
if (Boolean.class.equals(parameterType) || Boolean.TYPE.equals(parameterType)) {
return XPathConstants.BOOLEAN;
- } else if (Double.class.equals(parameterType) || Double.TYPE.equals(parameterType)) {
+ }
+ else if (Double.class.equals(parameterType) || Double.TYPE.equals(parameterType)) {
return XPathConstants.NUMBER;
- } else if (Node.class.equals(parameterType)) {
+ }
+ else if (Node.class.equals(parameterType)) {
return XPathConstants.NODE;
- } else if (NodeList.class.equals(parameterType)) {
+ }
+ else if (NodeList.class.equals(parameterType)) {
return XPathConstants.NODESET;
- } else if (String.class.equals(parameterType)) {
+ }
+ else if (String.class.equals(parameterType)) {
return XPathConstants.STRING;
- } else {
+ }
+ else {
return null;
}
}
@@ -135,11 +148,11 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
}
/**
- * Create a {@code XPathFactory} that this resolver will use to create {@link XPath} objects.
+ * Create a {@code XPathFactory} that this resolver will use to create {@link XPath}
+ * objects.
*
- * Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so
- * this method will only be called once.
- *
+ * Can be overridden in subclasses, adding further initialization of the factory. The
+ * resulting factory is cached, so this method will only be called once.
* @return the created factory
*/
protected XPathFactory createXPathFactory() {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/Dom4jPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/Dom4jPayloadMethodProcessor.java
index b04331bb..fa6f1b8c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/Dom4jPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/Dom4jPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,12 +25,15 @@ import org.dom4j.Element;
import org.dom4j.io.DOMReader;
import org.dom4j.io.DocumentResult;
import org.dom4j.io.DocumentSource;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
* MethodReturnValueHandler} that supports dom4j {@linkplain Element elements}.
*
* @author Arjen Poutsma
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/DomPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/DomPayloadMethodProcessor.java
index 6b1b4f08..68fb0564 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/DomPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/DomPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,15 +20,18 @@ import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
-import org.springframework.core.MethodParameter;
-import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.springframework.core.MethodParameter;
+import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
+
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
* MethodReturnValueHandler} that supports W3C DOM {@linkplain Element elements}.
*
* @author Arjen Poutsma
@@ -47,7 +50,8 @@ public class DomPayloadMethodProcessor extends AbstractPayloadSourceMethodProces
protected Node resolveRequestPayloadArgument(MethodParameter parameter, Source requestPayload) throws Exception {
if (requestPayload instanceof DOMSource) {
return resolveArgumentDomSource(parameter, (DOMSource) requestPayload);
- } else {
+ }
+ else {
DOMResult domResult = new DOMResult();
transform(requestPayload, domResult);
DOMSource domSource = new DOMSource(domResult.getNode());
@@ -60,7 +64,8 @@ public class DomPayloadMethodProcessor extends AbstractPayloadSourceMethodProces
Node requestNode = requestSource.getNode();
if (parameterType.isAssignableFrom(requestNode.getClass())) {
return requestNode;
- } else if (Element.class.equals(parameterType) && requestNode instanceof Document) {
+ }
+ else if (Element.class.equals(parameterType) && requestNode instanceof Document) {
Document document = (Document) requestNode;
return document.getDocumentElement();
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessor.java
index 06a79c5e..5372e924 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,13 +24,16 @@ import org.jdom2.Element;
import org.jdom2.input.DOMBuilder;
import org.jdom2.transform.JDOMResult;
import org.jdom2.transform.JDOMSource;
-import org.springframework.core.MethodParameter;
-import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
import org.w3c.dom.Node;
+import org.springframework.core.MethodParameter;
+import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
+
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
* MethodReturnValueHandler} that supports JDOM {@linkplain Element elements}.
*
* @author Arjen Poutsma
@@ -50,7 +53,8 @@ public class JDomPayloadMethodProcessor extends AbstractPayloadSourceMethodProce
DOMBuilder domBuilder = new DOMBuilder();
if (node.getNodeType() == Node.ELEMENT_NODE) {
return domBuilder.build((org.w3c.dom.Element) node);
- } else if (node.getNodeType() == Node.DOCUMENT_NODE) {
+ }
+ else if (node.getNodeType() == Node.DOCUMENT_NODE) {
Document document = domBuilder.build((org.w3c.dom.Document) node);
return document.getRootElement();
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessor.java
index a830873f..2c75d037 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,12 +16,6 @@
package org.springframework.ws.server.endpoint.adapter.method.dom;
-import nu.xom.Builder;
-import nu.xom.Document;
-import nu.xom.Element;
-import nu.xom.ParsingException;
-import nu.xom.converters.DOMConverter;
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -32,14 +26,22 @@ import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
+import nu.xom.Builder;
+import nu.xom.Document;
+import nu.xom.Element;
+import nu.xom.ParsingException;
+import nu.xom.converters.DOMConverter;
+import org.w3c.dom.DOMImplementation;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
import org.springframework.xml.DocumentBuilderFactoryUtils;
-import org.w3c.dom.DOMImplementation;
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
* MethodReturnValueHandler} that supports XOM {@linkplain Element elements}.
*
* @author Arjen Poutsma
@@ -61,7 +63,8 @@ public class XomPayloadMethodProcessor extends AbstractPayloadSourceMethodProces
org.w3c.dom.Node node = ((DOMSource) requestPayload).getNode();
if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
return DOMConverter.convert((org.w3c.dom.Element) node);
- } else if (node.getNodeType() == org.w3c.dom.Node.DOCUMENT_NODE) {
+ }
+ else if (node.getNodeType() == org.w3c.dom.Node.DOCUMENT_NODE) {
Document document = DOMConverter.convert((org.w3c.dom.Document) node);
return document.getRootElement();
}
@@ -97,11 +100,11 @@ public class XomPayloadMethodProcessor extends AbstractPayloadSourceMethodProces
}
/**
- * Create a {@code DocumentBuilderFactory} that this resolver will use to create response payloads.
+ * Create a {@code DocumentBuilderFactory} that this resolver will use to create
+ * response payloads.
*
- * Can be overridden in subclasses, adding further initialization of the factory. The resulting factory is cached, so
- * this method will only be called once.
- *
+ * Can be overridden in subclasses, adding further initialization of the factory. The
+ * resulting factory is cached, so this method will only be called once.
* @return the created factory
*/
protected DocumentBuilderFactory createDocumentBuilderFactory() {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java
index f9ef9868..2f25e4cf 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/AbstractJaxb2PayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,6 @@
package org.springframework.ws.server.endpoint.adapter.method.jaxb;
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.JAXBElement;
-import jakarta.xml.bind.JAXBException;
-import jakarta.xml.bind.JAXBIntrospector;
-import jakarta.xml.bind.Marshaller;
-import jakarta.xml.bind.Unmarshaller;
-import jakarta.xml.bind.UnmarshallerHandler;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -45,6 +37,19 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBElement;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.JAXBIntrospector;
+import jakarta.xml.bind.Marshaller;
+import jakarta.xml.bind.Unmarshaller;
+import jakarta.xml.bind.UnmarshallerHandler;
+import org.w3c.dom.Node;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+
import org.springframework.core.MethodParameter;
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
@@ -53,19 +58,18 @@ import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMeth
import org.springframework.ws.stream.StreamingPayload;
import org.springframework.ws.stream.StreamingWebServiceMessage;
import org.springframework.xml.transform.TraxUtils;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.ext.LexicalHandler;
/**
- * Abstract base class for {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
- * MethodReturnValueHandler} implementations that use JAXB2. Creates {@link JAXBContext} object lazily, and offers
- * {@linkplain #marshalToResponsePayload(org.springframework.ws.context.MessageContext, Class, Object) marshalling} and
- * {@linkplain #unmarshalFromRequestPayload(org.springframework.ws.context.MessageContext, Class) unmarshalling}
- * methods.
+ * Abstract base class for
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * MethodReturnValueHandler} implementations that use JAXB2. Creates {@link JAXBContext}
+ * object lazily, and offers
+ * {@linkplain #marshalToResponsePayload(org.springframework.ws.context.MessageContext, Class, Object)
+ * marshalling} and
+ * {@linkplain #unmarshalFromRequestPayload(org.springframework.ws.context.MessageContext, Class)
+ * unmarshalling} methods.
*
* @author Arjen Poutsma
* @since 2.0
@@ -86,8 +90,8 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
Object returnValue) throws Exception;
/**
- * Marshals the given {@code jaxbElement} to the response payload of the given message context.
- *
+ * Marshals the given {@code jaxbElement} to the response payload of the given message
+ * context.
* @param messageContext the message context to marshal to
* @param clazz the clazz to create a marshaller for
* @param jaxbElement the object to be marshalled
@@ -107,12 +111,14 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
StreamingPayload payload = new JaxbStreamingPayload(clazz, jaxbElement);
streamingResponse.setStreamingPayload(payload);
- } else {
+ }
+ else {
Result responsePayload = response.getPayloadResult();
try {
Jaxb2ResultCallback callback = new Jaxb2ResultCallback(clazz, jaxbElement);
TraxUtils.doWithResult(responsePayload, callback);
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw convertToJaxbException(ex);
}
}
@@ -120,7 +126,6 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
/**
* Unmarshals the request payload of the given message context.
- *
* @param messageContext the message context to unmarshal from
* @param clazz the class to unmarshal
* @return the unmarshalled object, or {@code null} if the request has no payload
@@ -139,14 +144,14 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
logger.debug("Unmarshalled payload request to [" + callback.result + "]");
}
return callback.result;
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw convertToJaxbException(ex);
}
}
/**
* Unmarshals the request payload of the given message context as {@link JAXBElement}.
- *
* @param messageContext the message context to unmarshal from
* @param clazz the class to unmarshal
* @return the unmarshalled element, or {@code null} if the request has no payload
@@ -165,7 +170,8 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
logger.debug("Unmarshalled payload request to [" + callback.result + "]");
}
return callback.result;
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw convertToJaxbException(ex);
}
}
@@ -178,16 +184,16 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
private JAXBException convertToJaxbException(Exception ex) {
if (ex instanceof JAXBException) {
return (JAXBException) ex;
- } else {
+ }
+ else {
return new JAXBException(ex);
}
}
/**
- * Creates a new {@link Marshaller} to be used for marshalling objects to XML. Defaults to
- * {@link jakarta.xml.bind.JAXBContext#createMarshaller()}, but can be overridden in subclasses for further
- * customization.
- *
+ * Creates a new {@link Marshaller} to be used for marshalling objects to XML.
+ * Defaults to {@link jakarta.xml.bind.JAXBContext#createMarshaller()}, but can be
+ * overridden in subclasses for further customization.
* @param jaxbContext the JAXB context to create a marshaller for
* @return the marshaller
* @throws JAXBException in case of JAXB errors
@@ -201,10 +207,9 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
}
/**
- * Creates a new {@link Unmarshaller} to be used for unmarshalling XML to objects. Defaults to
- * {@link jakarta.xml.bind.JAXBContext#createUnmarshaller()}, but can be overridden in subclasses for further
- * customization.
- *
+ * Creates a new {@link Unmarshaller} to be used for unmarshalling XML to objects.
+ * Defaults to {@link jakarta.xml.bind.JAXBContext#createUnmarshaller()}, but can be
+ * overridden in subclasses for further customization.
* @param jaxbContext the JAXB context to create a unmarshaller for
* @return the unmarshaller
* @throws JAXBException in case of JAXB errors
@@ -248,16 +253,20 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
public void saxSource(XMLReader reader, InputSource inputSource) throws Exception {
if (inputSource.getByteStream() == null && inputSource.getCharacterStream() == null
&& inputSource.getSystemId() == null) {
- // The InputSource neither has a stream nor a system ID set; this means that
- // we are dealing with a custom SAXSource that is not backed by a SAX parser
+ // The InputSource neither has a stream nor a system ID set; this means
+ // that
+ // we are dealing with a custom SAXSource that is not backed by a SAX
+ // parser
// but that generates a sequence of SAX events in some other way.
- // In this case, we need to use a ContentHandler to feed the SAX events into
+ // In this case, we need to use a ContentHandler to feed the SAX events
+ // into
// the unmarshaller.
UnmarshallerHandler handler = unmarshaller.getUnmarshallerHandler();
reader.setContentHandler(handler);
reader.parse(inputSource);
result = handler.getResult();
- } else {
+ }
+ else {
// If a stream or system ID is set, we assume that the SAXSource is backed
// by a SAX parser and we only pass the InputSource to the unmarshaller.
// This effectively ignores the SAX parser and lets the unmarshaller take
@@ -290,6 +299,7 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
public void source(String systemId) throws Exception {
result = unmarshaller.unmarshal(new URL(systemId));
}
+
}
private class JaxbElementSourceCallback implements TraxUtils.SourceCallback {
@@ -339,6 +349,7 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
public void source(String systemId) throws Exception {
result = unmarshaller.unmarshal(new StreamSource(systemId), declaredType);
}
+
}
private class Jaxb2ResultCallback implements TraxUtils.ResultCallback {
@@ -386,6 +397,7 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
public void result(String systemId) throws Exception {
marshaller.marshal(jaxbElement, new StreamResult(systemId));
}
+
}
private class JaxbStreamingPayload implements StreamingPayload {
@@ -414,10 +426,12 @@ public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloa
public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException {
try {
marshaller.marshal(jaxbElement, streamWriter);
- } catch (JAXBException ex) {
+ }
+ catch (JAXBException ex) {
throw new XMLStreamException("Could not marshal [" + jaxbElement + "]: " + ex.getMessage(), ex);
}
}
+
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java
index 77b93a56..4ad127da 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,20 @@
package org.springframework.ws.server.endpoint.adapter.method.jaxb;
-import jakarta.xml.bind.JAXBElement;
-import jakarta.xml.bind.JAXBException;
-
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import jakarta.xml.bind.JAXBElement;
+import jakarta.xml.bind.JAXBException;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
* MethodReturnValueHandler} that supports {@link JAXBElement} objects.
*
* @author Arjen Poutsma
@@ -43,7 +45,8 @@ public class JaxbElementPayloadMethodProcessor extends AbstractJaxb2PayloadMetho
}
@Override
- public JAXBElement> resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException {
+ public JAXBElement> resolveArgument(MessageContext messageContext, MethodParameter parameter)
+ throws JAXBException {
ParameterizedType parameterizedType = (ParameterizedType) parameter.getGenericParameterType();
Class> clazz = (Class>) parameterizedType.getActualTypeArguments()[0];
return unmarshalElementFromRequestPayload(messageContext, clazz);
@@ -61,4 +64,5 @@ public class JaxbElementPayloadMethodProcessor extends AbstractJaxb2PayloadMetho
JAXBElement> element = (JAXBElement>) returnValue;
marshalToResponsePayload(messageContext, element.getDeclaredType(), element);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java
index 9461b962..eb7e484b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,10 +25,13 @@ import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
/**
- * Implementation of {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
- * MethodArgumentResolver} and {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
- * MethodReturnValueHandler} that supports parameters annotated with {@link XmlRootElement @XmlRootElement} or
- * {@link XmlType @XmlType}, and return values annotated with {@link XmlRootElement @XmlRootElement}.
+ * Implementation of
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver
+ * MethodArgumentResolver} and
+ * {@link org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler
+ * MethodReturnValueHandler} that supports parameters annotated with
+ * {@link XmlRootElement @XmlRootElement} or {@link XmlType @XmlType}, and return values
+ * annotated with {@link XmlRootElement @XmlRootElement}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -38,7 +41,8 @@ public class XmlRootElementPayloadMethodProcessor extends AbstractJaxb2PayloadMe
@Override
protected boolean supportsRequestPayloadParameter(MethodParameter parameter) {
Class> parameterType = parameter.getParameterType();
- return parameterType.isAnnotationPresent(XmlRootElement.class) || parameterType.isAnnotationPresent(XmlType.class);
+ return parameterType.isAnnotationPresent(XmlRootElement.class)
+ || parameterType.isAnnotationPresent(XmlType.class);
}
@Override
@@ -47,7 +51,8 @@ public class XmlRootElementPayloadMethodProcessor extends AbstractJaxb2PayloadMe
if (parameterType.isAnnotationPresent(XmlRootElement.class)) {
return unmarshalFromRequestPayload(messageContext, parameterType);
- } else {
+ }
+ else {
JAXBElement> element = unmarshalElementFromRequestPayload(messageContext, parameterType);
return element != null ? element.getValue() : null;
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Endpoint.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Endpoint.java
index ceb4fa6c..3c39378b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Endpoint.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Endpoint.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,8 +29,9 @@ import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationM
/**
* Indicates that an annotated class is an "Endpoint" (e.g. a web service endpoint).
*
- * This annotation serves as a specialization of {@link Component @Component}, allowing for implementation classes to be
- * autodetected through classpath scanning. Instances of this class are typically picked up by an
+ * This annotation serves as a specialization of {@link Component @Component}, allowing
+ * for implementation classes to be autodetected through classpath scanning. Instances of
+ * this class are typically picked up by an
* {@link AbstractAnnotationMethodEndpointMapping} implementation, such as
* {@link SoapActionAnnotationMethodEndpointMapping}.
*
@@ -45,9 +46,8 @@ import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationM
public @interface Endpoint {
/**
- * The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an
- * autodetected component.
- *
+ * The value may indicate a suggestion for a logical component name, to be turned into
+ * a Spring bean in case of an autodetected component.
* @return the suggested component name, if any
*/
String value() default "";
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespace.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespace.java
index 62ace40a..e454e57e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespace.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespace.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,9 +25,11 @@ import java.lang.annotation.Target;
import javax.xml.XMLConstants;
/**
- * Sets up a namespace to be used in an {@link Endpoint @Endpoint} method, class, or package.
+ * Sets up a namespace to be used in an {@link Endpoint @Endpoint} method, class, or
+ * package.
*
- * Typically used in combination with {@link XPathParam @XPathParam}, or {@link PayloadRoot @PayloadRoot}.
+ * Typically used in combination with {@link XPathParam @XPathParam}, or
+ * {@link PayloadRoot @PayloadRoot}.
*
* @author Arjen Poutsma
* @see XPathParam
@@ -41,14 +43,12 @@ public @interface Namespace {
/**
* Signifies the prefix of the namespace.
- *
* @see #uri()
*/
String prefix() default XMLConstants.DEFAULT_NS_PREFIX;
/**
* Signifies the URI of the namespace.
- *
* @see #prefix()
*/
String uri();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespaces.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespaces.java
index 13c59bc1..a945ed3d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespaces.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/Namespaces.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,7 +23,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Sets the namespaces to be used in an {@link Endpoint @Endpoint} method, class, or package.
+ * Sets the namespaces to be used in an {@link Endpoint @Endpoint} method, class, or
+ * package.
*
* @author Arjen Poutsma
* @see Namespace
@@ -35,4 +36,5 @@ import java.lang.annotation.Target;
public @interface Namespaces {
Namespace[] value();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/PayloadRoot.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/PayloadRoot.java
index badcc4ea..e375e6d5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/PayloadRoot.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/PayloadRoot.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Marks an endpoint method as the handler for an incoming request. The annotation values signify the request payload
- * root element that is handled by the method.
+ * Marks an endpoint method as the handler for an incoming request. The annotation values
+ * signify the request payload root element that is handled by the method.
*
* @author Arjen Poutsma
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping
@@ -38,15 +38,15 @@ import java.lang.annotation.Target;
public @interface PayloadRoot {
/**
- * Signifies the local part of the payload root element handled by the annotated method.
- *
+ * Signifies the local part of the payload root element handled by the annotated
+ * method.
* @see #namespace()
*/
String localPart();
/**
- * Signifies the namespace of the payload root element handled by the annotated method.
- *
+ * Signifies the namespace of the payload root element handled by the annotated
+ * method.
* @see #localPart()
*/
String namespace() default "";
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java
index 6d5216e8..4ccba100 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/RequestPayload.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import java.lang.annotation.Target;
/**
* Annotation which indicates that a method parameter should be bound to the
- * {@linkplain org.springframework.ws.WebServiceMessage#getPayloadSource() request payload}. Supported for annotated
- * endpoint methods.
+ * {@linkplain org.springframework.ws.WebServiceMessage#getPayloadSource() request
+ * payload}. Supported for annotated endpoint methods.
*
* @author Arjen Poutsma
* @see ResponsePayload
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java
index e6c6f369..4f10655f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/ResponsePayload.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import java.lang.annotation.Target;
/**
* Annotation which indicates that a method return value should be bound to the
- * {@linkplain org.springframework.ws.WebServiceMessage#getPayloadSource() response payload}. Supported for annotated
- * endpoint methods.
+ * {@linkplain org.springframework.ws.WebServiceMessage#getPayloadSource() response
+ * payload}. Supported for annotated endpoint methods.
*
* @author Arjen Poutsma
* @see RequestPayload
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/XPathParam.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/XPathParam.java
index 7424474c..11408042 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/XPathParam.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/annotation/XPathParam.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Indicates that a method parameter should be bound to an XPath expression. The annotation value signifies the XPath
- * expression to use. The parameter can be of the following types:
+ * Indicates that a method parameter should be bound to an XPath expression. The
+ * annotation value signifies the XPath expression to use. The parameter can be of the
+ * following types:
*
*
{@code boolean}, or {@link Boolean}
*
{@code double}, or {@link Double}
@@ -43,4 +44,5 @@ import java.lang.annotation.Target;
public @interface XPathParam {
String value();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java
index 4a99882e..bbdd4965 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/AbstractValidatingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,6 +21,9 @@ import java.io.IOException;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
@@ -37,16 +40,15 @@ import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.validation.XmlValidatorFactory;
import org.springframework.xml.xsd.XsdSchema;
import org.springframework.xml.xsd.XsdSchemaCollection;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
/**
- * Abstract base class for {@code EndpointInterceptor} implementations that validate part of the message using a schema.
- * The exact message part is determined by the {@code getValidationRequestSource} and
- * {@code getValidationResponseSource} template methods.
+ * Abstract base class for {@code EndpointInterceptor} implementations that validate part
+ * of the message using a schema. The exact message part is determined by the
+ * {@code getValidationRequestSource} and {@code getValidationResponseSource} template
+ * methods.
*
- * By default, only the request message is validated, but this behaviour can be changed using the
- * {@code validateRequest} and {@code validateResponse} properties.
+ * By default, only the request message is validated, but this behaviour can be changed
+ * using the {@code validateRequest} and {@code validateResponse} properties.
*
* @author Arjen Poutsma
* @see #getValidationRequestSource(org.springframework.ws.WebServiceMessage)
@@ -73,8 +75,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Sets the schema language. Default is the W3C XML Schema: {@code http://www.w3.org/2001/XMLSchema"}.
- *
+ * Sets the schema language. Default is the W3C XML Schema:
+ * {@code http://www.w3.org/2001/XMLSchema"}.
* @see org.springframework.xml.validation.XmlValidatorFactory#SCHEMA_W3C_XML
* @see org.springframework.xml.validation.XmlValidatorFactory#SCHEMA_RELAX_NG
*/
@@ -89,8 +91,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the schema resource to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
*/
public void setSchema(Resource schema) {
setSchemas(schema);
@@ -98,8 +101,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the schema resources to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
*/
public void setSchemas(Resource... schemas) {
Assert.notEmpty(schemas, "schemas must not be empty or null");
@@ -112,9 +116,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/**
* Sets the {@link XsdSchema} to use for validation. Setting this property,
- * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection}, {@link #setSchema(Resource) schema}, or
- * {@link #setSchemas(Resource[]) schemas} is required.
- *
+ * {@link #setXsdSchemaCollection(XsdSchemaCollection) xsdSchemaCollection},
+ * {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is
+ * required.
* @param schema the xsd schema to use
* @throws IOException in case of I/O errors
*/
@@ -123,9 +127,9 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Sets the {@link XsdSchemaCollection} to use for validation. Setting this property, {@link #setXsdSchema(XsdSchema)
- * xsdSchema}, {@link #setSchema(Resource) schema}, or {@link #setSchemas(Resource[]) schemas} is required.
- *
+ * Sets the {@link XsdSchemaCollection} to use for validation. Setting this property,
+ * {@link #setXsdSchema(XsdSchema) xsdSchema}, {@link #setSchema(Resource) schema}, or
+ * {@link #setSchemas(Resource[]) schemas} is required.
* @param schemaCollection the xsd schema collection to use
* @throws IOException in case of I/O errors
*/
@@ -134,20 +138,26 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Sets the error handler to use for validation. If not set, a default error handler will be used.
- *
+ * Sets the error handler to use for validation. If not set, a default error handler
+ * will be used.
* @param errorHandler the error handler.
*/
public void setErrorHandler(ValidationErrorHandler errorHandler) {
this.errorHandler = errorHandler;
}
- /** Indicates whether the request should be validated against the schema. Default is {@code true}. */
+ /**
+ * Indicates whether the request should be validated against the schema. Default is
+ * {@code true}.
+ */
public void setValidateRequest(boolean validateRequest) {
this.validateRequest = validateRequest;
}
- /** Indicates whether the response should be validated against the schema. Default is {@code false}. */
+ /**
+ * Indicates whether the response should be validated against the schema. Default is
+ * {@code false}.
+ */
public void setValidateResponse(boolean validateResponse) {
this.validateResponse = validateResponse;
}
@@ -168,12 +178,12 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Validates the request message in the given message context. Validation only occurs if {@code validateRequest} is
- * set to {@code true}, which is the default.
+ * Validates the request message in the given message context. Validation only occurs
+ * if {@code validateRequest} is set to {@code true}, which is the default.
*
- * Returns {@code true} if the request is valid, or {@code false} if it isn't. Additionally, when the request message
- * is a {@link SoapMessage}, a {@link SoapFault} is added as response.
- *
+ * Returns {@code true} if the request is valid, or {@code false} if it isn't.
+ * Additionally, when the request message is a {@link SoapMessage}, a
+ * {@link SoapFault} is added as response.
* @param messageContext the message context
* @return {@code true} if the message is valid; {@code false} otherwise
* @see #setValidateRequest(boolean)
@@ -187,7 +197,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
SAXParseException[] errors = validator.validate(requestSource, errorHandler);
if (!ObjectUtils.isEmpty(errors)) {
return handleRequestValidationErrors(messageContext, errors);
- } else if (logger.isDebugEnabled()) {
+ }
+ else if (logger.isDebugEnabled()) {
logger.debug("Request message validated");
}
}
@@ -196,12 +207,13 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Template method that is called when the request message contains validation errors. Default implementation logs all
- * errors, and returns {@code false}, i.e. do not process the request.
- *
+ * Template method that is called when the request message contains validation errors.
+ * Default implementation logs all errors, and returns {@code false}, i.e. do not
+ * process the request.
* @param messageContext the message context
* @param errors the validation errors
- * @return {@code true} to continue processing the request, {@code false} (the default) otherwise
+ * @return {@code true} to continue processing the request, {@code false} (the
+ * default) otherwise
*/
protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors)
throws TransformerException {
@@ -212,11 +224,11 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Validates the response message in the given message context. Validation only occurs if {@code validateResponse} is
- * set to {@code true}, which is not the default.
+ * Validates the response message in the given message context. Validation only occurs
+ * if {@code validateResponse} is set to {@code true}, which is not
+ * the default.
*
* Returns {@code true} if the request is valid, or {@code false} if it isn't.
- *
* @param messageContext the message context.
* @return {@code true} if the response is valid; {@code false} otherwise
* @see #setValidateResponse(boolean)
@@ -229,7 +241,8 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
SAXParseException[] errors = validator.validate(responseSource, errorHandler);
if (!ObjectUtils.isEmpty(errors)) {
return handleResponseValidationErrors(messageContext, errors);
- } else if (logger.isDebugEnabled()) {
+ }
+ else if (logger.isDebugEnabled()) {
logger.debug("Response message validated");
}
}
@@ -238,12 +251,13 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
}
/**
- * Template method that is called when the response message contains validation errors. Default implementation logs
- * all errors, and returns {@code false}, i.e. do not cot continue to process the response interceptor chain.
- *
+ * Template method that is called when the response message contains validation
+ * errors. Default implementation logs all errors, and returns {@code false}, i.e. do
+ * not cot continue to process the response interceptor chain.
* @param messageContext the message context
* @param errors the validation errors
- * @return {@code true} to continue the response interceptor chain, {@code false} (the default) otherwise
+ * @return {@code true} to continue the response interceptor chain, {@code false} (the
+ * default) otherwise
*/
protected boolean handleResponseValidationErrors(MessageContext messageContext, SAXParseException[] errors) {
for (SAXParseException error : errors) {
@@ -260,21 +274,25 @@ public abstract class AbstractValidatingInterceptor extends TransformerObjectSup
/** Does nothing by default. */
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
+ }
/**
- * Abstract template method that returns the part of the request message that is to be validated.
- *
+ * Abstract template method that returns the part of the request message that is to be
+ * validated.
* @param request the request message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
protected abstract Source getValidationRequestSource(WebServiceMessage request);
/**
- * Abstract template method that returns the part of the response message that is to be validated.
- *
+ * Abstract template method that returns the part of the response message that is to
+ * be validated.
* @param response the response message
- * @return the part of the message that is to validated, or {@code null} not to validate anything
+ * @return the part of the message that is to validated, or {@code null} not to
+ * validate anything
*/
protected abstract Source getValidationResponseSource(WebServiceMessage response);
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java
index e64f197c..b9c2d495 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/DelegatingSmartEndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,8 @@ import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.SmartEndpointInterceptor;
/**
- * Implementation of the {@link SmartEndpointInterceptor} interface that delegates to a delegate
- * {@link EndpointInterceptor}.
+ * Implementation of the {@link SmartEndpointInterceptor} interface that delegates to a
+ * delegate {@link EndpointInterceptor}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -34,8 +34,8 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
private final EndpointInterceptor delegate;
/**
- * Creates a new instance of the {@code DelegatingSmartEndpointInterceptor} with the given delegate.
- *
+ * Creates a new instance of the {@code DelegatingSmartEndpointInterceptor} with the
+ * given delegate.
* @param delegate the endpoint interceptor to delegate to.
*/
public DelegatingSmartEndpointInterceptor(EndpointInterceptor delegate) {
@@ -45,7 +45,6 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
/**
* Returns the delegate.
- *
* @return the delegate
*/
public EndpointInterceptor getDelegate() {
@@ -55,7 +54,8 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
/**
* {@inheritDoc}
*
- * This implementation delegates to {@link #shouldIntercept(WebServiceMessage, Object)}.
+ * This implementation delegates to
+ * {@link #shouldIntercept(WebServiceMessage, Object)}.
*/
@Override
public boolean shouldIntercept(MessageContext messageContext, Object endpoint) {
@@ -67,10 +67,10 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
* Indicates whether this interceptor should intercept the given request message.
*
* This implementation always returns {@code true}.
- *
* @param request the request message
* @param endpoint chosen endpoint to invoke
- * @return {@code true} to indicate that this interceptor applies; {@code false} otherwise
+ * @return {@code true} to indicate that this interceptor applies; {@code false}
+ * otherwise
*/
protected boolean shouldIntercept(WebServiceMessage request, Object endpoint) {
return true;
@@ -95,4 +95,5 @@ public class DelegatingSmartEndpointInterceptor implements SmartEndpointIntercep
public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {
getDelegate().afterCompletion(messageContext, endpoint, ex);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java
index 76b36d2c..69aa4cfc 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/EndpointInterceptorAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,13 +18,14 @@ package org.springframework.ws.server.endpoint.interceptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.ws.context.MessageContext;
-import org.springframework.ws.server.EndpointInterceptor;
import org.w3c.dom.Element;
+import org.springframework.ws.context.MessageContext;
+import org.springframework.ws.server.EndpointInterceptor;
+
/**
- * Default implementation of the {@code EndpointInterceptor} interface, for simplified implementation of
- * pre-only/post-only interceptors.
+ * Default implementation of the {@code EndpointInterceptor} interface, for simplified
+ * implementation of pre-only/post-only interceptors.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -41,7 +42,6 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor {
/**
* Returns {@code true}.
- *
* @return {@code true}
*/
@Override
@@ -51,7 +51,6 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor {
/**
* Returns {@code true}.
- *
* @return {@code true}
*/
@Override
@@ -61,7 +60,6 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor {
/**
* Returns {@code true}.
- *
* @return {@code true}
*/
@Override
@@ -73,5 +71,7 @@ public class EndpointInterceptorAdapter implements EndpointInterceptor {
* Does nothing by default.
*/
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {
+ }
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptor.java
index 1da995b0..d91d3245 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadLoggingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,11 +22,11 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.server.endpoint.AbstractLoggingInterceptor;
/**
- * Simple {@link org.springframework.ws.server.EndpointInterceptor EndpointInterceptor} that logs the payload of request
- * and response messages.
+ * Simple {@link org.springframework.ws.server.EndpointInterceptor EndpointInterceptor}
+ * that logs the payload of request and response messages.
*
- * By default, both request and response messages are logged, but this behaviour can be changed using the
- * {@link #logRequest} and {@link #logResponse} properties.
+ * By default, both request and response messages are logged, but this behaviour can be
+ * changed using the {@link #logRequest} and {@link #logResponse} properties.
*
* @author Arjen Poutsma
* @see #setLogRequest(boolean)
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java
index f83ac8f8..30863a56 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,6 +29,9 @@ import javax.xml.transform.stream.StreamSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
@@ -37,16 +40,16 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.xml.transform.ResourceSource;
import org.springframework.xml.transform.TransformerObjectSupport;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
- * Interceptor that transforms the payload of {@code WebServiceMessage}s using XSLT stylesheet. Allows for seperate
- * stylesheets for request and response. This interceptor is especially useful when supporting with multiple version of
- * a Web service: you can transform the older message format to the new format.
+ * Interceptor that transforms the payload of {@code WebServiceMessage}s using XSLT
+ * stylesheet. Allows for seperate stylesheets for request and response. This interceptor
+ * is especially useful when supporting with multiple version of a Web service: you can
+ * transform the older message format to the new format.
*
- * The stylesheets to use can be set using the {@code requestXslt} and {@code responseXslt} properties. Both of these
- * are optional: if not set, the message is simply not transformed. Setting one of the two is required, though.
+ * The stylesheets to use can be set using the {@code requestXslt} and
+ * {@code responseXslt} properties. Both of these are optional: if not set, the message is
+ * simply not transformed. Setting one of the two is required, though.
*
* @author Arjen Poutsma
* @see #setRequestXslt(org.springframework.core.io.Resource)
@@ -77,9 +80,8 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
}
/**
- * Transforms the request message in the given message context using a provided stylesheet. Transformation only occurs
- * if the {@code requestXslt} has been set.
- *
+ * Transforms the request message in the given message context using a provided
+ * stylesheet. Transformation only occurs if the {@code requestXslt} has been set.
* @param messageContext the message context
* @return always returns {@code true}
* @see #setRequestXslt(org.springframework.core.io.Resource)
@@ -96,9 +98,8 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
}
/**
- * Transforms the response message in the given message context using a stylesheet. Transformation only occurs if the
- * {@code responseXslt} has been set.
- *
+ * Transforms the response message in the given message context using a stylesheet.
+ * Transformation only occurs if the {@code responseXslt} has been set.
* @param messageContext the message context
* @return always returns {@code true}
* @see #setResponseXslt(org.springframework.core.io.Resource)
@@ -129,7 +130,8 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
/** Does nothing by default. */
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
+ }
@Override
public void afterPropertiesSet() throws Exception {
@@ -156,4 +158,5 @@ public class PayloadTransformingInterceptor extends TransformerObjectSupport
responseTemplates = transformerFactory.newTemplates(responseSource);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractAnnotationMethodEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractAnnotationMethodEndpointMapping.java
index d2fff3a0..a84b1fb5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractAnnotationMethodEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractAnnotationMethodEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,10 +24,12 @@ import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
/**
- * Abstract base for {@link org.springframework.ws.server.EndpointMapping} implementations that map classes tagged with
- * an annotation. By default the annotation is {@link Endpoint}, but this can be overriden in subclasses.
+ * Abstract base for {@link org.springframework.ws.server.EndpointMapping} implementations
+ * that map classes tagged with an annotation. By default the annotation is
+ * {@link Endpoint}, but this can be overriden in subclasses.
*
- * The methods of each bean carrying @Endpoint will be registered using {@link #registerMethods(String)}.
+ * The methods of each bean carrying @Endpoint will be registered using
+ * {@link #registerMethods(String)}.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -39,11 +41,12 @@ public abstract class AbstractAnnotationMethodEndpointMapping extends Abstrac
/**
* Set whether to detect endpoint beans in ancestor ApplicationContexts.
*
- * Default is "false": Only endpoint beans in the current ApplicationContext will be detected, i.e. only in the
- * context that this EndpointMapping itself is defined in (typically the current MessageDispatcherServlet's context).
+ * Default is "false": Only endpoint beans in the current ApplicationContext will be
+ * detected, i.e. only in the context that this EndpointMapping itself is defined in
+ * (typically the current MessageDispatcherServlet's context).
*
- * Switch this flag on to detect endpoint beans in ancestor contexts (typically the Spring root WebApplicationContext)
- * as well.
+ * Switch this flag on to detect endpoint beans in ancestor contexts (typically the
+ * Spring root WebApplicationContext) as well.
*/
public void setDetectEndpointsInAncestorContexts(boolean detectEndpointsInAncestorContexts) {
this.detectEndpointsInAncestorContexts = detectEndpointsInAncestorContexts;
@@ -66,7 +69,8 @@ public abstract class AbstractAnnotationMethodEndpointMapping extends Abstrac
for (String beanName : beanNames) {
Class> endpointClass = getApplicationContext().getType(beanName);
- if (endpointClass != null && AnnotationUtils.findAnnotation(endpointClass, getEndpointAnnotationType()) != null) {
+ if (endpointClass != null
+ && AnnotationUtils.findAnnotation(endpointClass, getEndpointAnnotationType()) != null) {
registerMethods(beanName);
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java
index d0ca2d2f..3c06d032 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,7 +32,8 @@ import org.springframework.ws.server.EndpointMapping;
import org.springframework.ws.server.SmartEndpointInterceptor;
/**
- * Abstract base class for EndpointMapping implementations. Supports a default endpoint, and endpoint interceptors.
+ * Abstract base class for EndpointMapping implementations. Supports a default endpoint,
+ * and endpoint interceptors.
*
* @author Arjen Poutsma
* @see #getEndpointInternal(org.springframework.ws.context.MessageContext)
@@ -50,8 +51,8 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
private SmartEndpointInterceptor[] smartInterceptors;
/**
- * Returns the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.
- *
+ * Returns the endpoint interceptors to apply to all endpoints mapped by this endpoint
+ * mapping.
* @return array of endpoint interceptors, or {@code null} if none
*/
public EndpointInterceptor[] getInterceptors() {
@@ -59,8 +60,8 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
}
/**
- * Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint mapping.
- *
+ * Sets the endpoint interceptors to apply to all endpoints mapped by this endpoint
+ * mapping.
* @param interceptors array of endpoint interceptors, or {@code null} if none
*/
public final void setInterceptors(EndpointInterceptor[] interceptors) {
@@ -76,7 +77,6 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
* Specify the order value for this mapping.
*
* Default value is {@link Integer#MAX_VALUE}, meaning that it's non-ordered.
- *
* @see org.springframework.core.Ordered#getOrder()
*/
public final void setOrder(int order) {
@@ -85,7 +85,6 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
/**
* Initializes the interceptors.
- *
* @see #initInterceptors()
*/
@Override
@@ -95,22 +94,20 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
/**
* Initialize the specified interceptors, adapting them where necessary.
- *
* @see #setInterceptors
*/
protected void initInterceptors() {
Map smartInterceptors = BeanFactoryUtils
- .beansOfTypeIncludingAncestors(getApplicationContext(), SmartEndpointInterceptor.class, true, false);
+ .beansOfTypeIncludingAncestors(getApplicationContext(), SmartEndpointInterceptor.class, true, false);
if (!smartInterceptors.isEmpty()) {
this.smartInterceptors = smartInterceptors.values()
- .toArray(new SmartEndpointInterceptor[smartInterceptors.size()]);
+ .toArray(new SmartEndpointInterceptor[smartInterceptors.size()]);
}
}
/**
- * Look up an endpoint for the given message context, falling back to the default endpoint if no specific one is
- * found.
- *
+ * Look up an endpoint for the given message context, falling back to the default
+ * endpoint if no specific one is found.
* @return the looked up endpoint instance, or the default endpoint
* @see #getEndpointInternal(org.springframework.ws.context.MessageContext)
*/
@@ -149,9 +146,9 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
}
/**
- * Creates a new {@code EndpointInvocationChain} based on the given message context, endpoint, and interceptors.
- * Default implementation creates a simple {@code EndpointInvocationChain} based on the set interceptors.
- *
+ * Creates a new {@code EndpointInvocationChain} based on the given message context,
+ * endpoint, and interceptors. Default implementation creates a simple
+ * {@code EndpointInvocationChain} based on the set interceptors.
* @param endpoint the endpoint
* @param interceptors the endpoint interceptors
* @return the created invocation chain
@@ -164,7 +161,6 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
/**
* Returns the default endpoint for this endpoint mapping.
- *
* @return the default endpoint mapping, or null if none
*/
protected final Object getDefaultEndpoint() {
@@ -172,11 +168,10 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
}
/**
- * Sets the default endpoint for this endpoint mapping. This endpoint will be returned if no specific mapping was
- * found.
+ * Sets the default endpoint for this endpoint mapping. This endpoint will be returned
+ * if no specific mapping was found.
*
* Default is {@code null}, indicating no default endpoint.
- *
* @param defaultEndpoint the default endpoint, or null if none
*/
public final void setDefaultEndpoint(Object defaultEndpoint) {
@@ -184,28 +179,31 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
}
/**
- * Resolves an endpoint string. If the given string can is a bean name, it is resolved using the application context.
- *
+ * Resolves an endpoint string. If the given string can is a bean name, it is resolved
+ * using the application context.
* @param endpointName the endpoint name
* @return the resolved endpoint, or {@code null} if the name could not be resolved
*/
protected Object resolveStringEndpoint(String endpointName) {
if (getApplicationContext().containsBean(endpointName)) {
return getApplicationContext().getBean(endpointName);
- } else {
+ }
+ else {
return null;
}
}
/**
- * Lookup an endpoint for the given request, returning {@code null} if no specific one is found. This template method
- * is called by getEndpoint, a {@code null} return value will lead to the default handler, if one is set.
+ * Lookup an endpoint for the given request, returning {@code null} if no specific one
+ * is found. This template method is called by getEndpoint, a {@code null} return
+ * value will lead to the default handler, if one is set.
*
- * The returned endpoint can be a string, in which case it is resolved as a bean name. Also, it can take the form
- * {@code beanName#method}, in which case the method is resolved.
- *
+ * The returned endpoint can be a string, in which case it is resolved as a bean name.
+ * Also, it can take the form {@code beanName#method}, in which case the method is
+ * resolved.
* @return the looked up endpoint instance, or null
* @throws Exception if there is an error
*/
protected abstract Object getEndpointInternal(MessageContext messageContext) throws Exception;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractMapBasedEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractMapBasedEndpointMapping.java
index a32e9093..2129fe8c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractMapBasedEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/server/endpoint/mapping/AbstractMapBasedEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,11 +26,12 @@ import org.springframework.util.StringUtils;
import org.springframework.ws.context.MessageContext;
/**
- * Abstract base class for endpoint mapping that are based on a {@code Map}. Provides mappings of application context
- * beans as well as a settable map.
+ * Abstract base class for endpoint mapping that are based on a {@code Map}. Provides
+ * mappings of application context beans as well as a settable map.
*
- * Subclasses determine the exact nature of the key in the enpoint map; this can be a qualified name, a SOAP Header, the
- * result of a XPath validation. The values are always endpoint objects, or bean names of endpoint objects.
+ * Subclasses determine the exact nature of the key in the enpoint map; this can be a
+ * qualified name, a SOAP Header, the result of a XPath validation. The values are always
+ * endpoint objects, or bean names of endpoint objects.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -47,30 +48,32 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
private Map temporaryEndpointMap = new HashMap();
/**
- * Set whether to lazily initialize endpoints. Only applicable to singleton endpoints, as prototypes are always lazily
- * initialized. Default is {@code false}, as eager initialization allows for more efficiency through referencing the
- * controller objects directly.
+ * Set whether to lazily initialize endpoints. Only applicable to singleton endpoints,
+ * as prototypes are always lazily initialized. Default is {@code false}, as eager
+ * initialization allows for more efficiency through referencing the controller
+ * objects directly.
*
- * If you want to allow your endpoints to be lazily initialized, make them "lazy-init" and set this flag to
- * {@code true}. Just making them "lazy-init" will not work, as they are initialized through the references from the
- * endpoint mapping in this case.
+ * If you want to allow your endpoints to be lazily initialized, make them "lazy-init"
+ * and set this flag to {@code true}. Just making them "lazy-init" will not work, as
+ * they are initialized through the references from the endpoint mapping in this case.
*/
public void setLazyInitEndpoints(boolean lazyInitEndpoints) {
this.lazyInitEndpoints = lazyInitEndpoints;
}
/**
- * Set whether to register bean names found in the application context. Setting this to {@code true} will register all
- * beans found in the application context under their name. Default is {@code false}.
+ * Set whether to register bean names found in the application context. Setting this
+ * to {@code true} will register all beans found in the application context under
+ * their name. Default is {@code false}.
*/
public final void setRegisterBeanNames(boolean registerBeanNames) {
this.registerBeanNames = registerBeanNames;
}
/**
- * Sets a Map with keys and endpoint beans as values. The nature of the keys in the given map depends on the exact
- * subclass used. They can be qualified names, for instance, or mime headers.
- *
+ * Sets a Map with keys and endpoint beans as values. The nature of the keys in the
+ * given map depends on the exact subclass used. They can be qualified names, for
+ * instance, or mime headers.
* @throws IllegalArgumentException if the endpoint is invalid
*/
public final void setEndpointMap(Map endpointMap) {
@@ -78,8 +81,8 @@ public abstract class AbstractMapBasedEndpointMapping extends AbstractEndpointMa
}
/**
- * Maps keys to endpoint bean names. The nature of the property names depends on the exact subclass used. They can be
- * qualified names, for instance, or mime headers.
+ * Maps keys to endpoint bean names. The nature of the property names depends on the
+ * exact subclass used. They can be qualified names, for instance, or mime headers.
*/
public void setMappings(Properties mappings) {
for (Map.Entry
- *
+ *
*
* @author Tareq Abedrabbo
* @author Arjen Poutsma
@@ -92,8 +92,8 @@ public class SoapHeaderElementMethodArgumentResolver implements MethodArgumentRe
String paramValue = parameter.getParameterAnnotation(SoapHeader.class).value();
- Assert.isTrue(QNameUtils.validateQName(paramValue),
- "Invalid header qualified name [" + paramValue + "]. " + "QName must be of the form '{namespace}localPart'.");
+ Assert.isTrue(QNameUtils.validateQName(paramValue), "Invalid header qualified name [" + paramValue + "]. "
+ + "QName must be of the form '{namespace}localPart'.");
QName qname = QName.valueOf(paramValue);
@@ -101,7 +101,8 @@ public class SoapHeaderElementMethodArgumentResolver implements MethodArgumentRe
if (SoapHeaderElement.class.equals(parameterType)) {
return extractSoapHeader(qname, soapHeader);
- } else if (List.class.equals(parameterType)) {
+ }
+ else if (List.class.equals(parameterType)) {
return extractSoapHeaderList(qname, soapHeader);
}
// should not happen
@@ -131,4 +132,5 @@ public class SoapHeaderElementMethodArgumentResolver implements MethodArgumentRe
}
return result;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java
index cf7588f8..be811cf3 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,8 +26,8 @@ import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.soap.SoapMessage;
/**
- * Implementation of {@link MethodArgumentResolver} that supports {@link SoapMessage}, {@link SoapBody},
- * {@link SoapEnvelope}, and {@link SoapHeader}.
+ * Implementation of {@link MethodArgumentResolver} that supports {@link SoapMessage},
+ * {@link SoapBody}, {@link SoapEnvelope}, and {@link SoapHeader}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -50,14 +50,18 @@ public class SoapMethodArgumentResolver implements MethodArgumentResolver {
if (SoapMessage.class.equals(parameterType)) {
return request;
- } else if (SoapBody.class.equals(parameterType)) {
+ }
+ else if (SoapBody.class.equals(parameterType)) {
return request.getSoapBody();
- } else if (SoapEnvelope.class.equals(parameterType)) {
+ }
+ else if (SoapEnvelope.class.equals(parameterType)) {
return request.getEnvelope();
- } else if (SoapHeader.class.equals(parameterType)) {
+ }
+ else if (SoapHeader.class.equals(parameterType)) {
return request.getSoapHeader();
}
// should not happen
throw new UnsupportedOperationException();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/FaultCode.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/FaultCode.java
index a3277fd0..ccd2d3db 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/FaultCode.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/FaultCode.java
@@ -1,18 +1,18 @@
/*
-* Copyright 2005-2022 the original author or authors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.ws.soap.server.endpoint.annotation;
@@ -22,7 +22,8 @@ import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.soap11.Soap11Body;
/**
- * Enumeration that represents the standard SOAP Fault codes for use with the JDK 1.5+ {@link SoapFault} annotation.
+ * Enumeration that represents the standard SOAP Fault codes for use with the JDK 1.5+
+ * {@link SoapFault} annotation.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -30,11 +31,11 @@ import org.springframework.ws.soap.soap11.Soap11Body;
public enum FaultCode {
/**
- * Constant used to indicate that a fault must be created with a custom fault code. When this value is used, the
- * {@code customFaultCode} string property must be used on {@link SoapFault}.
+ * Constant used to indicate that a fault must be created with a custom fault code.
+ * When this value is used, the {@code customFaultCode} string property must be used
+ * on {@link SoapFault}.
*
* Note that custom Fault Codes are only supported on SOAP 1.1.
- *
* @see SoapFault#customFaultCode()
* @see Soap11Body#addFault(javax.xml.namespace.QName,String,java.util.Locale)
*/
@@ -42,28 +43,27 @@ public enum FaultCode {
/**
* Constant used to indicate that a {@code Client} fault must be created.
- *
* @see SoapBody#addClientOrSenderFault(String,java.util.Locale)
*/
CLIENT(new QName("CLIENT")),
/**
- * Constant {@code QName} used to indicate that a {@code Receiver} fault must be created.
- *
+ * Constant {@code QName} used to indicate that a {@code Receiver} fault must be
+ * created.
* @see SoapBody#addServerOrReceiverFault(String,java.util.Locale)
*/
RECEIVER(new QName("RECEIVER")),
/**
- * Constant {@code QName} used to indicate that a {@code Sender} fault must be created.
- *
+ * Constant {@code QName} used to indicate that a {@code Sender} fault must be
+ * created.
* @see SoapBody#addServerOrReceiverFault(String,java.util.Locale)
*/
SENDER(new QName("SENDER")),
/**
- * Constant {@code QName} used to indicate that a {@code Server} fault must be created.
- *
+ * Constant {@code QName} used to indicate that a {@code Server} fault must be
+ * created.
* @see SoapBody#addClientOrSenderFault(String,java.util.Locale)
*/
SERVER(new QName("SERVER"));
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapAction.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapAction.java
index efe6d424..1e3b4238 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapAction.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapAction.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Marks an endpoint method as the handler for an incoming request. The annotation value signifies the value for the
- * request {@code SOAPAction} header that is handled by the method.
+ * Marks an endpoint method as the handler for an incoming request. The annotation value
+ * signifies the value for the request {@code SOAPAction} header that is handled by the
+ * method.
*
* @author Arjen Poutsma
* @see org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping
@@ -37,7 +38,10 @@ import java.lang.annotation.Target;
@Repeatable(SoapActions.class)
public @interface SoapAction {
- /** Signifies the value for the request {@code SOAPAction} header that is handled by the method. */
+ /**
+ * Signifies the value for the request {@code SOAPAction} header that is handled by
+ * the method.
+ */
String value();
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapFault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapFault.java
index 41be0ef2..30eb36be 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapFault.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapFault.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,7 +26,8 @@ import java.lang.annotation.Target;
import javax.xml.namespace.QName;
/**
- * Marks an exception class with the fault elements that should be returned whenever this exception is thrown.
+ * Marks an exception class with the fault elements that should be returned whenever this
+ * exception is thrown.
*
* @author Arjen Poutsma
* @see org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver
@@ -42,16 +43,19 @@ public @interface SoapFault {
FaultCode faultCode();
/**
- * The custom fault code, to be used if {@link #faultCode()} is set to {@link FaultCode#CUSTOM}.
+ * The custom fault code, to be used if {@link #faultCode()} is set to
+ * {@link FaultCode#CUSTOM}.
*
- * The format used is that of {@link QName#toString()}, i.e. "{" + Namespace URI + "}" + local part, where the
- * namespace is optional.
+ * The format used is that of {@link QName#toString()}, i.e. "{" + Namespace URI + "}"
+ * + local part, where the namespace is optional.
*
* Note that custom Fault Codes are only supported on SOAP 1.1.
*/
String customFaultCode() default "";
- /** The fault string or reason text. By default, it is set to the exception message. */
+ /**
+ * The fault string or reason text. By default, it is set to the exception message.
+ */
String faultStringOrReason() default "";
/** The fault string locale. By default, it is English. */
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapHeader.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapHeader.java
index 9f22921d..2d334bfc 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapHeader.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/annotation/SoapHeader.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,9 +33,12 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SoapHeader {
+
/**
- * The qualified name of the soap header. The format used is that of {@link javax.xml.namespace.QName#toString()},
- * i.e. "{" + Namespace URI + "}" + local part, where the namespace is optional.
+ * The qualified name of the soap header. The format used is that of
+ * {@link javax.xml.namespace.QName#toString()}, i.e. "{" + Namespace URI + "}" +
+ * local part, where the namespace is optional.
*/
String value();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java
index 45bfab2f..758d9ae7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/AbstractFaultCreatingValidatingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,6 +21,8 @@ import java.util.Locale;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
+import org.xml.sax.SAXParseException;
+
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor;
import org.springframework.ws.soap.SoapBody;
@@ -28,12 +30,12 @@ import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultDetail;
import org.springframework.ws.soap.SoapFaultDetailElement;
import org.springframework.ws.soap.SoapMessage;
-import org.xml.sax.SAXParseException;
/**
- * Subclass of {@code AbstractValidatingInterceptor} that creates a SOAP Fault whenever the request message cannot be
- * validated. The contents of the SOAP Fault can be specified by setting the {@code addValidationErrorDetail},
- * {@code faultStringOrReason}, or {@code detailElementName} properties. Further customizing can be accomplished by
+ * Subclass of {@code AbstractValidatingInterceptor} that creates a SOAP Fault whenever
+ * the request message cannot be validated. The contents of the SOAP Fault can be
+ * specified by setting the {@code addValidationErrorDetail}, {@code faultStringOrReason},
+ * or {@code detailElementName} properties. Further customizing can be accomplished by
* overriding {@code handleRequestValidationErrors}.
*
* @author Arjen Poutsma
@@ -49,7 +51,6 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
/**
* Default SOAP Fault Detail name used when a validation errors occur on the request.
- *
* @see #setDetailElementName(javax.xml.namespace.QName)
*/
public static final QName DEFAULT_DETAIL_ELEMENT_NAME = new QName("http://springframework.org/spring-ws",
@@ -57,7 +58,6 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
/**
* Default SOAP Fault string used when a validation errors occur on the request.
- *
* @see #setFaultStringOrReason(String)
*/
public static final String DEFAULT_FAULTSTRING_OR_REASON = "Validation error";
@@ -71,10 +71,10 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
private Locale faultStringOrReasonLocale = Locale.ENGLISH;
/**
- * Returns whether a SOAP Fault detail element should be created when a validation error occurs. This detail element
- * will contain the exact validation errors. It is only added when the underlying message is a {@code SoapMessage}.
- * Defaults to {@code true}.
- *
+ * Returns whether a SOAP Fault detail element should be created when a validation
+ * error occurs. This detail element will contain the exact validation errors. It is
+ * only added when the underlying message is a {@code SoapMessage}. Defaults to
+ * {@code true}.
* @see org.springframework.ws.soap.SoapFault#addFaultDetail()
*/
public boolean getAddValidationErrorDetail() {
@@ -82,55 +82,62 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
}
/**
- * Indicates whether a SOAP Fault detail element should be created when a validation error occurs. This detail element
- * will contain the exact validation errors. It is only added when the underlying message is a {@code SoapMessage}.
- * Defaults to {@code true}.
- *
+ * Indicates whether a SOAP Fault detail element should be created when a validation
+ * error occurs. This detail element will contain the exact validation errors. It is
+ * only added when the underlying message is a {@code SoapMessage}. Defaults to
+ * {@code true}.
* @see org.springframework.ws.soap.SoapFault#addFaultDetail()
*/
public void setAddValidationErrorDetail(boolean addValidationErrorDetail) {
this.addValidationErrorDetail = addValidationErrorDetail;
}
- /** Returns the fault detail element name when validation errors occur on the request. */
+ /**
+ * Returns the fault detail element name when validation errors occur on the request.
+ */
public QName getDetailElementName() {
return detailElementName;
}
/**
- * Sets the fault detail element name when validation errors occur on the request. Defaults to
- * {@code DEFAULT_DETAIL_ELEMENT_NAME}.
- *
+ * Sets the fault detail element name when validation errors occur on the request.
+ * Defaults to {@code DEFAULT_DETAIL_ELEMENT_NAME}.
* @see #DEFAULT_DETAIL_ELEMENT_NAME
*/
public void setDetailElementName(QName detailElementName) {
this.detailElementName = detailElementName;
}
- /** Sets the SOAP {@code faultstring} or {@code Reason} used when validation errors occur on the request. */
+ /**
+ * Sets the SOAP {@code faultstring} or {@code Reason} used when validation errors
+ * occur on the request.
+ */
public String getFaultStringOrReason() {
return faultStringOrReason;
}
/**
- * Sets the SOAP {@code faultstring} or {@code Reason} used when validation errors occur on the request. It is only
- * added when the underlying message is a {@code SoapMessage}. Defaults to {@code DEFAULT_FAULTSTRING_OR_REASON}.
- *
+ * Sets the SOAP {@code faultstring} or {@code Reason} used when validation errors
+ * occur on the request. It is only added when the underlying message is a
+ * {@code SoapMessage}. Defaults to {@code DEFAULT_FAULTSTRING_OR_REASON}.
* @see #DEFAULT_FAULTSTRING_OR_REASON
*/
public void setFaultStringOrReason(String faultStringOrReason) {
this.faultStringOrReason = faultStringOrReason;
}
- /** Returns the SOAP fault reason locale used when validation errors occur on the request. */
+ /**
+ * Returns the SOAP fault reason locale used when validation errors occur on the
+ * request.
+ */
public Locale getFaultStringOrReasonLocale() {
return faultStringOrReasonLocale;
}
/**
- * Sets the SOAP fault reason locale used when validation errors occur on the request. It is only added when the
- * underlying message is a {@code SoapMessage}. Defaults to English.
- *
+ * Sets the SOAP fault reason locale used when validation errors occur on the request.
+ * It is only added when the underlying message is a {@code SoapMessage}. Defaults to
+ * English.
* @see java.util.Locale#ENGLISH
*/
public void setFaultStringOrReasonLocale(Locale faultStringOrReasonLocale) {
@@ -138,14 +145,15 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
}
/**
- * Template method that is called when the request message contains validation errors. This implementation logs all
- * errors, returns {@code false}, and creates a {@link SoapBody#addClientOrSenderFault(String,Locale) client or
- * sender} {@link SoapFault}, adding a {@link SoapFaultDetail} with all errors if the {@code addValidationErrorDetail}
- * property is {@code true}.
- *
+ * Template method that is called when the request message contains validation errors.
+ * This implementation logs all errors, returns {@code false}, and creates a
+ * {@link SoapBody#addClientOrSenderFault(String,Locale) client or sender}
+ * {@link SoapFault}, adding a {@link SoapFaultDetail} with all errors if the
+ * {@code addValidationErrorDetail} property is {@code true}.
* @param messageContext the message context
* @param errors the validation errors
- * @return {@code true} to continue processing the request, {@code false} (the default) otherwise
+ * @return {@code true} to continue processing the request, {@code false} (the
+ * default) otherwise
*/
@Override
protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors)
@@ -167,4 +175,5 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
}
return false;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java
index abd06d61..fad01b6f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/DelegatingSmartSoapEndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,8 @@ import org.springframework.ws.soap.server.SmartSoapEndpointInterceptor;
import org.springframework.ws.soap.server.SoapEndpointInterceptor;
/**
- * Implementation of the {@link SmartSoapEndpointInterceptor} interface that delegates to a delegate
- * {@link SoapEndpointInterceptor}.
+ * Implementation of the {@link SmartSoapEndpointInterceptor} interface that delegates to
+ * a delegate {@link SoapEndpointInterceptor}.
*
* @author Arjen Poutsma
* @since 2.0
@@ -33,8 +33,8 @@ public class DelegatingSmartSoapEndpointInterceptor extends DelegatingSmartEndpo
implements SmartSoapEndpointInterceptor {
/**
- * Creates a new instance of the {@code DelegatingSmartSoapEndpointInterceptor} with the given delegate.
- *
+ * Creates a new instance of the {@code DelegatingSmartSoapEndpointInterceptor} with
+ * the given delegate.
* @param delegate the endpoint interceptor to delegate to.
*/
public DelegatingSmartSoapEndpointInterceptor(EndpointInterceptor delegate) {
@@ -46,8 +46,10 @@ public class DelegatingSmartSoapEndpointInterceptor extends DelegatingSmartEndpo
EndpointInterceptor delegate = getDelegate();
if (delegate instanceof SoapEndpointInterceptor) {
return ((SoapEndpointInterceptor) delegate).understands(header);
- } else {
+ }
+ else {
return false;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptor.java
index f7b1c27a..b768dd06 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,9 +27,10 @@ import org.springframework.ws.server.endpoint.support.PayloadRootUtils;
import org.springframework.xml.transform.TransformerHelper;
/**
- * Implementation of the {@link org.springframework.ws.soap.server.SmartSoapEndpointInterceptor
- * SmartSoapEndpointInterceptor} interface that only intercepts requests that have a specified namespace URI or local
- * part (or both) as payload root.
+ * Implementation of the
+ * {@link org.springframework.ws.soap.server.SmartSoapEndpointInterceptor
+ * SmartSoapEndpointInterceptor} interface that only intercepts requests that have a
+ * specified namespace URI or local part (or both) as payload root.
*
* @author Arjen Poutsma
* @since 2.0
@@ -42,7 +43,8 @@ public class PayloadRootSmartSoapEndpointInterceptor extends DelegatingSmartSoap
private final String localPart;
- public PayloadRootSmartSoapEndpointInterceptor(EndpointInterceptor delegate, String namespaceUri, String localPart) {
+ public PayloadRootSmartSoapEndpointInterceptor(EndpointInterceptor delegate, String namespaceUri,
+ String localPart) {
super(delegate);
Assert.hasLength(namespaceUri, "namespaceUri can not be empty");
this.namespaceUri = namespaceUri;
@@ -62,8 +64,10 @@ public class PayloadRootSmartSoapEndpointInterceptor extends DelegatingSmartSoap
}
return !StringUtils.hasLength(localPart) || localPart.equals(payloadRootName.getLocalPart());
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
return false;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptor.java
index ffe85cb5..31b3ca9d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,15 +21,17 @@ import javax.xml.transform.Source;
import org.springframework.ws.WebServiceMessage;
/**
- * Interceptor that validates the contents of {@code WebServiceMessage}s using a schema. Allows for both W3C XML and
- * RELAX NG schemas.
+ * Interceptor that validates the contents of {@code WebServiceMessage}s using a schema.
+ * Allows for both W3C XML and RELAX NG schemas.
*
- * When the payload is invalid, this interceptor stops processing of the interceptor chain. Additionally, if the message
- * is a SOAP request message, a SOAP Fault is created as reply. Invalid SOAP responses do not result in a fault.
+ * When the payload is invalid, this interceptor stops processing of the interceptor
+ * chain. Additionally, if the message is a SOAP request message, a SOAP Fault is created
+ * as reply. Invalid SOAP responses do not result in a fault.
*
- * The schema to validate against is set with the {@code schema} property or {@code schemas} property. By default, only
- * the request message is validated, but this behaviour can be changed using the {@code validateRequest} and
- * {@code validateResponse} properties. Responses that contains faults are not validated.
+ * The schema to validate against is set with the {@code schema} property or
+ * {@code schemas} property. By default, only the request message is validated, but this
+ * behaviour can be changed using the {@code validateRequest} and {@code validateResponse}
+ * properties. Responses that contains faults are not validated.
*
* @author Arjen Poutsma
* @see #setSchema(org.springframework.core.io.Resource)
@@ -51,4 +53,5 @@ public class PayloadValidatingInterceptor extends AbstractFaultCreatingValidatin
protected Source getValidationResponseSource(WebServiceMessage response) {
return response.getPayloadSource();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptor.java
index 84cae985..379351fd 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,8 @@ import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.soap.SoapMessage;
/**
- * Implementation of the {@link org.springframework.ws.server.SmartEndpointInterceptor} interface that only intercepts
- * requests that have a specified soap action.
+ * Implementation of the {@link org.springframework.ws.server.SmartEndpointInterceptor}
+ * interface that only intercepts requests that have a specified soap action.
*
* @author Arjen Poutsma
* @since 2.0
@@ -48,8 +48,10 @@ public class SoapActionSmartEndpointInterceptor extends DelegatingSmartSoapEndpo
soapAction = soapAction.substring(1, soapAction.length() - 1);
}
return this.soapAction.equals(soapAction);
- } else {
+ }
+ else {
return false;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java
index 412b7d78..e0121e08 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapEnvelopeLoggingInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,9 +26,10 @@ import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.server.SoapEndpointInterceptor;
/**
- * SOAP-specific {@code EndpointInterceptor} that logs the complete request and response envelope of {@code SoapMessage}
- * messages. By default, request, response and fault messages are logged, but this behaviour can be changed using the
- * {@code logRequest}, {@code logResponse}, {@code logFault} properties.
+ * SOAP-specific {@code EndpointInterceptor} that logs the complete request and response
+ * envelope of {@code SoapMessage} messages. By default, request, response and fault
+ * messages are logged, but this behaviour can be changed using the {@code logRequest},
+ * {@code logResponse}, {@code logFault} properties.
*
* @author Arjen Poutsma
* @see #setLogRequest(boolean)
@@ -63,8 +64,10 @@ public class SoapEnvelopeLoggingInterceptor extends AbstractLoggingInterceptor i
if (message instanceof SoapMessage) {
SoapMessage soapMessage = (SoapMessage) message;
return soapMessage.getEnvelope().getSource();
- } else {
+ }
+ else {
return null;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java
index e9db34e7..a442ffd8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,15 +25,17 @@ import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
import org.springframework.ws.soap.server.SoapEndpointMapping;
/**
- * {@code EndpointMapping} implement that adds SOAP actors or roles to a delegate endpoint. Delegates to another
- * {@code EndpointMapping}, set by {@code delegate}, and adds the actors or roles specified by {@code actorsOrRoles}.
+ * {@code EndpointMapping} implement that adds SOAP actors or roles to a delegate
+ * endpoint. Delegates to another {@code EndpointMapping}, set by {@code delegate}, and
+ * adds the actors or roles specified by {@code actorsOrRoles}.
*
- * This endpoint mapping makes it possible to set actors/roles on a specific endpoint, without making the all endpoint
- * mappings depend on SOAP-specific functionality. For normal use, setting an actor or role on an endpoint is not
- * required, the default 'next' role is sufficient.
+ * This endpoint mapping makes it possible to set actors/roles on a specific endpoint,
+ * without making the all endpoint mappings depend on SOAP-specific functionality. For
+ * normal use, setting an actor or role on an endpoint is not required, the default 'next'
+ * role is sufficient.
*
- * It is only in a scenario when a certain endpoint act as a SOAP intermediary for another endpoint, as described in the
- * SOAP specificication, this mapping is useful.
+ * It is only in a scenario when a certain endpoint act as a SOAP intermediary for another
+ * endpoint, as described in the SOAP specificication, this mapping is useful.
*
* @author Arjen Poutsma
* @see org.springframework.ws.soap.SoapHeader#examineMustUnderstandHeaderElements(String)
@@ -71,9 +73,8 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
}
/**
- * Creates a new {@code SoapEndpointInvocationChain} based on the delegate endpoint, the delegate interceptors, and
- * set actors/roles.
- *
+ * Creates a new {@code SoapEndpointInvocationChain} based on the delegate endpoint,
+ * the delegate interceptors, and set actors/roles.
* @see #setActorsOrRoles(String[])
*/
@Override
@@ -82,7 +83,8 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
if (delegateChain != null) {
return new SoapEndpointInvocationChain(delegateChain.getEndpoint(), delegateChain.getInterceptors(),
actorsOrRoles, isUltimateReceiver);
- } else {
+ }
+ else {
return null;
}
}
@@ -91,4 +93,5 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
public void afterPropertiesSet() throws Exception {
Assert.notNull(delegate, "delegate is required");
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java
index f17e2ea7..3cac0b93 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,8 +34,9 @@ import org.springframework.ws.soap.server.endpoint.annotation.SoapAction;
import org.springframework.ws.soap.server.endpoint.annotation.SoapActions;
/**
- * Implementation of the {@link org.springframework.ws.server.EndpointMapping} interface that uses the
- * {@link SoapAction} annotation to map methods to the request SOAPAction header.
+ * Implementation of the {@link org.springframework.ws.server.EndpointMapping} interface
+ * that uses the {@link SoapAction} annotation to map methods to the request SOAPAction
+ * header.
*
* Endpoints typically have the following form:
*
@@ -77,9 +78,8 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
}
/**
- * Creates a new {@code SoapEndpointInvocationChain} based on the given endpoint, and the set interceptors, and
- * actors/roles.
- *
+ * Creates a new {@code SoapEndpointInvocationChain} based on the given endpoint, and
+ * the set interceptors, and actors/roles.
* @param endpoint the endpoint
* @param interceptors the endpoint interceptors
* @return the created invocation chain
@@ -87,8 +87,8 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
* @see #setActorsOrRoles(String[])
*/
@Override
- protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext, Object endpoint,
- EndpointInterceptor[] interceptors) {
+ protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,
+ Object endpoint, EndpointInterceptor[] interceptors) {
return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
}
@@ -100,10 +100,12 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
if (StringUtils.hasLength(soapAction) && soapAction.charAt(0) == '"'
&& soapAction.charAt(soapAction.length() - 1) == '"') {
return soapAction.substring(1, soapAction.length() - 1);
- } else {
+ }
+ else {
return soapAction;
}
- } else {
+ }
+ else {
return null;
}
}
@@ -123,7 +125,8 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
for (SoapAction soapAction : soapActions.value()) {
result.add(soapAction.value());
}
- } else {
+ }
+ else {
SoapAction soapAction = AnnotationUtils.findAnnotation(method, SoapAction.class);
if (soapAction != null) {
result.add(soapAction.value());
@@ -131,4 +134,5 @@ public class SoapActionAnnotationMethodEndpointMapping extends AbstractAnnotatio
}
return result;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java
index 89e53a24..d3cc9e5d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMapping.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,14 +27,15 @@ import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
import org.springframework.ws.soap.server.SoapEndpointMapping;
/**
- * Implementation of the {@code EndpointMapping} interface to map from {@code SOAPAction} headers to endpoint beans.
- * Supports both mapping to bean instances and mapping to bean names: the latter is required for prototype handlers.
+ * Implementation of the {@code EndpointMapping} interface to map from {@code SOAPAction}
+ * headers to endpoint beans. Supports both mapping to bean instances and mapping to bean
+ * names: the latter is required for prototype handlers.
*
- * The {@code endpointMap} property is suitable for populating the endpoint map with bean references, e.g. via the map
- * element in XML bean definitions.
+ * The {@code endpointMap} property is suitable for populating the endpoint map with bean
+ * references, e.g. via the map element in XML bean definitions.
*
- * Mappings to bean names can be set via the {@code mappings} property, in a form accepted by the
- * {@code java.util.Properties} class, like as follows:
+ * Mappings to bean names can be set via the {@code mappings} property, in a form accepted
+ * by the {@code java.util.Properties} class, like as follows:
*
*
* http://www.springframework.org/spring-ws/samples/airline/BookFlight=bookFlightEndpoint
@@ -43,8 +44,9 @@ import org.springframework.ws.soap.server.SoapEndpointMapping;
*
* The syntax is SOAP_ACTION=ENDPOINT_BEAN_NAME.
*
- * This endpoint mapping does not read from the request message, and therefore is more suitable for message factories
- * which directly read from the transport request (such as the {@link org.springframework.ws.soap.saaj.SaajSoapMessageFactory} with the
+ * This endpoint mapping does not read from the request message, and therefore is more
+ * suitable for message factories which directly read from the transport request (such as
+ * the {@link org.springframework.ws.soap.saaj.SaajSoapMessageFactory} with the
* {@code payloadCaching} disabled).
*
* @author Arjen Poutsma
@@ -74,9 +76,8 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
}
/**
- * Creates a new {@code SoapEndpointInvocationChain} based on the given endpoint, and the set interceptors, and
- * actors/roles.
- *
+ * Creates a new {@code SoapEndpointInvocationChain} based on the given endpoint, and
+ * the set interceptors, and actors/roles.
* @param endpoint the endpoint
* @param interceptors the endpoint interceptors
* @return the created invocation chain
@@ -84,8 +85,8 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
* @see #setActorsOrRoles(String[])
*/
@Override
- protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext, Object endpoint,
- EndpointInterceptor[] interceptors) {
+ protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,
+ Object endpoint, EndpointInterceptor[] interceptors) {
return new SoapEndpointInvocationChain(endpoint, interceptors, actorsOrRoles, isUltimateReceiver);
}
@@ -97,10 +98,12 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
if (StringUtils.hasLength(soapAction) && soapAction.charAt(0) == '"'
&& soapAction.charAt(soapAction.length() - 1) == '"') {
return soapAction.substring(1, soapAction.length() - 1);
- } else {
+ }
+ else {
return soapAction;
}
- } else {
+ }
+ else {
return null;
}
}
@@ -109,4 +112,5 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
protected boolean validateLookupKey(String key) {
return StringUtils.hasLength(key);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java
index 4c2be7d6..8e87014a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Body.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapFaultException;
/**
- * Subinterface of {@code SoapBody} that exposes SOAP 1.1 functionality. Necessary because SOAP 1.1 differs from SOAP
- * 1.2 with respect to SOAP Faults.
+ * Subinterface of {@code SoapBody} that exposes SOAP 1.1 functionality. Necessary because
+ * SOAP 1.1 differs from SOAP 1.2 with respect to SOAP Faults.
*
* @author Arjen Poutsma
* @see Soap11Fault
@@ -34,9 +34,8 @@ import org.springframework.ws.soap.SoapFaultException;
public interface Soap11Body extends SoapBody {
/**
- * Adds a SOAP 1.1 Fault to the body with a localized message. Adding a fault removes the
- * current content of the body.
- *
+ * Adds a SOAP 1.1 Fault to the body with a localized message.
+ * Adding a fault removes the current content of the body.
* @param faultCode the fully qualified fault faultCode
* @param faultString the faultString
* @param faultStringLocale the faultString locale. May be {@code null}
@@ -59,4 +58,5 @@ public interface Soap11Body extends SoapBody {
@Override
Soap11Fault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Fault.java
index a522ad18..abdeefff 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Fault.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Fault.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,8 +21,8 @@ import java.util.Locale;
import org.springframework.ws.soap.SoapFault;
/**
- * Subinterface of {@code SoapFault} that exposes SOAP 1.1 functionality. Necessary because SOAP 1.1 differs from SOAP
- * 1.2 with respect to SOAP Faults.
+ * Subinterface of {@code SoapFault} that exposes SOAP 1.1 functionality. Necessary
+ * because SOAP 1.1 differs from SOAP 1.2 with respect to SOAP Faults.
*
* @author Arjen Poutsma
* @since 1.0.0
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Header.java
index f490e458..f52ec146 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Header.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap11/Soap11Header.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,9 +31,9 @@ import org.springframework.ws.soap.SoapHeaderException;
public interface Soap11Header extends SoapHeader {
/**
- * Returns an {@code Iterator} over all the {@link SoapHeaderElement header elements} that should be processed for the
- * given actors. Headers target to the "next" actor or role will always be included.
- *
+ * Returns an {@code Iterator} over all the {@link SoapHeaderElement header elements}
+ * that should be processed for the given actors. Headers target to the "next" actor
+ * or role will always be included.
* @param actors an array of actors to search for
* @return an iterator over all the header elements that contain the specified actors
* @throws SoapHeaderException if the headers cannot be returned
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java
index 45e9f62c..098a5d13 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Body.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapFaultException;
/**
- * Subinterface of {@code SoapBody} that exposes SOAP 1.2 functionality. Necessary because SOAP 1.1 differs from SOAP
- * 1.2 with respect to SOAP Faults.
+ * Subinterface of {@code SoapBody} that exposes SOAP 1.2 functionality. Necessary because
+ * SOAP 1.1 differs from SOAP 1.2 with respect to SOAP Faults.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -36,7 +36,6 @@ public interface Soap12Body extends SoapBody {
* Adds a {@code DataEncodingUnknown} fault to the body.
*
* Adding a fault removes the current content of the body.
- *
* @param subcodes the optional fully qualified fault subcodes
* @param reason the fault reason
* @param locale the language of the fault reason
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Fault.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Fault.java
index 14f4c2c5..528530f6 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Fault.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Fault.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import javax.xml.namespace.QName;
import org.springframework.ws.soap.SoapFault;
/**
- * Subinterface of {@code SoapFault} that exposes SOAP 1.2 functionality. Necessary because SOAP 1.1 differs from SOAP
- * 1.2 with respect to SOAP Faults.
+ * Subinterface of {@code SoapFault} that exposes SOAP 1.2 functionality. Necessary
+ * because SOAP 1.1 differs from SOAP 1.2 with respect to SOAP Faults.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -33,15 +33,14 @@ import org.springframework.ws.soap.SoapFault;
public interface Soap12Fault extends SoapFault {
/**
- * Returns an iteration over the fault subcodes. The subcodes are returned in order: from top to bottom.
- *
+ * Returns an iteration over the fault subcodes. The subcodes are returned in order:
+ * from top to bottom.
* @return an Iterator that contains {@code QNames} representing the fault subcodes
*/
Iterator getFaultSubcodes();
/**
* Adds a fault subcode this fault.
- *
* @param subcode the qualified name of the subcode
*/
void addFaultSubcode(QName subcode);
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Header.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Header.java
index 4725342b..77b6920a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Header.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/soap12/Soap12Header.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,27 +34,26 @@ public interface Soap12Header extends SoapHeader {
/**
* Adds a new NotUnderstood {@code SoapHeaderElement} this header.
- *
* @param headerName the qualified name of the header that was not understood
* @return the created {@code SoapHeaderElement}
- * @throws org.springframework.ws.soap.SoapHeaderException if the header cannot be created
+ * @throws org.springframework.ws.soap.SoapHeaderException if the header cannot be
+ * created
*/
SoapHeaderElement addNotUnderstoodHeaderElement(QName headerName);
/**
* Adds a new Upgrade {@code SoapHeaderElement} this header.
- *
* @param supportedSoapUris an array of the URIs of SOAP versions supported
* @return the created {@code SoapHeaderElement}
- * @throws org.springframework.ws.soap.SoapHeaderException if the header cannot be created
+ * @throws org.springframework.ws.soap.SoapHeaderException if the header cannot be
+ * created
*/
SoapHeaderElement addUpgradeHeaderElement(java.lang.String[] supportedSoapUris);
/**
- * Returns an {@code Iterator} over all the {@link SoapHeaderElement header elements} that should be processed for the
- * given roles. Headers target to the "next" role will always be included, and those targeted to "none" will never be
- * included.
- *
+ * Returns an {@code Iterator} over all the {@link SoapHeaderElement header elements}
+ * that should be processed for the given roles. Headers target to the "next" role
+ * will always be included, and those targeted to "none" will never be included.
* @param roles an array of roles to search for
* @param isUltimateReceiver whether to search for headers for the ultimate receiver
* @return an iterator over all the header elements that contain the specified roles
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/soap/support/SoapUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/soap/support/SoapUtils.java
index 189055c4..15228da7 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/soap/support/SoapUtils.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/soap/support/SoapUtils.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,7 +34,8 @@ public abstract class SoapUtils {
private static final Pattern ACTION_PATTERN = Pattern.compile("action\\s*=\\s*([^;]+)");
- private SoapUtils() {}
+ private SoapUtils() {
+ }
/** Escapes the given SOAP action to be surrounded by quotes. */
public static String escapeAction(String soapAction) {
@@ -53,7 +54,6 @@ public abstract class SoapUtils {
/**
* Returns the value of the action parameter in the given SOAP 1.2 content type.
- *
* @param contentType the SOAP 1.2 content type
* @return the action
*/
@@ -69,8 +69,8 @@ public abstract class SoapUtils {
}
/**
- * Replaces or adds the value of the action parameter in the given SOAP 1.2 content type.
- *
+ * Replaces or adds the value of the action parameter in the given SOAP 1.2 content
+ * type.
* @param contentType the SOAP 1.2 content type
* @param action the action
* @return the new content type
@@ -86,11 +86,14 @@ public abstract class SoapUtils {
matcher.appendReplacement(builder, "action=" + action);
matcher.appendTail(builder);
return builder.toString();
- } else {
+ }
+ else {
return contentType + "; action=" + action;
}
- } else {
+ }
+ else {
return contentType;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingPayload.java b/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingPayload.java
index 3fee6037..70a7139e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingPayload.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingPayload.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,7 +21,8 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
/**
- * Defines the contract for payloads that can be written directly to a {@link XMLStreamWriter}.
+ * Defines the contract for payloads that can be written directly to a
+ * {@link XMLStreamWriter}.
*
* @author Arjen Poutsma
* @see StreamingWebServiceMessage
@@ -30,16 +31,15 @@ import javax.xml.stream.XMLStreamWriter;
public interface StreamingPayload {
/**
- * Returns the qualified name of the payload. Only the namespace URI and local part of the returned qualified name are
- * significant; they must match the name of the root element produced by {@link #writeTo(XMLStreamWriter)}.
- *
+ * Returns the qualified name of the payload. Only the namespace URI and local part of
+ * the returned qualified name are significant; they must match the name of the root
+ * element produced by {@link #writeTo(XMLStreamWriter)}.
* @return the qualified name
*/
QName getName();
/**
* Writes this payload to the given {@link XMLStreamWriter}.
- *
* @param streamWriter the stream writer to write to
* @throws XMLStreamException in case of errors
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingWebServiceMessage.java b/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingWebServiceMessage.java
index e9d73090..548eb5d5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingWebServiceMessage.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/stream/StreamingWebServiceMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,6 @@ public interface StreamingWebServiceMessage extends WebServiceMessage {
/**
* Sets the streaming payload for this message.
- *
* @param payload the streaming payload
*/
void setStreamingPayload(StreamingPayload payload);
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/support/DefaultStrategiesHelper.java b/spring-ws-core/src/main/java/org/springframework/ws/support/DefaultStrategiesHelper.java
index 31a039c4..e7d0981e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/support/DefaultStrategiesHelper.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/support/DefaultStrategiesHelper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,14 @@
package org.springframework.ws.support;
-import jakarta.servlet.ServletContext;
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
+import jakarta.servlet.ServletContext;
+
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
@@ -49,8 +49,9 @@ import org.springframework.web.context.ServletContextAware;
import org.springframework.web.context.WebApplicationContext;
/**
- * Helper class for for loading default implementations of an interface. Encapsulates a properties object, which
- * contains strategy interface names as keys, and comma-separated class names as values.
+ * Helper class for for loading default implementations of an interface. Encapsulates a
+ * properties object, which contains strategy interface names as keys, and comma-separated
+ * class names as values.
*
* Simulates the {@link BeanFactory normal lifecycle} for beans, by calling
* {@link BeanFactoryAware#setBeanFactory(BeanFactory)},
@@ -64,34 +65,42 @@ public class DefaultStrategiesHelper {
/** Keys are strategy interface names, values are implementation class names. */
private Properties defaultStrategies;
- /** Initializes a new instance of the {@code DefaultStrategiesHelper} based on the given set of properties. */
+ /**
+ * Initializes a new instance of the {@code DefaultStrategiesHelper} based on the
+ * given set of properties.
+ */
public DefaultStrategiesHelper(Properties defaultStrategies) {
Assert.notNull(defaultStrategies, "defaultStrategies must not be null");
this.defaultStrategies = defaultStrategies;
}
- /** Initializes a new instance of the {@code DefaultStrategiesHelper} based on the given resource. */
+ /**
+ * Initializes a new instance of the {@code DefaultStrategiesHelper} based on the
+ * given resource.
+ */
public DefaultStrategiesHelper(Resource resource) throws IllegalStateException {
try {
defaultStrategies = PropertiesLoaderUtils.loadProperties(resource);
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
throw new IllegalStateException("Could not load '" + resource + "': " + ex.getMessage());
}
}
/**
- * Initializes a new instance of the {@code DefaultStrategiesHelper} based on the given type.
+ * Initializes a new instance of the {@code DefaultStrategiesHelper} based on the
+ * given type.
*
- * This constructor will attempt to load a 'typeName'.properties file in the same package as the given type.
+ * This constructor will attempt to load a 'typeName'.properties file in the same
+ * package as the given type.
*/
public DefaultStrategiesHelper(Class> type) {
this(new ClassPathResource(ClassUtils.getShortName(type) + ".properties", type));
}
/**
- * Create a list of strategy objects for the given strategy interface. Strategies are retrieved from the
- * {@code Properties} object given at construction-time.
- *
+ * Create a list of strategy objects for the given strategy interface. Strategies are
+ * retrieved from the {@code Properties} object given at construction-time.
* @param strategyInterface the strategy interface
* @return a list of corresponding strategy objects
* @throws BeansException if initialization failed
@@ -101,12 +110,13 @@ public class DefaultStrategiesHelper {
}
/**
- * Create a list of strategy objects for the given strategy interface. Strategies are retrieved from the
- * {@code Properties} object given at construction-time. It instantiates the strategy objects and satisfies
- * {@code ApplicationContextAware} with the supplied context if necessary.
- *
+ * Create a list of strategy objects for the given strategy interface. Strategies are
+ * retrieved from the {@code Properties} object given at construction-time. It
+ * instantiates the strategy objects and satisfies {@code ApplicationContextAware}
+ * with the supplied context if necessary.
* @param strategyInterface the strategy interface
- * @param applicationContext used to satisfy strategies that are application context aware, may be {@code null}
+ * @param applicationContext used to satisfy strategies that are application context
+ * aware, may be {@code null}
* @return a list of corresponding strategy objects
* @throws BeansException if initialization failed
*/
@@ -120,7 +130,7 @@ public class DefaultStrategiesHelper {
return Collections.emptyList();
}
String[] classNames = StringUtils.commaDelimitedListToStringArray(value);
- List result = new ArrayList<>(classNames.length);
+ List result = new ArrayList<>(classNames.length);
ClassLoader classLoader = null;
if (applicationContext != null) {
classLoader = applicationContext.getClassLoader();
@@ -137,8 +147,10 @@ public class DefaultStrategiesHelper {
}
result.sort(new OrderComparator());
return result;
- } catch (ClassNotFoundException ex) {
- throw new BeanInitializationException("Could not find default strategy class for interface [" + key + "]", ex);
+ }
+ catch (ClassNotFoundException ex) {
+ throw new BeanInitializationException("Could not find default strategy class for interface [" + key + "]",
+ ex);
}
}
@@ -178,7 +190,8 @@ public class DefaultStrategiesHelper {
InitializingBean initializingBean = (InitializingBean) strategy;
try {
initializingBean.afterPropertiesSet();
- } catch (Throwable ex) {
+ }
+ catch (Throwable ex) {
throw new BeanCreationException("Invocation of init method failed", ex);
}
}
@@ -187,7 +200,6 @@ public class DefaultStrategiesHelper {
/**
* Return the default strategy object for the given strategy interface.
- *
* @param strategyInterface the strategy interface
* @return the corresponding strategy object
* @throws BeansException if initialization failed
@@ -200,10 +212,11 @@ public class DefaultStrategiesHelper {
/**
* Return the default strategy object for the given strategy interface.
*
- * Delegates to {@link #getDefaultStrategies(Class,ApplicationContext)}, expecting a single object in the list.
- *
+ * Delegates to {@link #getDefaultStrategies(Class,ApplicationContext)}, expecting a
+ * single object in the list.
* @param strategyInterface the strategy interface
- * @param applicationContext used to satisfy strategies that are application context aware, may be {@code null}
+ * @param applicationContext used to satisfy strategies that are application context
+ * aware, may be {@code null}
* @return the corresponding strategy object
* @throws BeansException if initialization failed
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java
index 01d486a1..0d79def6 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/support/MarshallingUtils.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,12 +16,12 @@
package org.springframework.ws.support;
-import jakarta.activation.DataHandler;
-
import java.io.IOException;
import javax.xml.transform.Source;
+import jakarta.activation.DataHandler;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.oxm.mime.MimeContainer;
@@ -39,14 +39,16 @@ import org.springframework.ws.mime.MimeMessage;
*/
public abstract class MarshallingUtils {
- private MarshallingUtils() {}
+ private MarshallingUtils() {
+ }
/**
- * Unmarshals the payload of the given message using the provided {@link Unmarshaller}.
+ * Unmarshals the payload of the given message using the provided
+ * {@link Unmarshaller}.
*
- * If the request message has no payload (i.e. {@link WebServiceMessage#getPayloadSource()} returns {@code null}),
- * this method will return {@code null}.
- *
+ * If the request message has no payload (i.e.
+ * {@link WebServiceMessage#getPayloadSource()} returns {@code null}), this method
+ * will return {@code null}.
* @param unmarshaller the unmarshaller
* @param message the message of which the payload is to be unmarshalled
* @return the unmarshalled object
@@ -56,18 +58,20 @@ public abstract class MarshallingUtils {
Source payload = message.getPayloadSource();
if (payload == null) {
return null;
- } else if (unmarshaller instanceof MimeUnmarshaller && message instanceof MimeMessage) {
+ }
+ else if (unmarshaller instanceof MimeUnmarshaller && message instanceof MimeMessage) {
MimeUnmarshaller mimeUnmarshaller = (MimeUnmarshaller) unmarshaller;
MimeMessageContainer container = new MimeMessageContainer((MimeMessage) message);
return mimeUnmarshaller.unmarshal(payload, container);
- } else {
+ }
+ else {
return unmarshaller.unmarshal(payload);
}
}
/**
- * Marshals the given object to the payload of the given message using the provided {@link Marshaller}.
- *
+ * Marshals the given object to the payload of the given message using the provided
+ * {@link Marshaller}.
* @param marshaller the marshaller
* @param graph the root of the object graph to marshal
* @param message the message of which the payload is to be unmarshalled
@@ -78,7 +82,8 @@ public abstract class MarshallingUtils {
MimeMarshaller mimeMarshaller = (MimeMarshaller) marshaller;
MimeMessageContainer container = new MimeMessageContainer((MimeMessage) message);
mimeMarshaller.marshal(graph, message.getPayloadResult(), container);
- } else {
+ }
+ else {
marshaller.marshal(graph, message.getPayloadResult());
}
}
@@ -111,6 +116,7 @@ public abstract class MarshallingUtils {
Attachment attachment = mimeMessage.getAttachment(contentId);
return attachment != null ? attachment.getDataHandler() : null;
}
+
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java
index 2b27b567..055e0452 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/support/WebUtils.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,9 @@
package org.springframework.ws.support;
/**
- * Miscellaneous utilities for web applications. Used by various framework classes. NOTE: These are the parts of
- * org.springframework.web.util.WebUtils deprecated in Spring Framework 5.
+ * Miscellaneous utilities for web applications. Used by various framework classes. NOTE:
+ * These are the parts of org.springframework.web.util.WebUtils deprecated in Spring
+ * Framework 5.
*
* @author Greg Turnquist
* @author Rod Johnson
@@ -28,9 +29,8 @@ package org.springframework.ws.support;
public abstract class WebUtils {
/**
- * Extract the URL filename from the given request URL path. Correctly resolves nested paths such as
- * "/products/view.html" as well.
- *
+ * Extract the URL filename from the given request URL path. Correctly resolves nested
+ * paths such as "/products/view.html" as well.
* @param urlPath the request URL path (e.g. "/index.html")
* @return the extracted URI filename (e.g. "index")
*/
@@ -44,9 +44,9 @@ public abstract class WebUtils {
}
/**
- * Extract the full URL filename (including file extension) from the given request URL path. Correctly resolve nested
- * paths such as "/products/view.html" and remove any path and or query parameters.
- *
+ * Extract the full URL filename (including file extension) from the given request URL
+ * path. Correctly resolve nested paths such as "/products/view.html" and remove any
+ * path and or query parameters.
* @param urlPath the request URL path (e.g. "/products/index.html")
* @return the extracted URI filename (e.g. "index.html")
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractReceiverConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractReceiverConnection.java
index f5cf04cd..07da5bf5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractReceiverConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractReceiverConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,7 +22,8 @@ import java.io.OutputStream;
import java.util.Iterator;
/**
- * Abstract base class for {@link WebServiceConnection} implementations used for receiving requests.
+ * Abstract base class for {@link WebServiceConnection} implementations used for receiving
+ * requests.
*
* @author Arjen Poutsma
* @author Greg Turnquist
@@ -53,11 +54,11 @@ public abstract class AbstractReceiverConnection extends AbstractWebServiceConne
/**
* Template method invoked from {@link #close()}. Default implementation is empty.
- *
* @throws IOException if an I/O error occurs when closing this connection
*/
@Override
- protected void onClose() throws IOException {}
+ protected void onClose() throws IOException {
+ }
/** Returns the input stream to read the response from. */
protected abstract InputStream getRequestInputStream() throws IOException;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractSenderConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractSenderConnection.java
index aee201b1..aadd217e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractSenderConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractSenderConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,7 +22,8 @@ import java.io.OutputStream;
import java.util.Iterator;
/**
- * Abstract base class for {@link WebServiceConnection} implementations used for sending requests.
+ * Abstract base class for {@link WebServiceConnection} implementations used for sending
+ * requests.
*
* @author Arjen Poutsma
* @author Greg Turnquist
@@ -50,18 +51,19 @@ public abstract class AbstractSenderConnection extends AbstractWebServiceConnect
responseInputStream = new ResponseTransportInputStream();
}
return responseInputStream;
- } else {
+ }
+ else {
return null;
}
}
/**
* Template method invoked from {@link #close()}. Default implementation is empty.
- *
* @throws IOException if an I/O error occurs when closing this connection
*/
@Override
- protected void onClose() throws IOException {}
+ protected void onClose() throws IOException {
+ }
/** Indicates whether this connection has a response. */
protected abstract boolean hasResponse() throws IOException;
@@ -84,6 +86,7 @@ public abstract class AbstractSenderConnection extends AbstractWebServiceConnect
protected OutputStream createOutputStream() throws IOException {
return getRequestOutputStream();
}
+
}
/** Implementation of {@link TransportInputStream} for client-side HTTP. */
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java
index f05dfbb6..1bdfedd8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/AbstractWebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -49,34 +49,34 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
}
/**
- * Called before the given message has been written to the {@code TransportOutputStream}. Called from
- * {@link #send(WebServiceMessage)}.
+ * Called before the given message has been written to the
+ * {@code TransportOutputStream}. Called from {@link #send(WebServiceMessage)}.
*
* Default implementation does nothing.
- *
* @param message the message
* @throws IOException when an I/O exception occurs
*/
- protected void onSendBeforeWrite(WebServiceMessage message) throws IOException {}
+ protected void onSendBeforeWrite(WebServiceMessage message) throws IOException {
+ }
/**
- * Returns a {@code TransportOutputStream} for the given message. Called from {@link #send(WebServiceMessage)}.
- *
+ * Returns a {@code TransportOutputStream} for the given message. Called from
+ * {@link #send(WebServiceMessage)}.
* @return the output stream
* @throws IOException when an I/O exception occurs
*/
protected abstract TransportOutputStream createTransportOutputStream() throws IOException;
/**
- * Called after the given message has been written to the {@code TransportOutputStream}. Called from
- * {@link #send(WebServiceMessage)}.
+ * Called after the given message has been written to the
+ * {@code TransportOutputStream}. Called from {@link #send(WebServiceMessage)}.
*
* Default implementation does nothing.
- *
* @param message the message
* @throws IOException when an I/O exception occurs
*/
- protected void onSendAfterWrite(WebServiceMessage message) throws IOException {}
+ protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
+ }
@Override
public final WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException {
@@ -92,33 +92,33 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
}
/**
- * Called before a message has been read from the {@code TransportInputStream}. Called from
- * {@link #receive(WebServiceMessageFactory)}.
+ * Called before a message has been read from the {@code TransportInputStream}. Called
+ * from {@link #receive(WebServiceMessageFactory)}.
*
* Default implementation does nothing.
- *
* @throws IOException when an I/O exception occurs
*/
- protected void onReceiveBeforeRead() throws IOException {}
+ protected void onReceiveBeforeRead() throws IOException {
+ }
/**
- * Returns a {@code TransportInputStream}. Called from {@link #receive(WebServiceMessageFactory)}.
- *
+ * Returns a {@code TransportInputStream}. Called from
+ * {@link #receive(WebServiceMessageFactory)}.
* @return the input stream, or {@code null} if no response can be read
* @throws IOException when an I/O exception occurs
*/
protected abstract TransportInputStream createTransportInputStream() throws IOException;
/**
- * Called when the given message has been read from the {@code TransportInputStream}. Called from
- * {@link #receive(WebServiceMessageFactory)}.
+ * Called when the given message has been read from the {@code TransportInputStream}.
+ * Called from {@link #receive(WebServiceMessageFactory)}.
*
* Default implementation does nothing.
- *
* @param message the message
* @throws IOException when an I/O exception occurs
*/
- protected void onReceiveAfterRead(WebServiceMessage message) throws IOException {}
+ protected void onReceiveAfterRead(WebServiceMessage message) throws IOException {
+ }
@Override
public final void close() throws IOException {
@@ -126,14 +126,16 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
if (tis != null) {
try {
tis.close();
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
ioex = ex;
}
}
if (tos != null) {
try {
tos.close();
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
ioex = ex;
}
}
@@ -152,9 +154,9 @@ public abstract class AbstractWebServiceConnection implements WebServiceConnecti
/**
* Template method invoked from {@link #close()}. Default implementation is empty.
- *
* @throws IOException if an I/O error occurs when closing this connection
*/
- protected void onClose() throws IOException {}
+ protected void onClose() throws IOException {
+ }
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/EndpointAwareWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/EndpointAwareWebServiceConnection.java
index e22c6176..3d1d24ca 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/EndpointAwareWebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/EndpointAwareWebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,8 +19,9 @@ package org.springframework.ws.transport;
import org.springframework.ws.NoEndpointFoundException;
/**
- * Sub-interface of {@link WebServiceConnection} that is aware of any server-side situations where an endpoint is not
- * found. Typically, this results in a special error codes.
+ * Sub-interface of {@link WebServiceConnection} that is aware of any server-side
+ * situations where an endpoint is not found. Typically, this results in a special error
+ * codes.
*
* @author Arjen Poutsma
* @see NoEndpointFoundException
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/FaultAwareWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/FaultAwareWebServiceConnection.java
index 283915f6..dff387a3 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/FaultAwareWebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/FaultAwareWebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,9 +23,10 @@ import javax.xml.namespace.QName;
import org.springframework.ws.soap.SoapFault;
/**
- * Sub-interface of {@link WebServiceConnection} that is aware of any Fault messages received. Fault messages (such as
- * {@link SoapFault} SOAP Faults) often require different processing rules. Typically, fault detection is done by
- * inspecting connection error codes, etc.
+ * Sub-interface of {@link WebServiceConnection} that is aware of any Fault messages
+ * received. Fault messages (such as {@link SoapFault} SOAP Faults) often require
+ * different processing rules. Typically, fault detection is done by inspecting connection
+ * error codes, etc.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -36,7 +37,6 @@ public interface FaultAwareWebServiceConnection extends WebServiceConnection {
* Indicates whether this connection received a fault.
*
* Typically implemented by looking at an HTTP status code.
- *
* @return {@code true} if this connection received a fault; {@code false} otherwise.
* @throws IOException in case of I/O errors
*/
@@ -46,7 +46,6 @@ public interface FaultAwareWebServiceConnection extends WebServiceConnection {
* Sets whether this connection will send a fault.
*
* Typically implemented by setting an HTTP status code.
- *
* @param fault {@code true} if this will send a fault; {@code false} otherwise.
* @throws IOException in case of I/O errors
* @deprecated In favor of {@link #setFaultCode(QName)}
@@ -58,9 +57,10 @@ public interface FaultAwareWebServiceConnection extends WebServiceConnection {
* Sets a specific fault code.
*
* Typically implemented by setting an HTTP status code.
- *
- * @param faultCode the fault code to be set on the connection, or {@code null} for no fault.
+ * @param faultCode the fault code to be set on the connection, or {@code null} for no
+ * fault.
* @throws IOException in case of I/O errors
*/
void setFaultCode(QName faultCode) throws IOException;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareReceiverWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareReceiverWebServiceConnection.java
index bc7ecb3f..5294071b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareReceiverWebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareReceiverWebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,7 +19,8 @@ import java.io.IOException;
import java.util.Iterator;
/**
- * Interface to define access to header information for certain {@link WebServiceConnection} implementations.
+ * Interface to define access to header information for certain
+ * {@link WebServiceConnection} implementations.
*
* @author Greg Turnquist
* @since 2.3
@@ -27,21 +28,20 @@ import java.util.Iterator;
public interface HeadersAwareReceiverWebServiceConnection {
/**
- * Returns an iteration over all the header names this request contains. Returns an empty {@code Iterator} if there
- * are no headers.
+ * Returns an iteration over all the header names this request contains. Returns an
+ * empty {@code Iterator} if there are no headers.
*/
Iterator getRequestHeaderNames() throws IOException;
/**
- * Returns an iteration over all the string values of the specified header. Returns an empty {@code Iterator} if there
- * are no headers of the specified name.
+ * Returns an iteration over all the string values of the specified header. Returns an
+ * empty {@code Iterator} if there are no headers of the specified name.
*/
Iterator getRequestHeaders(String name) throws IOException;
/**
- * Adds a response header with the given name and value. This method can be called multiple times, to allow for
- * headers with multiple values.
- *
+ * Adds a response header with the given name and value. This method can be called
+ * multiple times, to allow for headers with multiple values.
* @param name the name of the header
* @param value the value of the header
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareSenderWebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareSenderWebServiceConnection.java
index 954dceb3..e088fbd1 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareSenderWebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/HeadersAwareSenderWebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,21 +25,20 @@ import java.util.Iterator;
public interface HeadersAwareSenderWebServiceConnection {
/**
- * Returns an iteration over all the header names this request contains. Returns an empty {@code Iterator} if there
- * are no headers.
+ * Returns an iteration over all the header names this request contains. Returns an
+ * empty {@code Iterator} if there are no headers.
*/
Iterator getResponseHeaderNames() throws IOException;
/**
- * Returns an iteration over all the string values of the specified header. Returns an empty {@code Iterator} if there
- * are no headers of the specified name.
+ * Returns an iteration over all the string values of the specified header. Returns an
+ * empty {@code Iterator} if there are no headers of the specified name.
*/
Iterator getResponseHeaders(String name) throws IOException;
/**
- * Adds a request header with the given name and value. This method can be called multiple times, to allow for headers
- * with multiple values.
- *
+ * Adds a request header with the given name and value. This method can be called
+ * multiple times, to allow for headers with multiple values.
* @param name the name of the header
* @param value the value of the header
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportConstants.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportConstants.java
index 538f950e..122106c4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportConstants.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportConstants.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,4 +50,5 @@ public interface TransportConstants {
/** The empty SOAP action value. */
String EMPTY_SOAP_ACTION = "\"\"";
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportInputStream.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportInputStream.java
index f311b469..6153675c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportInputStream.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportInputStream.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,8 +23,9 @@ import java.util.Iterator;
import org.springframework.util.Assert;
/**
- * A {@code TransportInputStream} is an input stream with MIME input headers. It is used to construct
- * {@link org.springframework.ws.WebServiceMessage WebServiceMessages} from a transport.
+ * A {@code TransportInputStream} is an input stream with MIME input headers. It is used
+ * to construct {@link org.springframework.ws.WebServiceMessage WebServiceMessages} from a
+ * transport.
*
* @author Arjen Poutsma
* @see #getHeaderNames()
@@ -35,7 +36,8 @@ public abstract class TransportInputStream extends InputStream {
private InputStream inputStream;
- protected TransportInputStream() {}
+ protected TransportInputStream() {
+ }
private InputStream getInputStream() throws IOException {
if (inputStream == null) {
@@ -61,7 +63,8 @@ public abstract class TransportInputStream extends InputStream {
public synchronized void mark(int readlimit) {
try {
getInputStream().mark(readlimit);
- } catch (IOException e) {
+ }
+ catch (IOException e) {
// ignored
}
}
@@ -70,7 +73,8 @@ public abstract class TransportInputStream extends InputStream {
public boolean markSupported() {
try {
return getInputStream().markSupported();
- } catch (IOException e) {
+ }
+ catch (IOException e) {
return false;
}
}
@@ -104,14 +108,15 @@ public abstract class TransportInputStream extends InputStream {
protected abstract InputStream createInputStream() throws IOException;
/**
- * Returns an iteration over all the header names this stream contains. Returns an empty {@code Iterator} if there are
- * no headers.
+ * Returns an iteration over all the header names this stream contains. Returns an
+ * empty {@code Iterator} if there are no headers.
*/
public abstract Iterator getHeaderNames() throws IOException;
/**
- * Returns an iteration over all the string values of the specified header. Returns an empty {@code Iterator} if there
- * are no headers of the specified name.
+ * Returns an iteration over all the string values of the specified header. Returns an
+ * empty {@code Iterator} if there are no headers of the specified name.
*/
public abstract Iterator getHeaders(String name) throws IOException;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportOutputStream.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportOutputStream.java
index 1bb975d1..e930a05c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportOutputStream.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/TransportOutputStream.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,8 +22,9 @@ import java.io.OutputStream;
import org.springframework.util.Assert;
/**
- * A {@code TransportOutputStream} is an output stream with MIME input headers. It is used to write
- * {@link org.springframework.ws.WebServiceMessage WebServiceMessages} to a transport.
+ * A {@code TransportOutputStream} is an output stream with MIME input headers. It is used
+ * to write {@link org.springframework.ws.WebServiceMessage WebServiceMessages} to a
+ * transport.
*
* @author Arjen Poutsma
* @see #addHeader(String,String)
@@ -33,7 +34,8 @@ public abstract class TransportOutputStream extends OutputStream {
private OutputStream outputStream;
- protected TransportOutputStream() {}
+ protected TransportOutputStream() {
+ }
private OutputStream getOutputStream() throws IOException {
if (outputStream == null) {
@@ -73,9 +75,8 @@ public abstract class TransportOutputStream extends OutputStream {
}
/**
- * Adds a header with the given name and value. This method can be called multiple times, to allow for headers with
- * multiple values.
- *
+ * Adds a header with the given name and value. This method can be called multiple
+ * times, to allow for headers with multiple values.
* @param name the name of the header
* @param value the value of the header
*/
@@ -83,4 +84,5 @@ public abstract class TransportOutputStream extends OutputStream {
/** Returns the output stream to write to. */
protected abstract OutputStream createOutputStream() throws IOException;
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceConnection.java
index 6f6629e5..fcf6f85a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,8 +24,8 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
/**
- * Represents a point-to-point connection that a client can use for sending {@link WebServiceMessage} objects directly
- * to a remote party.
+ * Represents a point-to-point connection that a client can use for sending
+ * {@link WebServiceMessage} objects directly to a remote party.
*
* A {@code WebServiceConnection} can be obtained using a {@link WebServiceMessageSender}.
*
@@ -37,16 +37,14 @@ public interface WebServiceConnection extends AutoCloseable {
/**
* Sends the given message using this connection.
- *
* @param message the message to be sent
* @throws IOException in case of I/O errors
*/
void send(WebServiceMessage message) throws IOException;
/**
- * Receives a message using the given {@link WebServiceMessageFactory}. This method blocks until it receives, or
- * returns {@code null} when no message is received.
- *
+ * Receives a message using the given {@link WebServiceMessageFactory}. This method
+ * blocks until it receives, or returns {@code null} when no message is received.
* @param messageFactory the message factory used for reading messages
* @return the read message, or {@code null} if no message received
* @throws IOException in case of I/O errors
@@ -57,17 +55,16 @@ public interface WebServiceConnection extends AutoCloseable {
URI getUri() throws URISyntaxException;
/**
- * Indicates whether this connection has an error. Typically, error detection is done by inspecting connection error
- * codes, etc.
- *
+ * Indicates whether this connection has an error. Typically, error detection is done
+ * by inspecting connection error codes, etc.
* @return {@code true} if this connection has an error; {@code false} otherwise.
*/
boolean hasError() throws IOException;
/**
* Returns the error message.
- *
- * @return the connection error message, if any; returns {@code null} when no error is present
+ * @return the connection error message, if any; returns {@code null} when no error is
+ * present
* @see #hasError()
*/
String getErrorMessage() throws IOException;
@@ -75,8 +72,8 @@ public interface WebServiceConnection extends AutoCloseable {
/**
* Closes this connection.
*
- * Once a connection has been closed, it is not available for further use. A new connection needs to be created.
- *
+ * Once a connection has been closed, it is not available for further use. A new
+ * connection needs to be created.
* @throws IOException if an I/O error occurs when closing this connection
*/
void close() throws IOException;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageReceiver.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageReceiver.java
index d0f7e420..7d83481e 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageReceiver.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageReceiver.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,8 +19,8 @@ package org.springframework.ws.transport;
import org.springframework.ws.context.MessageContext;
/**
- * Defines the methods for classes capable of receiving {@link org.springframework.ws.WebServiceMessage} instances
- * coming in on a transport.
+ * Defines the methods for classes capable of receiving
+ * {@link org.springframework.ws.WebServiceMessage} instances coming in on a transport.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -28,8 +28,8 @@ import org.springframework.ws.context.MessageContext;
public interface WebServiceMessageReceiver {
/**
- * Receives the given message context. The given message context can be used to create a response.
- *
+ * Receives the given message context. The given message context can be used to create
+ * a response.
* @param messageContext the message context to be received
*/
void receive(MessageContext messageContext) throws Exception;
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageSender.java
index e11bf323..5a306a99 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/WebServiceMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,10 +22,11 @@ import java.net.URI;
import org.springframework.ws.WebServiceMessage;
/**
- * Defines the methods for classes capable of sending and receiving {@link WebServiceMessage} instances across a
- * transport.
+ * Defines the methods for classes capable of sending and receiving
+ * {@link WebServiceMessage} instances across a transport.
*
- * The {@code WebServiceMessageSender} is basically a factory for {@link WebServiceConnection} objects.
+ * The {@code WebServiceMessageSender} is basically a factory for
+ * {@link WebServiceConnection} objects.
*
* @author Arjen Poutsma
* @see WebServiceConnection
@@ -35,7 +36,6 @@ public interface WebServiceMessageSender {
/**
* Create a new {@link WebServiceConnection} to the specified URI.
- *
* @param uri the URI to open a connection to
* @return the new connection
* @throws IOException in case of I/O errors
@@ -44,9 +44,9 @@ public interface WebServiceMessageSender {
/**
* Does this {@link WebServiceMessageSender} support the supplied URI?
- *
* @param uri the URI to be checked
- * @return {@code true} if this {@code WebServiceMessageSender} supports the supplied URI
+ * @return {@code true} if this {@code WebServiceMessageSender} supports the supplied
+ * URI
*/
boolean supports(URI uri);
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java
index 739541e5..085e4705 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/DefaultTransportContext.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,7 +29,9 @@ public class DefaultTransportContext implements TransportContext {
private final WebServiceConnection connection;
- /** Creates a new {@code DefaultTransportContext} that exposes the given connection. */
+ /**
+ * Creates a new {@code DefaultTransportContext} that exposes the given connection.
+ */
public DefaultTransportContext(WebServiceConnection connection) {
Assert.notNull(connection, "'connection' must not be null");
this.connection = connection;
@@ -43,4 +45,5 @@ public class DefaultTransportContext implements TransportContext {
public String toString() {
return connection.toString();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContext.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContext.java
index 2f62990f..02ffc75c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContext.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContext.java
@@ -1,11 +1,29 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.transport.context;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Strategy interface for determining the current {@link org.springframework.ws.transport.WebServiceConnection}.
+ * Strategy interface for determining the current
+ * {@link org.springframework.ws.transport.WebServiceConnection}.
*
- * An instance of this class can be associated with a thread via the {@link TransportContextHolder} class.
+ * An instance of this class can be associated with a thread via the
+ * {@link TransportContextHolder} class.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -14,4 +32,5 @@ public interface TransportContext {
/** Returns the current {@code WebServiceConnection}. */
WebServiceConnection getConnection();
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContextHolder.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContextHolder.java
index 6c75d5cd..ca5f3d16 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContextHolder.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/context/TransportContextHolder.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,8 +17,9 @@
package org.springframework.ws.transport.context;
/**
- * Simple holder class that associates a {@code TransportContext} instance with the current thread. The
- * {@code TransportContext} will be inherited by any child threads spawned by the current thread.
+ * Simple holder class that associates a {@code TransportContext} instance with the
+ * current thread. The {@code TransportContext} will be inherited by any child threads
+ * spawned by the current thread.
*
* @author Arjen Poutsma
* @see TransportContext
@@ -30,8 +31,8 @@ public abstract class TransportContextHolder {
/**
* Associate the given {@code TransportContext} with the current thread.
- *
- * @param transportContext the current transport context, or {@code null} to reset the thread-bound context
+ * @param transportContext the current transport context, or {@code null} to reset the
+ * thread-bound context
*/
public static void setTransportContext(TransportContext transportContext) {
transportContextHolder.set(transportContext);
@@ -39,7 +40,6 @@ public abstract class TransportContextHolder {
/**
* Return the {@code TransportContext} associated with the current thread, if any.
- *
* @return the current transport context, or {@code null} if none
*/
public static TransportContext getTransportContext() {
@@ -51,5 +51,7 @@ public abstract class TransportContextHolder {
public String toString() {
return "Transport State";
}
+
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java
index 8c48812e..6fa386cc 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpSenderConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,7 +30,8 @@ import org.springframework.ws.transport.FaultAwareWebServiceConnection;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Abstract base class for {@link WebServiceConnection} implementations that send request over HTTP.
+ * Abstract base class for {@link WebServiceConnection} implementations that send request
+ * over HTTP.
*
* @author Arjen Poutsma
* @author Andreas Veithen
@@ -45,7 +46,8 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
private Boolean hasResponse;
/**
- * The raw response input stream to use instead of calling {@link #getRawResponseInputStream()}.
+ * The raw response input stream to use instead of calling
+ * {@link #getRawResponseInputStream()}.
*/
private PushbackInputStream rawResponseInputStream;
@@ -86,11 +88,13 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
int b = rawResponseInputStream.read();
if (b == -1) {
hasResponse = Boolean.FALSE;
- } else {
+ }
+ else {
hasResponse = Boolean.TRUE;
rawResponseInputStream.unread(b);
}
- } else {
+ }
+ else {
hasResponse = contentLength > 0;
}
return hasResponse;
@@ -134,7 +138,8 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
@Override
public final boolean hasFault() throws IOException {
// SOAP 1.1 specifies a 500 status code for faults
- // SOAP 1.2 specifies a 400 status code for sender faults, and 500 for all other faults
+ // SOAP 1.2 specifies a 400 status code for sender faults, and 500 for all other
+ // faults
switch (getResponseCode()) {
case HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR:
return isSoap11Response() || isSoap12Response();
@@ -167,8 +172,11 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
@Override
@Deprecated
- public final void setFault(boolean fault) {}
+ public final void setFault(boolean fault) {
+ }
@Override
- public final void setFaultCode(QName faultCode) throws IOException {}
+ public final void setFaultCode(QName faultCode) throws IOException {
+ }
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java
index a4c3aa57..1e6ff18d 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/AbstractHttpWebServiceMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,11 +20,13 @@ import java.net.URI;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.ws.transport.WebServiceMessageSender;
/**
- * Abstract base class for {@link org.springframework.ws.transport.WebServiceMessageSender} implementations that use
- * HTTP.
+ * Abstract base class for
+ * {@link org.springframework.ws.transport.WebServiceMessageSender} implementations that
+ * use HTTP.
*
* @author Arjen Poutsma
* @since 1.0.0
@@ -39,19 +41,19 @@ public abstract class AbstractHttpWebServiceMessageSender implements WebServiceM
private boolean acceptGzipEncoding = true;
/**
- * Return whether to accept GZIP encoding, that is, whether to send the HTTP {@code Accept-Encoding} header with
- * {@code gzip} as value.
+ * Return whether to accept GZIP encoding, that is, whether to send the HTTP
+ * {@code Accept-Encoding} header with {@code gzip} as value.
*/
public boolean isAcceptGzipEncoding() {
return acceptGzipEncoding;
}
/**
- * Set whether to accept GZIP encoding, that is, whether to send the HTTP {@code Accept-Encoding} header with
- * {@code gzip} as value.
+ * Set whether to accept GZIP encoding, that is, whether to send the HTTP
+ * {@code Accept-Encoding} header with {@code gzip} as value.
*
- * Default is {@code true}. Turn this flag off if you do not want GZIP response compression even if enabled on the
- * HTTP server.
+ * Default is {@code true}. Turn this flag off if you do not want GZIP response
+ * compression even if enabled on the HTTP server.
*/
public void setAcceptGzipEncoding(boolean acceptGzipEncoding) {
this.acceptGzipEncoding = acceptGzipEncoding;
@@ -62,4 +64,5 @@ public abstract class AbstractHttpWebServiceMessageSender implements WebServiceM
return uri.getScheme().equals(HttpTransportConstants.HTTP_URI_SCHEME)
|| uri.getScheme().equals(HttpTransportConstants.HTTPS_URI_SCHEME);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java
index d96f2d0c..ab240afe 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,8 +32,8 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Implementation of the {@link WebServiceConnection} interface that is based on the Spring 3 {@link ClientHttpRequest}
- * and {@link ClientHttpResponse}.
+ * Implementation of the {@link WebServiceConnection} interface that is based on the
+ * Spring 3 {@link ClientHttpRequest} and {@link ClientHttpResponse}.
*
* @author Krzysztof Trojan
* @author Arjen Poutsma
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java
index 2c53799f..a73a5099 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/ClientHttpRequestMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,7 +27,8 @@ import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * {@code WebServiceMessageSender} implementation based on the {@link ClientHttpRequestFactory} introduced in Spring 3.
+ * {@code WebServiceMessageSender} implementation based on the
+ * {@link ClientHttpRequestFactory} introduced in Spring 3.
*
* @author Krzysztof Trojan
* @author Arjen Poutsma
@@ -58,9 +59,10 @@ public class ClientHttpRequestMessageSender extends AbstractHttpWebServiceMessag
public WebServiceConnection createConnection(URI uri) throws IOException {
ClientHttpRequest request = requestFactory.createRequest(uri, HttpMethod.POST);
if (isAcceptGzipEncoding()) {
- request.getHeaders().add(HttpTransportConstants.HEADER_ACCEPT_ENCODING,
- HttpTransportConstants.CONTENT_ENCODING_GZIP);
+ request.getHeaders()
+ .add(HttpTransportConstants.HEADER_ACCEPT_ENCODING, HttpTransportConstants.CONTENT_ENCODING_GZIP);
}
return new ClientHttpRequestConnection(request);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java
index 6ace8061..5786a931 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,13 +31,14 @@ import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
+
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Implementation of {@link WebServiceConnection} that is based on Jakarta Commons HttpClient. Exposes a
- * {@link PostMethod}.
+ * Implementation of {@link WebServiceConnection} that is based on Jakarta Commons
+ * HttpClient. Exposes a {@link PostMethod}.
*
* @author Arjen Poutsma
* @author Greg Turnquist
@@ -82,7 +83,8 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
public URI getUri() throws URISyntaxException {
try {
return new URI(postMethod.getURI().toString());
- } catch (URIException ex) {
+ }
+ catch (URIException ex) {
throw new URISyntaxException("", ex.getMessage());
}
}
@@ -112,14 +114,17 @@ public class CommonsHttpConnection extends AbstractHttpSenderConnection {
requestBuffer = null;
try {
httpClient.executeMethod(postMethod);
- } catch (IllegalStateException ex) {
+ }
+ catch (IllegalStateException ex) {
if ("Connection factory has been shutdown.".equals(ex.getMessage())) {
- // The application context has been closed, resulting in a connection factory shutdown and an ISE.
+ // The application context has been closed, resulting in a connection
+ // factory shutdown and an ISE.
// Let's create a new connection factory for this connection only.
connectionManager = new MultiThreadedHttpConnectionManager();
httpClient.setHttpConnectionManager(connectionManager);
httpClient.executeMethod(postMethod);
- } else {
+ }
+ else {
throw ex;
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java
index f2850601..0e5d0b8a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/CommonsHttpMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,6 +32,7 @@ import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.PostMethod;
+
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
@@ -39,11 +40,12 @@ import org.springframework.ws.transport.WebServiceConnection;
/**
* {@code WebServiceMessageSender} implementation that uses
- * Jakarta Commons HttpClient to execute POST requests.
+ * Jakarta Commons HttpClient
+ * to execute POST requests.
*
- * Allows to use a preconfigured HttpClient instance, potentially with authentication, HTTP connection pooling, etc.
- * Authentication can also be set by injecting a {@link Credentials} instance (such as the
- * {@link UsernamePasswordCredentials}).
+ * Allows to use a preconfigured HttpClient instance, potentially with authentication,
+ * HTTP connection pooling, etc. Authentication can also be set by injecting a
+ * {@link Credentials} instance (such as the {@link UsernamePasswordCredentials}).
*
* @author Arjen Poutsma
* @see HttpUrlConnectionMessageSender
@@ -67,8 +69,8 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
private AuthScope authScope;
/**
- * Create a new instance of the {@code CommonsHttpMessageSender} with a default {@link HttpClient} that uses a default
- * {@link MultiThreadedHttpConnectionManager}.
+ * Create a new instance of the {@code CommonsHttpMessageSender} with a default
+ * {@link HttpClient} that uses a default {@link MultiThreadedHttpConnectionManager}.
*/
public CommonsHttpMessageSender() {
httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
@@ -77,8 +79,8 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
/**
- * Create a new instance of the {@code CommonsHttpMessageSender} with the given {@link HttpClient} instance.
- *
+ * Create a new instance of the {@code CommonsHttpMessageSender} with the given
+ * {@link HttpClient} instance.
* @param httpClient the HttpClient instance to use for this sender
*/
public CommonsHttpMessageSender(HttpClient httpClient) {
@@ -103,7 +105,6 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
/**
* Sets the credentials to be used. If not set, no authentication is done.
- *
* @see UsernamePasswordCredentials
* @see NTCredentials
*/
@@ -112,8 +113,8 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
/**
- * Sets the timeout until a connection is etablished. A value of 0 means never timeout.
- *
+ * Sets the timeout until a connection is etablished. A value of 0 means
+ * never timeout.
* @param timeout the timeout value in milliseconds
* @see org.apache.commons.httpclient.params.HttpConnectionManagerParams#setConnectionTimeout(int)
*/
@@ -125,8 +126,8 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
/**
- * Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.
- *
+ * Set the socket read timeout for the underlying HttpClient. A value of 0 means
+ * never timeout.
* @param timeout the timeout value in milliseconds
* @see org.apache.commons.httpclient.params.HttpConnectionManagerParams#setSoTimeout(int)
*/
@@ -139,7 +140,6 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
/**
* Sets the maximum number of connections allowed for the underlying HttpClient.
- *
* @param maxTotalConnections the maximum number of connections allowed
* @see org.apache.commons.httpclient.params.HttpConnectionManagerParams#setMaxTotalConnections(int)
*/
@@ -151,8 +151,9 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
/**
- * Sets the maximum number of connections per host for the underlying HttpClient. The maximum number of connections
- * per host can be set in a form accepted by the {@code java.util.Properties} class, like as follows:
+ * Sets the maximum number of connections per host for the underlying HttpClient. The
+ * maximum number of connections per host can be set in a form accepted by the
+ * {@code java.util.Properties} class, like as follows:
*
*
* https://www.example.com=1
@@ -161,35 +162,41 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
* *=5
*
*
- * The host can be specified as hostname, or as URI (with scheme and port). The special host name {@code *} can be
- * used to specify {@link org.apache.commons.httpclient.HostConfiguration#ANY_HOST_CONFIGURATION}.
- *
- * @param maxConnectionsPerHost a properties object specifying the maximum number of connection
+ * The host can be specified as hostname, or as URI (with scheme and port). The
+ * special host name {@code *} can be used to specify
+ * {@link org.apache.commons.httpclient.HostConfiguration#ANY_HOST_CONFIGURATION}.
+ * @param maxConnectionsPerHost a properties object specifying the maximum number of
+ * connection
* @see org.apache.commons.httpclient.params.HttpConnectionManagerParams#setMaxConnectionsPerHost(org.apache.commons.httpclient.HostConfiguration,
- * int)
+ * int)
*/
public void setMaxConnectionsPerHost(Map maxConnectionsPerHost) throws URIException {
for (String host : maxConnectionsPerHost.keySet()) {
HostConfiguration hostConfiguration = new HostConfiguration();
if ("*".equals(host)) {
hostConfiguration = HostConfiguration.ANY_HOST_CONFIGURATION;
- } else if (host.startsWith("http://")) {
+ }
+ else if (host.startsWith("http://")) {
HttpURL httpURL = new HttpURL(host);
hostConfiguration.setHost(httpURL);
- } else if (host.startsWith("https://")) {
+ }
+ else if (host.startsWith("https://")) {
HttpsURL httpsURL = new HttpsURL(host);
hostConfiguration.setHost(httpsURL);
- } else {
+ }
+ else {
hostConfiguration.setHost(host);
}
int maxHostConnections = Integer.parseInt(maxConnectionsPerHost.get(host));
- getHttpClient().getHttpConnectionManager().getParams().setMaxConnectionsPerHost(hostConfiguration,
- maxHostConnections);
+ getHttpClient().getHttpConnectionManager()
+ .getParams()
+ .setMaxConnectionsPerHost(hostConfiguration, maxHostConnections);
}
}
/**
- * Returns the authentication scope to be used. Only used when the {@code credentials} property has been set.
+ * Returns the authentication scope to be used. Only used when the {@code credentials}
+ * property has been set.
*
* By default, the {@link AuthScope#ANY} is returned.
*/
@@ -198,10 +205,10 @@ public class CommonsHttpMessageSender extends AbstractHttpWebServiceMessageSende
}
/**
- * Sets the authentication scope to be used. Only used when the {@code credentials} property has been set.
+ * Sets the authentication scope to be used. Only used when the {@code credentials}
+ * property has been set.
*
* By default, the {@link AuthScope#ANY} is used.
- *
* @see #setCredentials(Credentials)
*/
public void setAuthScope(AuthScope authScope) {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5ClientFactory.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5ClientFactory.java
index 7d23dc1d..3c790c7b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5ClientFactory.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5ClientFactory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2023 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -32,11 +32,13 @@ import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.util.Timeout;
+
import org.springframework.beans.factory.FactoryBean;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
/**
- * {@link FactoryBean} to set up a {@link CloseableHttpClient} using HttpComponents HttpClient 5.
+ * {@link FactoryBean} to set up a {@link CloseableHttpClient} using HttpComponents
+ * HttpClient 5.
*
* @see http://hc.apache.org/httpcomponents-client
* @author Lars Uffmann
@@ -47,10 +49,9 @@ public class HttpComponents5ClientFactory implements FactoryBean
- * NOTE: {@code ANY} was removed from {@link AuthScope} in HttpComponents 5.0. This value object will easy
- * migration from HttpComponents 4. Consider using a {@link ClientInterceptor} to implement http client agnostic
- * preemptive basic auth.
- *
+ * NOTE: {@code ANY} was removed from {@link AuthScope} in HttpComponents 5.0.
+ * This value object will easy migration from HttpComponents 4. Consider using a
+ * {@link ClientInterceptor} to implement http client agnostic preemptive basic auth.
* @see AuthScope#AuthScope(String, String, int, String, String)
*/
public static final AuthScope ANY = new AuthScope(null, null, -1, null, null);
@@ -79,7 +80,6 @@ public class HttpComponents5ClientFactory implements FactoryBean
* By default, {@link #ANY} is used.
- *
* @see #setCredentials(Credentials)
*/
public void setAuthScope(AuthScope authScope) {
@@ -99,8 +99,8 @@ public class HttpComponents5ClientFactory implements FactoryBeannever timeout.
- *
+ * Sets the timeout until a connection is established. A value of 0 means
+ * never timeout.
* @param timeout the timeout value
*/
public void setConnectionTimeout(Duration timeout) {
@@ -113,8 +113,8 @@ public class HttpComponents5ClientFactory implements FactoryBeannever timeout.
- *
+ * Set the socket read timeout for the underlying HttpClient. A value of 0 means
+ * never timeout.
* @param timeout the timeout value
*/
public void setReadTimeout(Duration timeout) {
@@ -128,7 +128,6 @@ public class HttpComponents5ClientFactory implements FactoryBean
* https://www.example.com=1
@@ -152,8 +152,8 @@ public class HttpComponents5ClientFactory implements FactoryBean
*
* The host can be specified as a URI (with scheme and port).
- *
- * @param maxConnectionsPerHost a properties object specifying the maximum number of connection
+ * @param maxConnectionsPerHost a properties object specifying the maximum number of
+ * connection
* @see PoolingHttpClientConnectionManager...
*/
public void setMaxConnectionsPerHost(Map maxConnectionsPerHost) {
@@ -170,7 +170,8 @@ public class HttpComponents5ClientFactory implements FactoryBean getResponseHeaderNames() throws IOException {
return Arrays.stream(httpResponse.getHeaders()) //
- .map(NameValuePair::getName) //
- .iterator();
+ .map(NameValuePair::getName) //
+ .iterator();
}
@Override
public Iterator getResponseHeaders(String name) throws IOException {
return Arrays.stream(httpResponse.getHeaders(name)) //
- .map(NameValuePair::getValue) //
- .iterator();
+ .map(NameValuePair::getValue) //
+ .iterator();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5MessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5MessageSender.java
index d0b96838..8c748174 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5MessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponents5MessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2023 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -41,11 +41,13 @@ import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * {@code WebServiceMessageSender} implementation that uses Apache
- * HttpClient to execute POST requests.
+ * {@code WebServiceMessageSender} implementation that uses
+ * Apache HttpClient to execute
+ * POST requests.
*
- * Allows to use a pre-configured HttpClient instance, potentially with authentication, HTTP connection pooling, etc.
- * Authentication can also be set by injecting a {@link Credentials} instance (such as the
+ * Allows to use a pre-configured HttpClient instance, potentially with authentication,
+ * HTTP connection pooling, etc. Authentication can also be set by injecting a
+ * {@link Credentials} instance (such as the
* {@link org.apache.hc.client5.http.auth.UsernamePasswordCredentials}).
*
* @author Alan Stewart
@@ -66,8 +68,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
private HttpComponents5ClientFactory clientFactory;
/**
- * Create a new instance of the {@code HttpClientMessageSender} with a default {@link HttpClient} that uses a default
- * {@link PoolingHttpClientConnectionManager}.
+ * Create a new instance of the {@code HttpClientMessageSender} with a default
+ * {@link HttpClient} that uses a default {@link PoolingHttpClientConnectionManager}.
*/
public HttpComponents5MessageSender() {
@@ -77,12 +79,13 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
}
/**
- * Create a new instance of the {@link HttpComponents5MessageSender} with the given {@link HttpClient} instance.
+ * Create a new instance of the {@link HttpComponents5MessageSender} with the given
+ * {@link HttpClient} instance.
*
- * This constructor does not change the given {@code HttpClient} in any way. As such, it does not set timeouts, nor
- * does it {@linkplain HttpClientBuilder#addRequestInterceptorFirst(HttpRequestInterceptor) add} the
- * {@link RemoveSoapHeadersInterceptor}.
- *
+ * This constructor does not change the given {@code HttpClient} in any way. As such,
+ * it does not set timeouts, nor does it
+ * {@linkplain HttpClientBuilder#addRequestInterceptorFirst(HttpRequestInterceptor)
+ * add} the {@link RemoveSoapHeadersInterceptor}.
* @param httpClient the HttpClient instance to use for this sender
*/
public HttpComponents5MessageSender(HttpClient httpClient) {
@@ -91,8 +94,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.httpClient = httpClient;
}
- /**
- * @see HttpComponents5ClientFactory#setAuthScope(AuthScope)
+ /*
+ * * @see HttpComponents5ClientFactory#setAuthScope(AuthScope)
*/
public void setAuthScope(AuthScope authScope) {
@@ -103,8 +106,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.clientFactory.setAuthScope(authScope);
}
- /**
- * @see HttpComponents5ClientFactory#setCredentials(Credentials)
+ /*
+ * * @see HttpComponents5ClientFactory#setCredentials(Credentials)
*/
public void setCredentials(Credentials credentials) {
@@ -129,8 +132,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.httpClient = httpClient;
}
- /**
- * @see HttpComponents5ClientFactory#setConnectionTimeout(Duration)
+ /*
+ * * @see HttpComponents5ClientFactory#setConnectionTimeout(Duration)
*/
public void setConnectionTimeout(Duration timeout) {
@@ -141,8 +144,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.clientFactory.setConnectionTimeout(timeout);
}
- /**
- * @see HttpComponents5ClientFactory#setReadTimeout(Duration)
+ /*
+ * * @see HttpComponents5ClientFactory#setReadTimeout(Duration)
*/
public void setReadTimeout(Duration timeout) {
@@ -153,8 +156,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.clientFactory.setReadTimeout(timeout);
}
- /**
- * @see HttpComponents5ClientFactory#setMaxTotalConnections(int)
+ /*
+ * * @see HttpComponents5ClientFactory#setMaxTotalConnections(int)
*/
public void setMaxTotalConnections(int maxTotalConnections) {
@@ -165,8 +168,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
this.clientFactory.setMaxTotalConnections(maxTotalConnections);
}
- /**
- * @see HttpComponents5ClientFactory#setMaxConnectionsPerHost(Map)
+ /*
+ * * @see HttpComponents5ClientFactory#setMaxConnectionsPerHost(Map)
*/
public void setMaxConnectionsPerHost(Map maxConnectionsPerHost) {
@@ -191,7 +194,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
HttpPost httpPost = new HttpPost(uri);
if (isAcceptGzipEncoding()) {
- httpPost.addHeader(HttpTransportConstants.HEADER_ACCEPT_ENCODING, HttpTransportConstants.CONTENT_ENCODING_GZIP);
+ httpPost.addHeader(HttpTransportConstants.HEADER_ACCEPT_ENCODING,
+ HttpTransportConstants.CONTENT_ENCODING_GZIP);
}
HttpContext httpContext = createContext(uri);
@@ -200,9 +204,8 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
}
/**
- * Template method that allows for creation of an {@link HttpContext} for the given uri. Default implementation returns
- * {@code null}.
- *
+ * Template method that allows for creation of an {@link HttpContext} for the given
+ * uri. Default implementation returns {@code null}.
* @param uri the URI to create the context for
* @return the context, or {@code null}
*/
@@ -213,15 +216,16 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
@Override
public void destroy() throws Exception {
- if (getHttpClient()instanceof CloseableHttpClient client) {
+ if (getHttpClient() instanceof CloseableHttpClient client) {
client.close();
}
}
/**
- * HttpClient {@link HttpRequestInterceptor} implementation that removes {@code Content-Length} and
- * {@code Transfer-Encoding} headers from the request. Necessary, because some SAAJ and other SOAP implementations set
- * these headers themselves, and HttpClient throws an exception if they have been set.
+ * HttpClient {@link HttpRequestInterceptor} implementation that removes
+ * {@code Content-Length} and {@code Transfer-Encoding} headers from the request.
+ * Necessary, because some SAAJ and other SOAP implementations set these headers
+ * themselves, and HttpClient throws an exception if they have been set.
*/
public static class RemoveSoapHeadersInterceptor implements HttpRequestInterceptor {
@@ -237,5 +241,7 @@ public class HttpComponents5MessageSender extends AbstractHttpWebServiceMessageS
request.removeHeaders(HttpHeaders.CONTENT_LENGTH);
}
}
+
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java
index 23b37431..b4bc3493 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,13 +33,14 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
+
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Implementation of {@link WebServiceConnection} that is based on Apache HttpClient. Exposes a {@link HttpPost} and
- * {@link HttpResponse}.
+ * Implementation of {@link WebServiceConnection} that is based on Apache HttpClient.
+ * Exposes a {@link HttpPost} and {@link HttpResponse}.
*
* @author Alan Stewart
* @author Barry Pitman
@@ -83,16 +84,16 @@ public class HttpComponentsConnection extends AbstractHttpSenderConnection {
}
/*
- * URI
- */
+ * URI
+ */
@Override
public URI getUri() throws URISyntaxException {
return new URI(httpPost.getURI().toString());
}
/*
- * Sending request
- */
+ * Sending request
+ */
@Override
protected void onSendBeforeWrite(WebServiceMessage message) throws IOException {
@@ -115,7 +116,8 @@ public class HttpComponentsConnection extends AbstractHttpSenderConnection {
requestBuffer = null;
if (httpContext != null) {
httpResponse = httpClient.execute(httpPost, httpContext);
- } else {
+ }
+ else {
httpResponse = httpClient.execute(httpPost);
}
}
@@ -171,4 +173,5 @@ public class HttpComponentsConnection extends AbstractHttpSenderConnection {
}
return Arrays.asList(values).iterator();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java
index 5ebdd815..d0b22fab 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpComponentsMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,18 +34,20 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
+
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * {@code WebServiceMessageSender} implementation that uses Apache
- * HttpClient to execute POST requests.
+ * {@code WebServiceMessageSender} implementation that uses
+ * Apache HttpClient to execute
+ * POST requests.
*
- * Allows to use a pre-configured HttpClient instance, potentially with authentication, HTTP connection pooling, etc.
- * Authentication can also be set by injecting a {@link Credentials} instance (such as the
- * {@link UsernamePasswordCredentials}).
+ * Allows to use a pre-configured HttpClient instance, potentially with authentication,
+ * HTTP connection pooling, etc. Authentication can also be set by injecting a
+ * {@link Credentials} instance (such as the {@link UsernamePasswordCredentials}).
*
* @author Alan Stewart
* @author Barry Pitman
@@ -69,7 +71,8 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
private AuthScope authScope = AuthScope.ANY;
/**
- * Create a new instance of the {@code HttpClientMessageSender} with a default {@link HttpClient} that uses a default
+ * Create a new instance of the {@code HttpClientMessageSender} with a default
+ * {@link HttpClient} that uses a default
* {@link org.apache.http.impl.conn.PoolingClientConnectionManager}.
*/
public HttpComponentsMessageSender() {
@@ -83,13 +86,13 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * Create a new instance of the {@code HttpClientMessageSender} with the given {@link HttpClient} instance.
+ * Create a new instance of the {@code HttpClientMessageSender} with the given
+ * {@link HttpClient} instance.
*
- * This constructor does not change the given {@code HttpClient} in any way. As such, it does not set timeouts, nor
- * does it
+ * This constructor does not change the given {@code HttpClient} in any way. As such,
+ * it does not set timeouts, nor does it
* {@linkplain org.apache.http.impl.client.DefaultHttpClient#addRequestInterceptor(org.apache.http.HttpRequestInterceptor)
* add} the {@link RemoveSoapHeadersInterceptor}.
- *
* @param httpClient the HttpClient instance to use for this sender
*/
public HttpComponentsMessageSender(HttpClient httpClient) {
@@ -99,7 +102,6 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
/**
* Sets the credentials to be used. If not set, no authentication is done.
- *
* @see UsernamePasswordCredentials
* @see org.apache.http.auth.NTCredentials
*/
@@ -122,10 +124,11 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * Sets the timeout until a connection is established. A value of 0 means never timeout.
- *
+ * Sets the timeout until a connection is established. A value of 0 means
+ * never timeout.
* @param timeout the timeout value in milliseconds
- * @see org.apache.http.params.HttpConnectionParams#setConnectionTimeout(org.apache.http.params.HttpParams, int)
+ * @see org.apache.http.params.HttpConnectionParams#setConnectionTimeout(org.apache.http.params.HttpParams,
+ * int)
*/
public void setConnectionTimeout(int timeout) {
if (timeout < 0) {
@@ -135,10 +138,11 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * Set the socket read timeout for the underlying HttpClient. A value of 0 means never timeout.
- *
+ * Set the socket read timeout for the underlying HttpClient. A value of 0 means
+ * never timeout.
* @param timeout the timeout value in milliseconds
- * @see org.apache.http.params.HttpConnectionParams#setSoTimeout(org.apache.http.params.HttpParams, int)
+ * @see org.apache.http.params.HttpConnectionParams#setSoTimeout(org.apache.http.params.HttpParams,
+ * int)
*/
public void setReadTimeout(int timeout) {
if (timeout < 0) {
@@ -149,7 +153,6 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
/**
* Sets the maximum number of connections allowed for the underlying HttpClient.
- *
* @param maxTotalConnections the maximum number of connections allowed
* @see org.apache.http.impl.conn.PoolingClientConnectionManager#setMaxTotal(int)
*/
@@ -167,8 +170,9 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * Sets the maximum number of connections per host for the underlying HttpClient. The maximum number of connections
- * per host can be set in a form accepted by the {@code java.util.Properties} class, like as follows:
+ * Sets the maximum number of connections per host for the underlying HttpClient. The
+ * maximum number of connections per host can be set in a form accepted by the
+ * {@code java.util.Properties} class, like as follows:
*
*
* https://www.example.com=1
@@ -177,9 +181,10 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
*
*
* The host can be specified as a URI (with scheme and port).
- *
- * @param maxConnectionsPerHost a properties object specifying the maximum number of connection
- * @see org.apache.http.impl.conn.PoolingClientConnectionManager#setMaxPerRoute(HttpRoute, int)
+ * @param maxConnectionsPerHost a properties object specifying the maximum number of
+ * connection
+ * @see org.apache.http.impl.conn.PoolingClientConnectionManager#setMaxPerRoute(HttpRoute,
+ * int)
*/
public void setMaxConnectionsPerHost(Map maxConnectionsPerHost) throws URISyntaxException {
org.apache.http.conn.ClientConnectionManager connectionManager = getHttpClient().getConnectionManager();
@@ -197,7 +202,8 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
if (uri.getScheme().equals("https")) {
route = new HttpRoute(host, null, true);
- } else {
+ }
+ else {
route = new HttpRoute(host);
}
@@ -208,10 +214,10 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * Sets the authentication scope to be used. Only used when the {@code credentials} property has been set.
+ * Sets the authentication scope to be used. Only used when the {@code credentials}
+ * property has been set.
*
* By default, the {@link AuthScope#ANY} is used.
- *
* @see #setCredentials(Credentials)
*/
public void setAuthScope(AuthScope authScope) {
@@ -222,7 +228,7 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
public void afterPropertiesSet() throws Exception {
if (credentials != null && getHttpClient() instanceof org.apache.http.impl.client.DefaultHttpClient) {
((org.apache.http.impl.client.DefaultHttpClient) getHttpClient()).getCredentialsProvider()
- .setCredentials(authScope, credentials);
+ .setCredentials(authScope, credentials);
}
}
@@ -230,16 +236,16 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
public WebServiceConnection createConnection(URI uri) throws IOException {
HttpPost httpPost = new HttpPost(uri);
if (isAcceptGzipEncoding()) {
- httpPost.addHeader(HttpTransportConstants.HEADER_ACCEPT_ENCODING, HttpTransportConstants.CONTENT_ENCODING_GZIP);
+ httpPost.addHeader(HttpTransportConstants.HEADER_ACCEPT_ENCODING,
+ HttpTransportConstants.CONTENT_ENCODING_GZIP);
}
HttpContext httpContext = createContext(uri);
return new HttpComponentsConnection(getHttpClient(), httpPost, httpContext);
}
/**
- * Template method that allows for creation of a {@link HttpContext} for the given uri. Default implementation returns
- * {@code null}.
- *
+ * Template method that allows for creation of a {@link HttpContext} for the given
+ * uri. Default implementation returns {@code null}.
* @param uri the URI to create the context for
* @return the context, or {@code null}
*/
@@ -253,9 +259,10 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
/**
- * HttpClient {@link org.apache.http.HttpRequestInterceptor} implementation that removes {@code Content-Length} and
- * {@code Transfer-Encoding} headers from the request. Necessary, because some SAAJ and other SOAP implementations set
- * these headers themselves, and HttpClient throws an exception if they have been set.
+ * HttpClient {@link org.apache.http.HttpRequestInterceptor} implementation that
+ * removes {@code Content-Length} and {@code Transfer-Encoding} headers from the
+ * request. Necessary, because some SAAJ and other SOAP implementations set these
+ * headers themselves, and HttpClient throws an exception if they have been set.
*/
public static class RemoveSoapHeadersInterceptor implements HttpRequestInterceptor {
@@ -270,5 +277,7 @@ public class HttpComponentsMessageSender extends AbstractHttpWebServiceMessageSe
}
}
}
+
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java
index cbe8e4eb..4ba20486 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpServletConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,6 @@
package org.springframework.ws.transport.http;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.xml.soap.SOAPConstants;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -29,6 +25,10 @@ import java.util.Iterator;
import javax.xml.namespace.QName;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.xml.soap.SOAPConstants;
+
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.AbstractReceiverConnection;
import org.springframework.ws.transport.EndpointAwareWebServiceConnection;
@@ -53,7 +53,8 @@ public class HttpServletConnection extends AbstractReceiverConnection
private boolean statusCodeSet = false;
/**
- * Constructs a new servlet connection with the given {@code HttpServletRequest} and {@code HttpServletResponse}.
+ * Constructs a new servlet connection with the given {@code HttpServletRequest} and
+ * {@code HttpServletResponse}.
*/
protected HttpServletConnection(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
this.httpServletRequest = httpServletRequest;
@@ -97,13 +98,13 @@ public class HttpServletConnection extends AbstractReceiverConnection
@Override
public URI getUri() throws URISyntaxException {
return new URI(httpServletRequest.getScheme(), null, httpServletRequest.getServerName(),
- httpServletRequest.getServerPort(), httpServletRequest.getRequestURI(), httpServletRequest.getQueryString(),
- null);
+ httpServletRequest.getServerPort(), httpServletRequest.getRequestURI(),
+ httpServletRequest.getQueryString(), null);
}
/*
- * Receiving request
- */
+ * Receiving request
+ */
@Override
public Iterator getRequestHeaderNames() throws IOException {
@@ -121,8 +122,8 @@ public class HttpServletConnection extends AbstractReceiverConnection
}
/*
- * Sending response
- */
+ * Sending response
+ */
@Override
public void addResponseHeader(String name, String value) throws IOException {
@@ -160,7 +161,8 @@ public class HttpServletConnection extends AbstractReceiverConnection
public void setFault(boolean fault) throws IOException {
if (fault) {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR);
- } else {
+ }
+ else {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_OK);
}
statusCodeSet = true;
@@ -171,12 +173,15 @@ public class HttpServletConnection extends AbstractReceiverConnection
if (faultCode != null) {
if (SOAPConstants.SOAP_SENDER_FAULT.equals(faultCode)) {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_BAD_REQUEST);
- } else {
+ }
+ else {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR);
}
- } else {
+ }
+ else {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_OK);
}
statusCodeSet = true;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportConstants.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportConstants.java
index c18b88c8..2676c92f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportConstants.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpTransportConstants.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -67,4 +67,5 @@ public interface HttpTransportConstants extends TransportConstants {
/** The "POST" HTTP method */
String METHOD_POST = "POST";
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java
index 47971491..3cda6571 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -36,7 +36,8 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Implementation of the {@link WebServiceConnection} interface that uses a {@link HttpURLConnection}.
+ * Implementation of the {@link WebServiceConnection} interface that uses a
+ * {@link HttpURLConnection}.
*
* @author Arjen Poutsma
* @author Greg Turnquist
@@ -48,8 +49,8 @@ public class HttpUrlConnection extends AbstractHttpSenderConnection {
private final HttpURLConnection connection;
/**
- * Creates a new instance of the {@code HttpUrlConnection} with the given {@code HttpURLConnection}.
- *
+ * Creates a new instance of the {@code HttpUrlConnection} with the given
+ * {@code HttpURLConnection}.
* @param connection the {@code HttpURLConnection}
*/
protected HttpUrlConnection(HttpURLConnection connection) {
@@ -133,7 +134,8 @@ public class HttpUrlConnection extends AbstractHttpSenderConnection {
if (headerValues == null) {
return Collections.emptyIterator();
- } else {
+ }
+ else {
return headerValues.iterator();
}
}
@@ -152,8 +154,10 @@ public class HttpUrlConnection extends AbstractHttpSenderConnection {
protected InputStream getRawResponseInputStream() throws IOException {
if (connection.getResponseCode() / 100 != 2) {
return connection.getErrorStream();
- } else {
+ }
+ else {
return connection.getInputStream();
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java
index ca4fa7d5..00e14bab 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/HttpUrlConnectionMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,11 +26,12 @@ import java.time.Duration;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * {@code WebServiceMessageSender} implementation that uses standard J2SE facilities to execute POST requests, without
- * support for HTTP authentication or advanced configuration options.
+ * {@code WebServiceMessageSender} implementation that uses standard J2SE facilities to
+ * execute POST requests, without support for HTTP authentication or advanced
+ * configuration options.
*
- * Consider {@link HttpComponentsMessageSender} for more sophisticated needs: this class is rather limited in its
- * capabilities.
+ * Consider {@link HttpComponentsMessageSender} for more sophisticated needs: this class
+ * is rather limited in its capabilities.
*
* @author Arjen Poutsma
* @author Kazuki Shimizu
@@ -40,11 +41,11 @@ import org.springframework.ws.transport.WebServiceConnection;
public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessageSender {
private Duration connectionTimeout = Duration.ofSeconds(60);
+
private Duration readTimeout = Duration.ofSeconds(60);
/**
* Sets the timeout until a connection is established.
- *
* @param connectTimeout the timeout value
* @see URLConnection#setConnectTimeout(int)
* @since 3.0.1
@@ -55,7 +56,6 @@ public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessag
/**
* Set the socket read timeout.
- *
* @param readTimeout the timeout value
* @see URLConnection#setReadTimeout(int)
* @since 3.0.1
@@ -70,7 +70,8 @@ public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessag
URLConnection connection = url.openConnection();
if (!(connection instanceof HttpURLConnection)) {
throw new HttpTransportException("URI [" + uri + "] is not an HTTP URL");
- } else {
+ }
+ else {
HttpURLConnection httpURLConnection = (HttpURLConnection) connection;
prepareConnection(httpURLConnection);
return new HttpUrlConnection(httpURLConnection);
@@ -80,10 +81,9 @@ public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessag
/**
* Template method for preparing the given {@link java.net.HttpURLConnection}.
*
- * The default implementation prepares the connection for input and output, sets the HTTP method to POST, disables
- * caching, and sets the {@code Accept-Encoding} header to gzip, if {@linkplain #setAcceptGzipEncoding(boolean)
- * applicable}.
- *
+ * The default implementation prepares the connection for input and output, sets the
+ * HTTP method to POST, disables caching, and sets the {@code Accept-Encoding} header
+ * to gzip, if {@linkplain #setAcceptGzipEncoding(boolean) applicable}.
* @param connection the connection to prepare
* @throws IOException in case of I/O errors
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientConnection.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientConnection.java
index d1574e06..d1290a8f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientConnection.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientConnection.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023-2023 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,13 +34,15 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.http.HttpStatus;
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Implementation of the {@link WebServiceConnection} interface that uses Java's built-in {@link HttpClient}.
+ * Implementation of the {@link WebServiceConnection} interface that uses Java's built-in
+ * {@link HttpClient}.
*
* @author Marten Deinum
* @see java.net.http.HttpClient
@@ -129,8 +131,8 @@ public class JdkHttpClientConnection extends AbstractHttpSenderConnection {
if (response != null) {
return response.headers() //
- .firstValueAsLong(HttpTransportConstants.HEADER_CONTENT_LENGTH) //
- .orElse(-1);
+ .firstValueAsLong(HttpTransportConstants.HEADER_CONTENT_LENGTH) //
+ .orElse(-1);
}
return 0;
@@ -155,7 +157,8 @@ public class JdkHttpClientConnection extends AbstractHttpSenderConnection {
try {
response = httpClient.send(request, BodyHandlers.ofInputStream());
- } catch (InterruptedException ex) {
+ }
+ catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException(ex);
}
@@ -168,4 +171,5 @@ public class JdkHttpClientConnection extends AbstractHttpSenderConnection {
response.body().close();
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientMessageSender.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientMessageSender.java
index 8b2575d5..7bc6aeb8 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientMessageSender.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/JdkHttpClientMessageSender.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2023-2023 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,11 +27,11 @@ import org.springframework.util.Assert;
import org.springframework.ws.transport.WebServiceConnection;
/**
- * {@code WebServiceMessageSender} implementation that uses the standard Java {@code HttpClient} facilities to execute
- * POST requests.
+ * {@code WebServiceMessageSender} implementation that uses the standard Java
+ * {@code HttpClient} facilities to execute POST requests.
*
- * Can be used with a simple default configured {@code HttpClient} or can be constructed with a pre-configured
- * {@code HttpClient}.
+ * Can be used with a simple default configured {@code HttpClient} or can be constructed
+ * with a pre-configured {@code HttpClient}.
*
* @author Marten Deinum
* @see java.net.http.HttpClient
@@ -49,7 +49,8 @@ public class JdkHttpClientMessageSender extends AbstractHttpWebServiceMessageSen
private Duration requestTimeout = DEFAULT_REQUEST_TIMEOUT;
- public JdkHttpClientMessageSender() {}
+ public JdkHttpClientMessageSender() {
+ }
public JdkHttpClientMessageSender(HttpClient httpClient) {
@@ -89,4 +90,5 @@ public class JdkHttpClientMessageSender extends AbstractHttpWebServiceMessageSen
httpClient = HttpClient.newBuilder().connectTimeout(connectionTimeout).build();
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LastModifiedHelper.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LastModifiedHelper.java
index 97c2bc0f..7ae287b3 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LastModifiedHelper.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LastModifiedHelper.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,9 +23,10 @@ import java.net.URISyntaxException;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
+import org.w3c.dom.Document;
+
import org.springframework.util.StringUtils;
import org.springframework.xml.transform.TraxUtils;
-import org.w3c.dom.Document;
/**
* Utility class that determines the last modified date of a given {@link Source}.
@@ -35,11 +36,11 @@ import org.w3c.dom.Document;
*/
class LastModifiedHelper {
- private LastModifiedHelper() {}
+ private LastModifiedHelper() {
+ }
/**
* Returns the last modified date of the given {@link Source}.
- *
* @param source the source
* @return the last modified date, as a long
*/
@@ -47,7 +48,8 @@ class LastModifiedHelper {
if (source instanceof DOMSource) {
Document document = TraxUtils.getDocument((DOMSource) source);
return document != null ? getLastModified(document.getDocumentURI()) : -1;
- } else {
+ }
+ else {
return getLastModified(source.getSystemId());
}
}
@@ -62,7 +64,8 @@ class LastModifiedHelper {
return documentFile.lastModified();
}
}
- } catch (URISyntaxException e) {
+ }
+ catch (URISyntaxException e) {
// ignore
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LocationTransformerObjectSupport.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LocationTransformerObjectSupport.java
index 4d8fc8f6..3a0860a4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LocationTransformerObjectSupport.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/LocationTransformerObjectSupport.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,23 +16,23 @@
package org.springframework.ws.transport.http;
-import jakarta.servlet.http.HttpServletRequest;
-
import java.util.List;
+import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-import org.springframework.xml.transform.TransformerObjectSupport;
-import org.springframework.xml.xpath.XPathExpression;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.xml.transform.TransformerObjectSupport;
+import org.springframework.xml.xpath.XPathExpression;
+
/**
- * Abstract base class for {@link WsdlDefinitionHandlerAdapter} and {@link XsdSchemaHandlerAdapter} that transforms XSD
- * and WSDL location attributes.
+ * Abstract base class for {@link WsdlDefinitionHandlerAdapter} and
+ * {@link XsdSchemaHandlerAdapter} that transforms XSD and WSDL location attributes.
*
* @author Arjen Poutsma
* @since 2.1.2
@@ -43,8 +43,8 @@ public abstract class LocationTransformerObjectSupport extends TransformerObject
private final Log logger = LogFactory.getLog(getClass());
/**
- * Transforms the locations of the given definition document using the given XPath expression.
- *
+ * Transforms the locations of the given definition document using the given XPath
+ * expression.
* @param xPathExpression the XPath expression
* @param definitionDocument the definition document
* @param request the request, used to determine the location to transform to
@@ -71,18 +71,20 @@ public abstract class LocationTransformerObjectSupport extends TransformerObject
}
/**
- * Transform the given location string to reflect the given request. If the given location is a full url, the scheme,
- * server name, and port are changed. If it is a relative url, the scheme, server name, and port are prepended. Can be
- * overridden in subclasses to change this behavior.
+ * Transform the given location string to reflect the given request. If the given
+ * location is a full url, the scheme, server name, and port are changed. If it is a
+ * relative url, the scheme, server name, and port are prepended. Can be overridden in
+ * subclasses to change this behavior.
*
* For instance, if the location attribute defined in the WSDL is
- * {@code http://localhost:8080/context/services/myService}, and the request URI for the WSDL is
- * {@code http://example.com:80/context/myService.wsdl}, the location will be changed to
- * {@code http://example.com:80/context/services/myService}.
+ * {@code http://localhost:8080/context/services/myService}, and the request URI for
+ * the WSDL is {@code http://example.com:80/context/myService.wsdl}, the location will
+ * be changed to {@code http://example.com:80/context/services/myService}.
*
- * If the location attribute defined in the WSDL is {@code /services/myService}, and the request URI for the WSDL is
- * {@code http://example.com:8080/context/myService.wsdl}, the location will be changed to
- * {@code http://example.com:8080/context/services/myService}.
+ * If the location attribute defined in the WSDL is {@code /services/myService}, and
+ * the request URI for the WSDL is
+ * {@code http://example.com:8080/context/myService.wsdl}, the location will be
+ * changed to {@code http://example.com:8080/context/services/myService}.
*
* This method is only called when the {@code transformLocations} property is true.
*/
@@ -94,19 +96,21 @@ public abstract class LocationTransformerObjectSupport extends TransformerObject
String scheme = StringUtils.hasText(xForwardedProto) ? xForwardedProto : request.getScheme();
String serverName = StringUtils.hasText(xForwardedHost) ? xForwardedHost : request.getServerName();
- int serverPort = StringUtils.hasText(xForwardedPort) ? Integer.parseInt(xForwardedPort) : request.getServerPort();
+ int serverPort = StringUtils.hasText(xForwardedPort) ? Integer.parseInt(xForwardedPort)
+ : request.getServerPort();
StringBuilder url = new StringBuilder(scheme);
url.append("://").append(serverName);
boolean serverHasColonAfterAt = serverName.indexOf("@") < serverName.indexOf(":");
- if(!serverHasColonAfterAt) {
+ if (!serverHasColonAfterAt) {
url.append(':').append(serverPort);
}
if (location.startsWith("/")) {
// a relative path, prepend the context path
url.append(request.getContextPath()).append(location);
return url.toString();
- } else {
+ }
+ else {
int idx = location.indexOf("://");
if (idx != -1) {
// a full url
@@ -121,4 +125,5 @@ public abstract class LocationTransformerObjectSupport extends TransformerObject
// unknown location, return the original
return location;
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java
index 41c46297..2607ffcd 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/MessageDispatcherServlet.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -43,18 +43,22 @@ import org.springframework.xml.xsd.XsdSchema;
/**
* Servlet for simplified dispatching of Web service messages.
*
- * This servlet is a convenient alternative to the standard Spring-MVC {@link DispatcherServlet} with separate
- * {@link WebServiceMessageReceiverHandlerAdapter}, {@link MessageDispatcher}, and {@link WsdlDefinitionHandlerAdapter}
- * instances.
+ * This servlet is a convenient alternative to the standard Spring-MVC
+ * {@link DispatcherServlet} with separate
+ * {@link WebServiceMessageReceiverHandlerAdapter}, {@link MessageDispatcher}, and
+ * {@link WsdlDefinitionHandlerAdapter} instances.
*
- * This servlet automatically detects {@link EndpointAdapter EndpointAdapters}, {@link EndpointMapping
- * EndpointMappings}, and {@link EndpointExceptionResolver EndpointExceptionResolvers} by type.
+ * This servlet automatically detects {@link EndpointAdapter EndpointAdapters},
+ * {@link EndpointMapping EndpointMappings}, and {@link EndpointExceptionResolver
+ * EndpointExceptionResolvers} by type.
*
- * This servlet also automatically detects any {@link WsdlDefinition} defined in its application context. This WSDL is
- * exposed under the bean name: for example, a {@code WsdlDefinition} bean named '{@code echo}' will be exposed as
- * {@code echo.wsdl} in this servlet's context: {@code http://localhost:8080/spring-ws/echo.wsdl}. When the
- * {@code transformWsdlLocations} init-param is set to {@code true} in this servlet's configuration in {@code web.xml},
- * all {@code location} attributes in the WSDL definitions will reflect the URL of the incoming request.
+ * This servlet also automatically detects any {@link WsdlDefinition} defined in its
+ * application context. This WSDL is exposed under the bean name: for example, a
+ * {@code WsdlDefinition} bean named '{@code echo}' will be exposed as {@code echo.wsdl}
+ * in this servlet's context: {@code http://localhost:8080/spring-ws/echo.wsdl}. When the
+ * {@code transformWsdlLocations} init-param is set to {@code true} in this servlet's
+ * configuration in {@code web.xml}, all {@code location} attributes in the WSDL
+ * definitions will reflect the URL of the incoming request.
*
* @author Arjen Poutsma
* @see org.springframework.web.servlet.DispatcherServlet
@@ -65,22 +69,34 @@ import org.springframework.xml.xsd.XsdSchema;
@SuppressWarnings("serial")
public class MessageDispatcherServlet extends FrameworkServlet {
- /** Well-known name for the {@link WebServiceMessageFactory} bean in the bean factory for this namespace. */
+ /**
+ * Well-known name for the {@link WebServiceMessageFactory} bean in the bean factory
+ * for this namespace.
+ */
public static final String DEFAULT_MESSAGE_FACTORY_BEAN_NAME = "messageFactory";
- /** Well-known name for the {@link WebServiceMessageReceiver} object in the bean factory for this namespace. */
+ /**
+ * Well-known name for the {@link WebServiceMessageReceiver} object in the bean
+ * factory for this namespace.
+ */
public static final String DEFAULT_MESSAGE_RECEIVER_BEAN_NAME = "messageReceiver";
/**
- * Well-known name for the {@link WebServiceMessageReceiverHandlerAdapter} object in the bean factory for this
- * namespace.
+ * Well-known name for the {@link WebServiceMessageReceiverHandlerAdapter} object in
+ * the bean factory for this namespace.
*/
public static final String DEFAULT_MESSAGE_RECEIVER_HANDLER_ADAPTER_BEAN_NAME = "messageReceiverHandlerAdapter";
- /** Well-known name for the {@link WsdlDefinitionHandlerAdapter} object in the bean factory for this namespace. */
+ /**
+ * Well-known name for the {@link WsdlDefinitionHandlerAdapter} object in the bean
+ * factory for this namespace.
+ */
public static final String DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME = "wsdlDefinitionHandlerAdapter";
- /** Well-known name for the {@link XsdSchemaHandlerAdapter} object in the bean factory for this namespace. */
+ /**
+ * Well-known name for the {@link XsdSchemaHandlerAdapter} object in the bean factory
+ * for this namespace.
+ */
public static final String DEFAULT_XSD_SCHEMA_HANDLER_ADAPTER_BEAN_NAME = "xsdSchemaHandlerAdapter";
/** Suffix of a WSDL request uri. */
@@ -130,11 +146,13 @@ public class MessageDispatcherServlet extends FrameworkServlet {
}
/**
- * Constructor to support programmatic configuration of the Servlet with the specified web application context. This
- * constructor is useful in Servlet 3.0+ environments where instance-based registration of servlets is possible
- * through the {@code ServletContext#addServlet} API.
+ * Constructor to support programmatic configuration of the Servlet with the specified
+ * web application context. This constructor is useful in Servlet 3.0+ environments
+ * where instance-based registration of servlets is possible through the
+ * {@code ServletContext#addServlet} API.
*
- * Using this constructor indicates that the following properties / init-params will be ignored:
+ * Using this constructor indicates that the following properties / init-params will
+ * be ignored:
*
@@ -143,27 +161,31 @@ public class MessageDispatcherServlet extends FrameworkServlet {
*
*
* The given web application context may or may not yet be
- * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#refresh() refreshed}. If it has
- * not already been refreshed (the recommended approach), then the following will occur:
+ * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#refresh()
+ * refreshed}. If it has not already been refreshed (the recommended
+ * approach), then the following will occur:
*
*
If the given context does not already have a
- * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#setParent parent}, the root
- * application context will be set as the parent.
+ * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#setParent
+ * parent}, the root application context will be set as the parent.
*
If the given context has not already been assigned an
- * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#setId id}, one will be assigned to
- * it
- *
{@code ServletContext} and {@code ServletConfig} objects will be delegated to the application context
+ * {@linkplain org.springframework.web.context.ConfigurableWebApplicationContext#setId
+ * id}, one will be assigned to it
+ *
{@code ServletContext} and {@code ServletConfig} objects will be delegated to
+ * the application context
*
{@link #postProcessWebApplicationContext} will be called
- *
Any {@code ApplicationContextInitializer}s specified through the "contextInitializerClasses" init-param or
- * through the {@link #setContextInitializers} property will be applied.
- *
{@link org.springframework.web.context.ConfigurableWebApplicationContext#refresh refresh()} will be called if
- * the context implements {@link org.springframework.web.context.ConfigurableWebApplicationContext}
+ *
Any {@code ApplicationContextInitializer}s specified through the
+ * "contextInitializerClasses" init-param or through the
+ * {@link #setContextInitializers} property will be applied.
+ *
{@link org.springframework.web.context.ConfigurableWebApplicationContext#refresh
+ * refresh()} will be called if the context implements
+ * {@link org.springframework.web.context.ConfigurableWebApplicationContext}
*
- * If the context has already been refreshed, none of the above will occur, under the assumption that the user has
- * performed these actions (or not) per their specific needs.
+ * If the context has already been refreshed, none of the above will occur, under the
+ * assumption that the user has performed these actions (or not) per their specific
+ * needs.
*
* See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
- *
* @param webApplicationContext the context to use
* @see FrameworkServlet#FrameworkServlet(WebApplicationContext)
* @see org.springframework.web.WebApplicationInitializer
@@ -202,44 +224,48 @@ public class MessageDispatcherServlet extends FrameworkServlet {
}
/**
- * Indicates whether relative address locations in the WSDL are to be transformed using the request URI of the
- * incoming {@link HttpServletRequest}.
+ * Indicates whether relative address locations in the WSDL are to be transformed
+ * using the request URI of the incoming {@link HttpServletRequest}.
*/
public boolean isTransformWsdlLocations() {
return transformWsdlLocations;
}
/**
- * Sets whether relative address locations in the WSDL are to be transformed using the request URI of the incoming
- * {@link HttpServletRequest}. Defaults to {@code false}.
+ * Sets whether relative address locations in the WSDL are to be transformed using the
+ * request URI of the incoming {@link HttpServletRequest}. Defaults to {@code false}.
*/
public void setTransformWsdlLocations(boolean transformWsdlLocations) {
this.transformWsdlLocations = transformWsdlLocations;
}
/**
- * Indicates whether relative address locations in the XSD are to be transformed using the request URI of the incoming
- * {@link HttpServletRequest}.
+ * Indicates whether relative address locations in the XSD are to be transformed using
+ * the request URI of the incoming {@link HttpServletRequest}.
*/
public boolean isTransformSchemaLocations() {
return transformSchemaLocations;
}
/**
- * Sets whether relative address locations in the XSD are to be transformed using the request URI of the incoming
- * {@link HttpServletRequest}. Defaults to {@code false}.
+ * Sets whether relative address locations in the XSD are to be transformed using the
+ * request URI of the incoming {@link HttpServletRequest}. Defaults to {@code false}.
*/
public void setTransformSchemaLocations(boolean transformSchemaLocations) {
this.transformSchemaLocations = transformSchemaLocations;
}
- /** Returns the bean name used to lookup a {@link WebServiceMessageReceiverHandlerAdapter}. */
+ /**
+ * Returns the bean name used to lookup a
+ * {@link WebServiceMessageReceiverHandlerAdapter}.
+ */
public String getMessageReceiverHandlerAdapterBeanName() {
return messageReceiverHandlerAdapterBeanName;
}
/**
- * Sets the bean name used to lookup a {@link WebServiceMessageReceiverHandlerAdapter}. Defaults to
+ * Sets the bean name used to lookup a
+ * {@link WebServiceMessageReceiverHandlerAdapter}. Defaults to
* {@link #DEFAULT_MESSAGE_RECEIVER_HANDLER_ADAPTER_BEAN_NAME}.
*/
public void setMessageReceiverHandlerAdapterBeanName(String messageReceiverHandlerAdapterBeanName) {
@@ -252,8 +278,8 @@ public class MessageDispatcherServlet extends FrameworkServlet {
}
/**
- * Sets the bean name used to lookup a {@link WsdlDefinitionHandlerAdapter}. Defaults to
- * {@link #DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME}.
+ * Sets the bean name used to lookup a {@link WsdlDefinitionHandlerAdapter}. Defaults
+ * to {@link #DEFAULT_WSDL_DEFINITION_HANDLER_ADAPTER_BEAN_NAME}.
*/
public void setWsdlDefinitionHandlerAdapterBeanName(String wsdlDefinitionHandlerAdapterBeanName) {
this.wsdlDefinitionHandlerAdapterBeanName = wsdlDefinitionHandlerAdapterBeanName;
@@ -272,7 +298,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
this.xsdSchemaHandlerAdapterBeanName = xsdSchemaHandlerAdapterBeanName;
}
- @Override
+ @Override
protected void doService(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
throws Exception {
WsdlDefinition definition = getWsdlDefinition(httpServletRequest);
@@ -315,11 +341,12 @@ public class MessageDispatcherServlet extends FrameworkServlet {
}
/**
- * Determines the {@link WsdlDefinition} for a given request, or {@code null} if none is found.
+ * Determines the {@link WsdlDefinition} for a given request, or {@code null} if none
+ * is found.
*
- * Default implementation checks whether the request method is {@code GET}, whether the request uri ends with
- * {@code ".wsdl"}, and if there is a {@code WsdlDefinition} with the same name as the filename in the request uri.
- *
+ * Default implementation checks whether the request method is {@code GET}, whether
+ * the request uri ends with {@code ".wsdl"}, and if there is a {@code WsdlDefinition}
+ * with the same name as the filename in the request uri.
* @param request the {@code HttpServletRequest}
* @return a definition, or {@code null}
*/
@@ -328,17 +355,19 @@ public class MessageDispatcherServlet extends FrameworkServlet {
&& request.getRequestURI().endsWith(WSDL_SUFFIX_NAME)) {
String fileName = WebUtils.extractFilenameFromUrlPath(request.getRequestURI());
return wsdlDefinitions.get(fileName);
- } else {
+ }
+ else {
return null;
}
}
/**
- * Determines the {@link XsdSchema} for a given request, or {@code null} if none is found.
+ * Determines the {@link XsdSchema} for a given request, or {@code null} if none is
+ * found.
*
- * Default implementation checks whether the request method is {@code GET}, whether the request uri ends with
- * {@code ".xsd"}, and if there is a {@code XsdSchema} with the same name as the filename in the request uri.
- *
+ * Default implementation checks whether the request method is {@code GET}, whether
+ * the request uri ends with {@code ".xsd"}, and if there is a {@code XsdSchema} with
+ * the same name as the filename in the request uri.
* @param request the {@code HttpServletRequest}
* @return a schema, or {@code null}
*/
@@ -347,7 +376,8 @@ public class MessageDispatcherServlet extends FrameworkServlet {
&& request.getRequestURI().endsWith(XSD_SUFFIX_NAME)) {
String fileName = WebUtils.extractFilenameFromUrlPath(request.getRequestURI());
return xsdSchemas.get(fileName);
- } else {
+ }
+ else {
return null;
}
}
@@ -371,12 +401,14 @@ public class MessageDispatcherServlet extends FrameworkServlet {
try {
messageReceiverHandlerAdapter = context.getBean(getMessageReceiverHandlerAdapterBeanName(),
WebServiceMessageReceiverHandlerAdapter.class);
- } catch (NoSuchBeanDefinitionException ignored) {
+ }
+ catch (NoSuchBeanDefinitionException ignored) {
messageReceiverHandlerAdapter = new WebServiceMessageReceiverHandlerAdapter();
}
initWebServiceMessageFactory(context);
messageReceiverHandlerAdapter.afterPropertiesSet();
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new BeanInitializationException("Could not initialize WebServiceMessageReceiverHandlerAdapter", ex);
}
}
@@ -385,7 +417,8 @@ public class MessageDispatcherServlet extends FrameworkServlet {
WebServiceMessageFactory messageFactory;
try {
messageFactory = context.getBean(getMessageFactoryBeanName(), WebServiceMessageFactory.class);
- } catch (NoSuchBeanDefinitionException ignored) {
+ }
+ catch (NoSuchBeanDefinitionException ignored) {
messageFactory = defaultStrategiesHelper.getDefaultStrategy(WebServiceMessageFactory.class, context);
if (logger.isDebugEnabled()) {
logger.debug("No WebServiceMessageFactory found in servlet '" + getServletName() + "': using default");
@@ -400,13 +433,15 @@ public class MessageDispatcherServlet extends FrameworkServlet {
wsdlDefinitionHandlerAdapter = context.getBean(getWsdlDefinitionHandlerAdapterBeanName(),
WsdlDefinitionHandlerAdapter.class);
- } catch (NoSuchBeanDefinitionException ignored) {
+ }
+ catch (NoSuchBeanDefinitionException ignored) {
wsdlDefinitionHandlerAdapter = new WsdlDefinitionHandlerAdapter();
}
wsdlDefinitionHandlerAdapter.setTransformLocations(isTransformWsdlLocations());
wsdlDefinitionHandlerAdapter.setTransformSchemaLocations(isTransformSchemaLocations());
wsdlDefinitionHandlerAdapter.afterPropertiesSet();
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new BeanInitializationException("Could not initialize WsdlDefinitionHandlerAdapter", ex);
}
}
@@ -414,14 +449,17 @@ public class MessageDispatcherServlet extends FrameworkServlet {
private void initXsdSchemaHandlerAdapter(ApplicationContext context) {
try {
try {
- xsdSchemaHandlerAdapter = context.getBean(getXsdSchemaHandlerAdapterBeanName(), XsdSchemaHandlerAdapter.class);
+ xsdSchemaHandlerAdapter = context.getBean(getXsdSchemaHandlerAdapterBeanName(),
+ XsdSchemaHandlerAdapter.class);
- } catch (NoSuchBeanDefinitionException ignored) {
+ }
+ catch (NoSuchBeanDefinitionException ignored) {
xsdSchemaHandlerAdapter = new XsdSchemaHandlerAdapter();
}
xsdSchemaHandlerAdapter.setTransformSchemaLocations(isTransformSchemaLocations());
xsdSchemaHandlerAdapter.afterPropertiesSet();
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new BeanInitializationException("Could not initialize XsdSchemaHandlerAdapter", ex);
}
}
@@ -429,7 +467,8 @@ public class MessageDispatcherServlet extends FrameworkServlet {
private void initMessageReceiver(ApplicationContext context) {
try {
messageReceiver = context.getBean(getMessageReceiverBeanName(), WebServiceMessageReceiver.class);
- } catch (NoSuchBeanDefinitionException ex) {
+ }
+ catch (NoSuchBeanDefinitionException ex) {
messageReceiver = defaultStrategiesHelper.getDefaultStrategy(WebServiceMessageReceiver.class, context);
if (messageReceiver instanceof BeanNameAware) {
((BeanNameAware) messageReceiver).setBeanName(getServletName());
@@ -461,4 +500,5 @@ public class MessageDispatcherServlet extends FrameworkServlet {
}
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java
index 259c48fb..10c8bfd2 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WebServiceMessageReceiverHandlerAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,12 +29,14 @@ import org.springframework.ws.transport.support.WebServiceMessageReceiverObjectS
/**
* Adapter to use the {@link WebServiceMessageReceiver} interface with the generic
* {@link org.springframework.web.servlet.DispatcherServlet}. Requires a
- * {@link org.springframework.ws.WebServiceMessageFactory} which is used to convert the incoming
- * {@code HttpServletRequest} into a {@code WebServiceMessage}, and passes that context to the mapped
- * {@code WebServiceMessageReceiver}. If a response is created, that is sent via the {@code HttpServletResponse}.
+ * {@link org.springframework.ws.WebServiceMessageFactory} which is used to convert the
+ * incoming {@code HttpServletRequest} into a {@code WebServiceMessage}, and passes that
+ * context to the mapped {@code WebServiceMessageReceiver}. If a response is created, that
+ * is sent via the {@code HttpServletResponse}.
*
- * Note that the {@code MessageDispatcher} implements the {@code WebServiceMessageReceiver} interface, enabling this
- * adapter to function as a gateway to further message handling logic.
+ * Note that the {@code MessageDispatcher} implements the
+ * {@code WebServiceMessageReceiver} interface, enabling this adapter to function as a
+ * gateway to further message handling logic.
*
* @author Arjen Poutsma
* @see #setMessageFactory(org.springframework.ws.WebServiceMessageFactory)
@@ -58,10 +60,12 @@ public class WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageRe
WebServiceConnection connection = new HttpServletConnection(httpServletRequest, httpServletResponse);
try {
handleConnection(connection, (WebServiceMessageReceiver) handler);
- } catch (InvalidXmlException ex) {
+ }
+ catch (InvalidXmlException ex) {
handleInvalidXmlException(httpServletRequest, httpServletResponse, handler, ex);
}
- } else {
+ }
+ else {
handleNonPostMethod(httpServletRequest, httpServletResponse, handler);
}
return null;
@@ -73,11 +77,11 @@ public class WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageRe
}
/**
- * Template method that is invoked when the request method is not {@code POST}. Called from
- * {@link #handle(HttpServletRequest, HttpServletResponse, Object)}.
+ * Template method that is invoked when the request method is not {@code POST}. Called
+ * from {@link #handle(HttpServletRequest, HttpServletResponse, Object)}.
*
- * Default implementation set the response status to 405: Method Not Allowed. Can be overridden in subclasses.
- *
+ * Default implementation set the response status to 405: Method Not Allowed. Can be
+ * overridden in subclasses.
* @param httpServletRequest current HTTP request
* @param httpServletResponse current HTTP response
* @param handler current handler
@@ -88,11 +92,12 @@ public class WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageRe
}
/**
- * Template method that is invoked when parsing the request results in a {@link InvalidXmlException}. Called from
+ * Template method that is invoked when parsing the request results in a
+ * {@link InvalidXmlException}. Called from
* {@link #handle(HttpServletRequest, HttpServletResponse, Object)}.
*
- * Default implementation set the response status to 400: Bad Request. Can be overridden in subclasses.
- *
+ * Default implementation set the response status to 400: Bad Request. Can be
+ * overridden in subclasses.
* @param httpServletRequest current HTTP request
* @param httpServletResponse current HTTP response
* @param handler current handler
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java
index 7acd4f0c..1faad98b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.transport.http;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
import java.util.HashMap;
import java.util.Map;
@@ -28,38 +25,44 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.w3c.dom.Document;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.ws.wsdl.WsdlDefinition;
import org.springframework.xml.xpath.XPathExpression;
import org.springframework.xml.xpath.XPathExpressionFactory;
-import org.w3c.dom.Document;
/**
- * Adapter to use the {@code WsdlDefinition} interface with the generic {@code DispatcherServlet}.
+ * Adapter to use the {@code WsdlDefinition} interface with the generic
+ * {@code DispatcherServlet}.
*
- * Reads the source from the mapped {@code WsdlDefinition} implementation, and writes that as the result to the
- * {@code HttpServletResponse}.
+ * Reads the source from the mapped {@code WsdlDefinition} implementation, and writes that
+ * as the result to the {@code HttpServletResponse}.
*
- * If the property {@code transformLocations} is set to {@code true}, this adapter will change {@code location}
- * attributes in the WSDL definition to reflect the URL of the incoming request. If the location field in the original
- * WSDL is an absolute path, the scheme, hostname, and port will be changed. If the location is a relative path, the
- * scheme, hostname, port, and context path will be prepended. This behavior can be customized by overriding the
- * {@code transformLocation()} method.
+ * If the property {@code transformLocations} is set to {@code true}, this adapter will
+ * change {@code location} attributes in the WSDL definition to reflect the URL of the
+ * incoming request. If the location field in the original WSDL is an absolute path, the
+ * scheme, hostname, and port will be changed. If the location is a relative path, the
+ * scheme, hostname, port, and context path will be prepended. This behavior can be
+ * customized by overriding the {@code transformLocation()} method.
*
* For instance, if the location attribute defined in the WSDL is
- * {@code http://localhost:8080/context/services/myService}, and the request URI for the WSDL is
- * {@code http://example.com/context/myService.wsdl}, the location will be changed to
- * {@code http://example.com/context/services/myService}.
+ * {@code http://localhost:8080/context/services/myService}, and the request URI for the
+ * WSDL is {@code http://example.com/context/myService.wsdl}, the location will be changed
+ * to {@code http://example.com/context/services/myService}.
*
- * If the location attribute defined in the WSDL is {@code /services/myService}, and the request URI for the WSDL is
- * {@code http://example.com:8080/context/myService.wsdl}, the location will be changed to
- * {@code http://example.com:8080/context/services/myService}.
+ * If the location attribute defined in the WSDL is {@code /services/myService}, and the
+ * request URI for the WSDL is {@code http://example.com:8080/context/myService.wsdl}, the
+ * location will be changed to {@code http://example.com:8080/context/services/myService}.
*
- * When {@code transformLocations} is enabled, all {@code location} attributes found in the WSDL definition are changed
- * by default. This behavior can be customized by changing the {@code locationExpression} property, which is an XPath
- * expression that matches the attributes to change.
+ * When {@code transformLocations} is enabled, all {@code location} attributes found in
+ * the WSDL definition are changed by default. This behavior can be customized by changing
+ * the {@code locationExpression} property, which is an XPath expression that matches the
+ * attributes to change.
*
* @author Arjen Poutsma
* @see WsdlDefinition
@@ -71,10 +74,16 @@ import org.w3c.dom.Document;
public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSupport
implements HandlerAdapter, InitializingBean {
- /** Default XPath expression used for extracting all {@code location} attributes from the WSDL definition. */
+ /**
+ * Default XPath expression used for extracting all {@code location} attributes from
+ * the WSDL definition.
+ */
public static final String DEFAULT_LOCATION_EXPRESSION = "//@location";
- /** Default XPath expression used for extracting all {@code schemaLocation} attributes from the WSDL definition. */
+ /**
+ * Default XPath expression used for extracting all {@code schemaLocation} attributes
+ * from the WSDL definition.
+ */
public static final String DEFAULT_SCHEMA_LOCATION_EXPRESSION = "//@schemaLocation";
private static final String CONTENT_TYPE = "text/xml";
@@ -94,7 +103,8 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
private boolean transformSchemaLocations = false;
/**
- * Sets the XPath expression used for extracting the {@code location} attributes from the WSDL 1.1 definition.
+ * Sets the XPath expression used for extracting the {@code location} attributes from
+ * the WSDL 1.1 definition.
*
* Defaults to {@code DEFAULT_LOCATION_EXPRESSION}.
*/
@@ -103,7 +113,8 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
}
/**
- * Sets the XPath expression used for extracting the {@code schemaLocation} attributes from the WSDL 1.1 definition.
+ * Sets the XPath expression used for extracting the {@code schemaLocation} attributes
+ * from the WSDL 1.1 definition.
*
* Defaults to {@code DEFAULT_SCHEMA_LOCATION_EXPRESSION}.
*/
@@ -112,16 +123,17 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
}
/**
- * Sets whether relative address locations in the WSDL are to be transformed using the request URI of the incoming
- * {@code HttpServletRequest}. Defaults to {@code false}.
+ * Sets whether relative address locations in the WSDL are to be transformed using the
+ * request URI of the incoming {@code HttpServletRequest}. Defaults to {@code false}.
*/
public void setTransformLocations(boolean transformLocations) {
this.transformLocations = transformLocations;
}
/**
- * Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the
- * incoming {@code HttpServletRequest}. Defaults to {@code false}.
+ * Sets whether relative address schema locations in the WSDL are to be transformed
+ * using the request URI of the incoming {@code HttpServletRequest}. Defaults to
+ * {@code false}.
*/
public void setTransformSchemaLocations(boolean transformSchemaLocations) {
this.transformSchemaLocations = transformSchemaLocations;
@@ -158,7 +170,8 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
response.setContentType(CONTENT_TYPE);
StreamResult responseResult = new StreamResult(response.getOutputStream());
transformer.transform(definitionSource, responseResult);
- } else {
+ }
+ else {
response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
}
return null;
@@ -171,18 +184,19 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
@Override
public void afterPropertiesSet() throws Exception {
- locationXPathExpression = XPathExpressionFactory.createXPathExpression(locationExpression, expressionNamespaces);
+ locationXPathExpression = XPathExpressionFactory.createXPathExpression(locationExpression,
+ expressionNamespaces);
schemaLocationXPathExpression = XPathExpressionFactory.createXPathExpression(schemaLocationExpression,
expressionNamespaces);
}
/**
- * Transforms all {@code location} attributes to reflect the server name given {@code HttpServletRequest}. Determines
- * the suitable attributes by evaluating the defined XPath expression, and delegates to {@code transformLocation} to
- * do the transformation for all attributes that match.
+ * Transforms all {@code location} attributes to reflect the server name given
+ * {@code HttpServletRequest}. Determines the suitable attributes by evaluating the
+ * defined XPath expression, and delegates to {@code transformLocation} to do the
+ * transformation for all attributes that match.
*
* This method is only called when the {@code transformLocations} property is true.
- *
* @see #setLocationExpression(String)
* @see #setTransformLocations(boolean)
* @see #transformLocation(String,jakarta.servlet.http.HttpServletRequest)
@@ -192,12 +206,13 @@ public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSuppo
}
/**
- * Transforms all {@code schemaLocation} attributes to reflect the server name given {@code HttpServletRequest}.
- * Determines the suitable attributes by evaluating the defined XPath expression, and delegates to
- * {@code transformLocation} to do the transformation for all attributes that match.
+ * Transforms all {@code schemaLocation} attributes to reflect the server name given
+ * {@code HttpServletRequest}. Determines the suitable attributes by evaluating the
+ * defined XPath expression, and delegates to {@code transformLocation} to do the
+ * transformation for all attributes that match.
*
- * This method is only called when the {@code transformSchemaLocations} property is true.
- *
+ * This method is only called when the {@code transformSchemaLocations} property is
+ * true.
* @see #setSchemaLocationExpression(String)
* @see #setTransformSchemaLocations(boolean)
* @see #transformLocation(String,jakarta.servlet.http.HttpServletRequest)
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
index 07473afa..df1abd95 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.transport.http;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
import java.util.HashMap;
import java.util.Map;
@@ -28,19 +25,24 @@ import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import org.w3c.dom.Document;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.xml.xpath.XPathExpression;
import org.springframework.xml.xpath.XPathExpressionFactory;
import org.springframework.xml.xsd.XsdSchema;
-import org.w3c.dom.Document;
/**
- * Adapter to use the {@link XsdSchema} interface with the generic {@code DispatcherServlet}.
+ * Adapter to use the {@link XsdSchema} interface with the generic
+ * {@code DispatcherServlet}.
*
- * Reads the source from the mapped {@link XsdSchema} implementation, and writes that as the result to the
- * {@code HttpServletResponse}. Allows for post-processing the schema in subclasses.
+ * Reads the source from the mapped {@link XsdSchema} implementation, and writes that as
+ * the result to the {@code HttpServletResponse}. Allows for post-processing the schema in
+ * subclasses.
*
* @author Arjen Poutsma
* @see XsdSchema
@@ -51,7 +53,8 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
implements HandlerAdapter, InitializingBean {
/**
- * Default XPath expression used for extracting all {@code schemaLocation} attributes from the WSDL definition.
+ * Default XPath expression used for extracting all {@code schemaLocation} attributes
+ * from the WSDL definition.
*/
public static final String DEFAULT_SCHEMA_LOCATION_EXPRESSION = "//@schemaLocation";
@@ -66,7 +69,8 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
private boolean transformSchemaLocations = false;
/**
- * Sets the XPath expression used for extracting the {@code schemaLocation} attributes from the WSDL 1.1 definition.
+ * Sets the XPath expression used for extracting the {@code schemaLocation} attributes
+ * from the WSDL 1.1 definition.
*
* Defaults to {@code DEFAULT_SCHEMA_LOCATION_EXPRESSION}.
*/
@@ -75,8 +79,9 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
}
/**
- * Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the
- * incoming {@code HttpServletRequest}. Defaults to {@code false}.
+ * Sets whether relative address schema locations in the WSDL are to be transformed
+ * using the request URI of the incoming {@code HttpServletRequest}. Defaults to
+ * {@code false}.
*/
public void setTransformSchemaLocations(boolean transformSchemaLocations) {
this.transformSchemaLocations = transformSchemaLocations;
@@ -106,7 +111,8 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
response.setContentType(CONTENT_TYPE);
StreamResult responseResult = new StreamResult(response.getOutputStream());
transformer.transform(schemaSource, responseResult);
- } else {
+ }
+ else {
response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
}
return null;
@@ -124,11 +130,10 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
}
/**
- * Returns the {@link Source} of the given schema. Allows for post-processing and transformation of the schema in
- * sub-classes.
+ * Returns the {@link Source} of the given schema. Allows for post-processing and
+ * transformation of the schema in sub-classes.
*
* Default implementation simply returns {@link XsdSchema#getSource()}.
- *
* @param schema the schema
* @return the source of the given schema
* @throws Exception in case of errors
@@ -138,12 +143,13 @@ public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport
}
/**
- * Transforms all {@code schemaLocation} attributes to reflect the server name given {@code HttpServletRequest}.
- * Determines the suitable attributes by evaluating the defined XPath expression, and delegates to {@code
+ * Transforms all {@code schemaLocation} attributes to reflect the server name given
+ * {@code HttpServletRequest}. Determines the suitable attributes by evaluating the
+ * defined XPath expression, and delegates to {@code
* transformLocation} to do the transformation for all attributes that match.
*
- * This method is only called when the {@code transformSchemaLocations} property is true.
- *
+ * This method is only called when the {@code transformSchemaLocations} property is
+ * true.
* @see #setSchemaLocationExpression(String)
* @see #transformLocation(String, jakarta.servlet.http.HttpServletRequest)
*/
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractAnnotationConfigMessageDispatcherServletInitializer.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractAnnotationConfigMessageDispatcherServletInitializer.java
index 86fccb8d..d457a6e5 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractAnnotationConfigMessageDispatcherServletInitializer.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractAnnotationConfigMessageDispatcherServletInitializer.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,12 +25,14 @@ import org.springframework.web.servlet.support.AbstractDispatcherServletInitiali
import org.springframework.ws.transport.http.MessageDispatcherServlet;
/**
- * Base class for {@link WebApplicationInitializer} implementations that register a {@link MessageDispatcherServlet}
- * configured with annotated classes, e.g. Spring's {@link Configuration @Configuration} classes.
+ * Base class for {@link WebApplicationInitializer} implementations that register a
+ * {@link MessageDispatcherServlet} configured with annotated classes, e.g. Spring's
+ * {@link Configuration @Configuration} classes.
*
* Concrete implementations are required to implement {@link #getRootConfigClasses()} and
- * {@link #getServletConfigClasses()} as well as {@link #getServletMappings()}. Further template and customization
- * methods are provided by {@link AbstractDispatcherServletInitializer}.
+ * {@link #getServletConfigClasses()} as well as {@link #getServletMappings()}. Further
+ * template and customization methods are provided by
+ * {@link AbstractDispatcherServletInitializer}.
*
* @author Arjen Poutsma
* @since 2.2
@@ -41,9 +43,9 @@ public abstract class AbstractAnnotationConfigMessageDispatcherServletInitialize
/**
* {@inheritDoc}
*
- * This implementation creates an {@link AnnotationConfigWebApplicationContext}, providing it the annotated classes
- * returned by {@link #getRootConfigClasses()}. Returns {@code null} if {@link #getRootConfigClasses()} returns
- * {@code null}.
+ * This implementation creates an {@link AnnotationConfigWebApplicationContext},
+ * providing it the annotated classes returned by {@link #getRootConfigClasses()}.
+ * Returns {@code null} if {@link #getRootConfigClasses()} returns {@code null}.
*/
@Override
protected WebApplicationContext createRootApplicationContext() {
@@ -52,7 +54,8 @@ public abstract class AbstractAnnotationConfigMessageDispatcherServletInitialize
AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext();
rootAppContext.register(configClasses);
return rootAppContext;
- } else {
+ }
+ else {
return null;
}
}
@@ -60,8 +63,8 @@ public abstract class AbstractAnnotationConfigMessageDispatcherServletInitialize
/**
* {@inheritDoc}
*
- * This implementation creates an {@link AnnotationConfigWebApplicationContext}, providing it the annotated classes
- * returned by {@link #getServletConfigClasses()}.
+ * This implementation creates an {@link AnnotationConfigWebApplicationContext},
+ * providing it the annotated classes returned by {@link #getServletConfigClasses()}.
*/
@Override
protected WebApplicationContext createServletApplicationContext() {
@@ -74,21 +77,22 @@ public abstract class AbstractAnnotationConfigMessageDispatcherServletInitialize
}
/**
- * Specify {@link org.springframework.context.annotation.Configuration @Configuration} and/or
- * {@link org.springframework.stereotype.Component @Component} classes to be provided to the
- * {@linkplain #createRootApplicationContext() root application context}.
- *
- * @return the configuration classes for the root application context, or {@code null} if creation and registration of
- * a root context is not desired
+ * Specify {@link org.springframework.context.annotation.Configuration @Configuration}
+ * and/or {@link org.springframework.stereotype.Component @Component} classes to be
+ * provided to the {@linkplain #createRootApplicationContext() root application
+ * context}.
+ * @return the configuration classes for the root application context, or {@code null}
+ * if creation and registration of a root context is not desired
*/
protected abstract Class>[] getRootConfigClasses();
/**
- * Specify {@link org.springframework.context.annotation.Configuration @Configuration} and/or
- * {@link org.springframework.stereotype.Component @Component} classes to be provided to the
- * {@linkplain #createServletApplicationContext() dispatcher servlet application context}.
- *
- * @return the configuration classes for the dispatcher servlet application context (may not be empty or {@code null})
+ * Specify {@link org.springframework.context.annotation.Configuration @Configuration}
+ * and/or {@link org.springframework.stereotype.Component @Component} classes to be
+ * provided to the {@linkplain #createServletApplicationContext() dispatcher servlet
+ * application context}.
+ * @return the configuration classes for the dispatcher servlet application context
+ * (may not be empty or {@code null})
*/
protected abstract Class>[] getServletConfigClasses();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer.java
index 6786198d..3f61273c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/http/support/AbstractMessageDispatcherServletInitializer.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,16 +26,19 @@ import org.springframework.web.context.WebApplicationContext;
import org.springframework.ws.transport.http.MessageDispatcherServlet;
/**
- * Base class for {@link org.springframework.web.WebApplicationInitializer WebApplicationInitializer} implementations
- * that register a {@link MessageDispatcherServlet} in the servlet context.
+ * Base class for {@link org.springframework.web.WebApplicationInitializer
+ * WebApplicationInitializer} implementations that register a
+ * {@link MessageDispatcherServlet} in the servlet context.
*
- * Concrete implementations are required to implement {@link #createServletApplicationContext()}, which gets invoked
- * from {@link #registerMessageDispatcherServlet(ServletContext)}. Further customization can be achieved by overriding
- * {@link #customizeRegistration(ServletRegistration.Dynamic)}.
+ * Concrete implementations are required to implement
+ * {@link #createServletApplicationContext()}, which gets invoked from
+ * {@link #registerMessageDispatcherServlet(ServletContext)}. Further customization can be
+ * achieved by overriding {@link #customizeRegistration(ServletRegistration.Dynamic)}.
*
- * Because this class extends from {@link AbstractContextLoaderInitializer}, concrete implementations are also required
- * to implement {@link #createRootApplicationContext()} to set up a parent "root" application context.
- * If a root context is not desired, implementations can simply return {@code null} in the
+ * Because this class extends from {@link AbstractContextLoaderInitializer}, concrete
+ * implementations are also required to implement {@link #createRootApplicationContext()}
+ * to set up a parent "root" application context. If a root context is
+ * not desired, implementations can simply return {@code null} in the
* {@code createRootApplicationContext()} implementation.
*
* @author Arjen Poutsma
@@ -49,7 +52,8 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
public static final String DEFAULT_SERVLET_NAME = "messageDispatcher";
/**
- * The default servlet mappings. Can be customized by overriding {@link #getServletMappings()}.
+ * The default servlet mappings. Can be customized by overriding
+ * {@link #getServletMappings()}.
*/
public static final String[] DEFAULT_SERVLET_MAPPINGS = new String[] { "/services", "*.wsdl" };
@@ -63,12 +67,13 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
/**
* Register a {@link MessageDispatcherServlet} against the given servlet context.
*
- * This method will create a {@code MessageDispatcherServlet} with the name returned by {@link #getServletName()},
- * initializing it with the application context returned from {@link #createServletApplicationContext()}, and mapping
- * it to the patterns returned from {@link #getServletMappings()}.
+ * This method will create a {@code MessageDispatcherServlet} with the name returned
+ * by {@link #getServletName()}, initializing it with the application context returned
+ * from {@link #createServletApplicationContext()}, and mapping it to the patterns
+ * returned from {@link #getServletMappings()}.
*
- * Further customization can be achieved by overriding {@link #customizeRegistration(ServletRegistration.Dynamic)}.
- *
+ * Further customization can be achieved by overriding
+ * {@link #customizeRegistration(ServletRegistration.Dynamic)}.
* @param servletContext the context to register the servlet against
*/
protected void registerMessageDispatcherServlet(ServletContext servletContext) {
@@ -95,9 +100,8 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
}
/**
- * Return the name under which the {@link MessageDispatcherServlet} will be registered. Defaults to
- * {@link #DEFAULT_SERVLET_NAME}.
- *
+ * Return the name under which the {@link MessageDispatcherServlet} will be
+ * registered. Defaults to {@link #DEFAULT_SERVLET_NAME}.
* @see #registerMessageDispatcherServlet(ServletContext)
*/
protected String getServletName() {
@@ -105,20 +109,20 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
}
/**
- * Create a servlet application context to be provided to the {@code MessageDispatcherServlet}.
+ * Create a servlet application context to be provided to the
+ * {@code MessageDispatcherServlet}.
*
* The returned context is delegated to Spring's
- * {@link MessageDispatcherServlet#MessageDispatcherServlet(WebApplicationContext)}. As such, it typically contains
- * endpoints, interceptors and other web service-related beans.
- *
+ * {@link MessageDispatcherServlet#MessageDispatcherServlet(WebApplicationContext)}.
+ * As such, it typically contains endpoints, interceptors and other web
+ * service-related beans.
* @see #registerMessageDispatcherServlet(ServletContext)
*/
protected abstract WebApplicationContext createServletApplicationContext();
/**
- * Specify the servlet mapping(s) for the {@code MessageDispatcherServlet}. Defaults to
- * {@link #DEFAULT_SERVLET_MAPPINGS}.
- *
+ * Specify the servlet mapping(s) for the {@code MessageDispatcherServlet}. Defaults
+ * to {@link #DEFAULT_SERVLET_MAPPINGS}.
* @see #registerMessageDispatcherServlet(ServletContext)
*/
protected String[] getServletMappings() {
@@ -126,16 +130,16 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
}
/**
- * Indicates whether relative address locations in the WSDL are to be transformed using the request URI of the
- * incoming HTTP request. Defaults to {@code false}.
+ * Indicates whether relative address locations in the WSDL are to be transformed
+ * using the request URI of the incoming HTTP request. Defaults to {@code false}.
*/
public boolean isTransformWsdlLocations() {
return false;
}
/**
- * Indicates whether relative address locations in the XSD are to be transformed using the request URI of the incoming
- * HTTP request. Defaults to {@code false}.
+ * Indicates whether relative address locations in the XSD are to be transformed using
+ * the request URI of the incoming HTTP request. Defaults to {@code false}.
*/
protected boolean isTransformSchemaLocations() {
return false;
@@ -144,10 +148,11 @@ public abstract class AbstractMessageDispatcherServletInitializer extends Abstra
/**
* Optionally perform further registration customization once
* {@link #registerMessageDispatcherServlet(ServletContext)} has completed.
- *
- * @param registration the {@code MessageDispatcherServlet} registration to be customized
+ * @param registration the {@code MessageDispatcherServlet} registration to be
+ * customized
* @see #registerMessageDispatcherServlet(ServletContext)
*/
- protected void customizeRegistration(ServletRegistration.Dynamic registration) {}
+ protected void customizeRegistration(ServletRegistration.Dynamic registration) {
+ }
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java
index de6847df..6bbe4b5c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/EnumerationIterator.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -47,4 +47,5 @@ public class EnumerationIterator implements Iterator {
public void remove() {
throw new UnsupportedOperationException();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/TransportUtils.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/TransportUtils.java
index b6d43f7e..cf7a6c62 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/TransportUtils.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/TransportUtils.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,10 +20,12 @@ import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.ws.transport.WebServiceConnection;
/**
- * Generic utility methods for working with Web service transports. Mainly for internal use within the framework.
+ * Generic utility methods for working with Web service transports. Mainly for internal
+ * use within the framework.
*
* @author Arjen Poutsma
* @since 1.5.0
@@ -33,18 +35,19 @@ public abstract class TransportUtils {
private static final Log logger = LogFactory.getLog(TransportUtils.class);
/**
- * Close the given {@link WebServiceConnection} and ignore any thrown exception. This is useful for typical
- * {@code finally} blocks.
- *
+ * Close the given {@link WebServiceConnection} and ignore any thrown exception. This
+ * is useful for typical {@code finally} blocks.
* @param connection the web service connection to close (may be {@code null})
*/
public static void closeConnection(WebServiceConnection connection) {
if (connection != null) {
try {
connection.close();
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
logger.debug("Could not close WebServiceConnection", ex);
- } catch (Throwable ex) {
+ }
+ catch (Throwable ex) {
logger.debug("Unexpected exception on closing WebServiceConnection", ex);
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java
index e8f83804..5b3ae71b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/transport/support/WebServiceMessageReceiverObjectSupport.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,6 +20,7 @@ import java.net.URISyntaxException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.ws.FaultAwareWebServiceMessage;
@@ -37,8 +38,9 @@ import org.springframework.ws.transport.context.TransportContext;
import org.springframework.ws.transport.context.TransportContextHolder;
/**
- * Convenience base class for server-side transport objects. Contains a {@link WebServiceMessageFactory}, and has
- * methods for handling incoming {@link WebServiceConnection}s.
+ * Convenience base class for server-side transport objects. Contains a
+ * {@link WebServiceMessageFactory}, and has methods for handling incoming
+ * {@link WebServiceConnection}s.
*
* @author Arjen Poutsma
* @see #handleConnection
@@ -67,14 +69,16 @@ public abstract class WebServiceMessageReceiverObjectSupport implements Initiali
}
/**
- * Handles an incoming connection by {@link WebServiceConnection#receive(WebServiceMessageFactory) receving} a message
- * from it, passing it to the {@link WebServiceMessageReceiver#receive(MessageContext) receiver}, and
- * {@link WebServiceConnection#send(WebServiceMessage) sending} the response (if any).
+ * Handles an incoming connection by
+ * {@link WebServiceConnection#receive(WebServiceMessageFactory) receving} a message
+ * from it, passing it to the {@link WebServiceMessageReceiver#receive(MessageContext)
+ * receiver}, and {@link WebServiceConnection#send(WebServiceMessage) sending} the
+ * response (if any).
*
* Stores the given connection in the {@link TransportContext}.
- *
* @param connection the incoming connection
- * @param receiver the handler of the message, typically a {@link org.springframework.ws.server.MessageDispatcher}
+ * @param receiver the handler of the message, typically a
+ * {@link org.springframework.ws.server.MessageDispatcher}
*/
protected final void handleConnection(WebServiceConnection connection, WebServiceMessageReceiver receiver)
throws Exception {
@@ -88,16 +92,19 @@ public abstract class WebServiceMessageReceiverObjectSupport implements Initiali
receiver.receive(messageContext);
if (messageContext.hasResponse()) {
WebServiceMessage response = messageContext.getResponse();
- if (response instanceof FaultAwareWebServiceMessage && connection instanceof FaultAwareWebServiceConnection) {
+ if (response instanceof FaultAwareWebServiceMessage
+ && connection instanceof FaultAwareWebServiceConnection) {
FaultAwareWebServiceMessage faultResponse = (FaultAwareWebServiceMessage) response;
FaultAwareWebServiceConnection faultConnection = (FaultAwareWebServiceConnection) connection;
faultConnection.setFaultCode(faultResponse.getFaultCode());
}
connection.send(messageContext.getResponse());
}
- } catch (NoEndpointFoundException ex) {
+ }
+ catch (NoEndpointFoundException ex) {
handleNoEndpointFoundException(ex, connection, receiver);
- } finally {
+ }
+ finally {
TransportUtils.closeConnection(connection);
TransportContextHolder.setTransportContext(previousTransportContext);
}
@@ -106,9 +113,9 @@ public abstract class WebServiceMessageReceiverObjectSupport implements Initiali
/**
* Template method for handling {@code NoEndpointFoundException}s.
*
- * Default implementation calls {@link EndpointAwareWebServiceConnection#endpointNotFound()} on the given connection,
- * if possible.
- *
+ * Default implementation calls
+ * {@link EndpointAwareWebServiceConnection#endpointNotFound()} on the given
+ * connection, if possible.
* @param ex the {@code NoEndpointFoundException}
* @param connection the current {@code WebServiceConnection}
* @param receiver the {@code WebServiceMessageReceiver}
@@ -125,7 +132,8 @@ public abstract class WebServiceMessageReceiverObjectSupport implements Initiali
if (logger.isDebugEnabled()) {
try {
logger.debug("Accepting incoming [" + connection + "] at [" + connection.getUri() + "]");
- } catch (URISyntaxException e) {
+ }
+ catch (URISyntaxException e) {
// ignore
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinition.java
index aee08576..101b9d75 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinition.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinition.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,7 +28,6 @@ public interface WsdlDefinition {
/**
* Returns the {@code Source} of the definition.
- *
* @return the {@code Source} of this WSDL definition
*/
Source getSource();
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java
index f6026d12..b08b3937 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/WsdlDefinitionException.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,4 +34,5 @@ public class WsdlDefinitionException extends WebServiceException {
public WsdlDefinitionException(String reason, Throwable throwable) {
super(reason, throwable);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java
index 80f36205..ec46690c 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/DefaultWsdl11Definition.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,9 +31,10 @@ import org.springframework.xml.xsd.XsdSchema;
import org.springframework.xml.xsd.XsdSchemaCollection;
/**
- * Convenient implementation of {@link Wsdl11Definition} that creates a SOAP 1.1 or 1.2 binding based on naming
- * conventions in one or more inlined XSD schemas. Delegates to {@link InliningXsdSchemaTypesProvider},
- * {@link DefaultMessagesProvider}, {@link SuffixBasedPortTypesProvider}, {@link SoapProvider} underneath; effectively
+ * Convenient implementation of {@link Wsdl11Definition} that creates a SOAP 1.1 or 1.2
+ * binding based on naming conventions in one or more inlined XSD schemas. Delegates to
+ * {@link InliningXsdSchemaTypesProvider}, {@link DefaultMessagesProvider},
+ * {@link SuffixBasedPortTypesProvider}, {@link SoapProvider} underneath; effectively
* equivalent to using a {@link ProviderBasedWsdl4jDefinition} with all these providers.
*
* Example configuration:
@@ -86,16 +87,16 @@ public class DefaultWsdl11Definition implements Wsdl11Definition, InitializingBe
}
/**
- * Sets the single XSD schema to inline. Either this property, or {@link #setSchemaCollection(XsdSchemaCollection)
- * schemaCollection} must be set.
+ * Sets the single XSD schema to inline. Either this property, or
+ * {@link #setSchemaCollection(XsdSchemaCollection) schemaCollection} must be set.
*/
public void setSchema(XsdSchema schema) {
typesProvider.setSchema(schema);
}
/**
- * Sets the XSD schema collection to inline. Either this property, or {@link #setSchema(XsdSchema) schema} must be
- * set.
+ * Sets the XSD schema collection to inline. Either this property, or
+ * {@link #setSchema(XsdSchema) schema} must be set.
*/
public void setSchemaCollection(XsdSchemaCollection schemaCollection) {
typesProvider.setSchemaCollection(schemaCollection);
@@ -143,16 +144,19 @@ public class DefaultWsdl11Definition implements Wsdl11Definition, InitializingBe
}
/**
- * Sets the SOAP Actions for this binding. Keys are {@link javax.wsdl.BindingOperation#getName() binding operation
- * names}; values are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Sets the SOAP Actions for this binding. Keys are
+ * {@link javax.wsdl.BindingOperation#getName() binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @param soapActions the soap
*/
public void setSoapActions(Properties soapActions) {
soapProvider.setSoapActions(soapActions);
}
- /** Sets the value used for the binding transport attribute value. Defaults to HTTP. */
+ /**
+ * Sets the value used for the binding transport attribute value. Defaults to HTTP.
+ */
public void setTransportUri(String transportUri) {
soapProvider.setTransportUri(transportUri);
}
@@ -189,4 +193,5 @@ public class DefaultWsdl11Definition implements Wsdl11Definition, InitializingBe
public Source getSource() {
return delegate.getSource();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java
index 28294e09..9c79d21f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/ProviderBasedWsdl4jDefinition.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,11 +30,12 @@ import org.springframework.ws.wsdl.wsdl11.provider.ServicesProvider;
import org.springframework.ws.wsdl.wsdl11.provider.TypesProvider;
/**
- * Implementation of the {@link Wsdl11Definition} that uses a provider-based mechanism to populate a WSDL4J
- * {@link Definition}.
+ * Implementation of the {@link Wsdl11Definition} that uses a provider-based mechanism to
+ * populate a WSDL4J {@link Definition}.
*
- * All providers are optional, indicating that a particular part of the WSDL will not be created. Providers can be set
- * via various properties. The providers are {@link #afterPropertiesSet() invoked} in the following order:
+ * All providers are optional, indicating that a particular part of the WSDL will not be
+ * created. Providers can be set via various properties. The providers are
+ * {@link #afterPropertiesSet() invoked} in the following order:
*
- * This definition requires the target namespace to be set via {@link #setTargetNamespace(String)}
+ * This definition requires the target namespace to be set via
+ * {@link #setTargetNamespace(String)}
*
* @author Arjen Poutsma
* @see #setImportsProvider(ImportsProvider)
@@ -78,7 +80,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
* Returns the {@link ImportsProvider} for this definition.
*
* Default is {@code null}, indicating that no {@code <import>} will be created
- *
* @return the import provider; or {@code null}
*/
public ImportsProvider getImportsProvider() {
@@ -89,7 +90,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
* Sets the {@link ImportsProvider} for this definition.
*
* Default is {@code null}, indicating that no {@code <import>} will be created
- *
* @param importsProvider the import provider
*/
public void setImportsProvider(ImportsProvider importsProvider) {
@@ -100,7 +100,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
* Returns the {@link TypesProvider} for this definition.
*
* Defaults to {@code null}, indicating that no {@code <types>} will be created
- *
* @return the types provider; or {@code null}
*/
public TypesProvider getTypesProvider() {
@@ -111,7 +110,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
* Sets the {@link TypesProvider} for this definition.
*
* Defaults to {@code null}, indicating that no {@code <types>} will be created
- *
* @param typesProvider the types provider; or {@code null}
*/
public void setTypesProvider(TypesProvider typesProvider) {
@@ -121,8 +119,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Returns the {@link MessagesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <message>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <message>} will be
+ * created
* @return the messages provider; or {@code null}
*/
public MessagesProvider getMessagesProvider() {
@@ -132,8 +130,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Sets the {@link MessagesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <message>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <message>} will be
+ * created
* @param messagesProvider the messages provider; or {@code null}
*/
public void setMessagesProvider(MessagesProvider messagesProvider) {
@@ -143,8 +141,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Returns the {@link PortTypesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <portType>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <portType>} will be
+ * created
* @return the port types provider; or {@code null}
*/
public PortTypesProvider getPortTypesProvider() {
@@ -154,8 +152,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Sets the {@link PortTypesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <portType>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <portType>} will be
+ * created
* @param portTypesProvider the port types provider; or {@code null}
*/
public void setPortTypesProvider(PortTypesProvider portTypesProvider) {
@@ -165,8 +163,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Returns the {@link BindingsProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <binding>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <binding>} will be
+ * created
* @return the binding provider; or {@code null}
*/
public BindingsProvider getBindingsProvider() {
@@ -176,8 +174,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Sets the {@link BindingsProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <binding>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <binding>} will be
+ * created
* @param bindingsProvider the bindings provider; or {@code null}
*/
public void setBindingsProvider(BindingsProvider bindingsProvider) {
@@ -187,8 +185,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Returns the {@link ServicesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <service>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <service>} will be
+ * created
* @return the services provider; or {@code null}
*/
public ServicesProvider getServicesProvider() {
@@ -198,8 +196,8 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Sets the {@link ServicesProvider} for this definition.
*
- * Defaults to {@code null}, indicating that no {@code <service>} will be created
- *
+ * Defaults to {@code null}, indicating that no {@code <service>} will be
+ * created
* @param servicesProvider the services provider; or {@code null}
*/
public void setServicesProvider(ServicesProvider servicesProvider) {
@@ -208,7 +206,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Returns the target namespace for the WSDL definition.
- *
* @return the target namespace
* @see javax.wsdl.Definition#getTargetNamespace()
*/
@@ -218,7 +215,6 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
/**
* Sets the target namespace used for this definition. Required.
- *
* @param targetNamespace the target namespace
* @see javax.wsdl.Definition#setTargetNamespace(String)
*/
@@ -253,4 +249,5 @@ public class ProviderBasedWsdl4jDefinition extends Wsdl4jDefinition implements I
}
setDefinition(definition);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java
index 3f4ea159..4a8bfccb 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/SimpleWsdl11Definition.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,14 +20,15 @@ import java.io.IOException;
import javax.xml.transform.Source;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.ws.wsdl.WsdlDefinitionException;
import org.springframework.xml.transform.ResourceSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
/**
* The default {@link Wsdl11Definition} implementation.
@@ -47,13 +48,15 @@ public class SimpleWsdl11Definition implements Wsdl11Definition, InitializingBea
*
* A subsequent call to the {@link #setWsdl(Resource)} method is required.
*/
- public SimpleWsdl11Definition() {}
+ public SimpleWsdl11Definition() {
+ }
/**
- * Create a new instance of the {@link SimpleWsdl11Definition} class with the specified resource.
- *
+ * Create a new instance of the {@link SimpleWsdl11Definition} class with the
+ * specified resource.
* @param wsdlResource the WSDL resource; must not be {@code null}
- * @throws IllegalArgumentException if the supplied {@code wsdlResource} is {@code null}
+ * @throws IllegalArgumentException if the supplied {@code wsdlResource} is
+ * {@code null}
*/
public SimpleWsdl11Definition(Resource wsdlResource) {
Assert.notNull(wsdlResource, "wsdlResource must not be null");
@@ -72,16 +75,18 @@ public class SimpleWsdl11Definition implements Wsdl11Definition, InitializingBea
XMLReader xmlReader = XMLReaderFactory.createXMLReader();
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
return new ResourceSource(xmlReader, wsdlResource);
- } catch (SAXException ex) {
+ }
+ catch (SAXException ex) {
throw new WsdlDefinitionException("Could not create XMLReader", ex);
- } catch (IOException ex) {
+ }
+ catch (IOException ex) {
throw new WsdlDefinitionException("Could not create source from " + this.wsdlResource, ex);
}
}
/**
- * Set the WSDL resource to be exposed by calls to this instances' {@link #getSource()} method.
- *
+ * Set the WSDL resource to be exposed by calls to this instances'
+ * {@link #getSource()} method.
* @param wsdlResource the WSDL resource
*/
public void setWsdl(Resource wsdlResource) {
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java
index b4bfb486..453df942 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/Wsdl4jDefinition.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,14 +23,16 @@ import javax.wsdl.xml.WSDLWriter;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
+import org.w3c.dom.Document;
+
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.ws.wsdl.WsdlDefinitionException;
-import org.w3c.dom.Document;
/**
- * Implementation of the {@code Wsdl11Definition} based on WSDL4J. A {@link javax.wsdl.Definition} can be given as as
- * constructor argument, or set using a property.
+ * Implementation of the {@code Wsdl11Definition} based on WSDL4J. A
+ * {@link javax.wsdl.Definition} can be given as as constructor argument, or set using a
+ * property.
*
* @author Arjen Poutsma
* @author Greg Turnquist
@@ -47,14 +49,13 @@ public class Wsdl4jDefinition implements Wsdl11Definition {
/**
* Constructs a new, empty {@code Wsdl4jDefinition}.
- *
* @see #setDefinition(javax.wsdl.Definition)
*/
- public Wsdl4jDefinition() {}
+ public Wsdl4jDefinition() {
+ }
/**
* Constructs a new {@code Wsdl4jDefinition} based on the given {@code Definition}.
- *
* @param definition the WSDL4J definition
*/
public Wsdl4jDefinition(Definition definition) {
@@ -84,7 +85,8 @@ public class Wsdl4jDefinition implements Wsdl11Definition {
WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
Document document = wsdlWriter.getDocument(definition);
return new DOMSource(document);
- } catch (WSDLException ex) {
+ }
+ catch (WSDLException ex) {
throw new WsdlDefinitionException(ex.getMessage(), ex);
}
}
@@ -99,4 +101,5 @@ public class Wsdl4jDefinition implements Wsdl11Definition {
}
return builder.toString();
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java
index edf10c26..39e4ecf4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/AbstractPortTypesProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,6 +31,7 @@ import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@@ -60,8 +61,8 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
}
/**
- * Creates a single {@link PortType}, and calls {@link #populatePortType(Definition, PortType)} with it.
- *
+ * Creates a single {@link PortType}, and calls
+ * {@link #populatePortType(Definition, PortType)} with it.
* @param definition the WSDL4J {@code Definition}
* @throws WSDLException in case of errors
*/
@@ -81,7 +82,6 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
* Called after the {@link PortType} has been created.
*
* Default implementation sets the name of the port type to the defined value.
- *
* @param portType the WSDL4J {@code PortType}
* @throws WSDLException in case of errors
* @see #setPortTypeName(String)
@@ -122,12 +122,14 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
input.setMessage(message);
populateInput(definition, input);
operation.setInput(input);
- } else if (isOutputMessage(message)) {
+ }
+ else if (isOutputMessage(message)) {
Output output = definition.createOutput();
output.setMessage(message);
populateOutput(definition, output);
operation.setOutput(output);
- } else if (isFaultMessage(message)) {
+ }
+ else if (isFaultMessage(message)) {
Fault fault = definition.createFault();
fault.setMessage(message);
populateFault(definition, fault);
@@ -137,35 +139,35 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
operation.setStyle(getOperationType(operation));
operation.setUndefined(false);
if (logger.isDebugEnabled()) {
- logger.debug("Adding operation [" + operation.getName() + "] to port type [" + portType.getQName() + "]");
+ logger
+ .debug("Adding operation [" + operation.getName() + "] to port type [" + portType.getQName() + "]");
}
portType.addOperation(operation);
}
}
/**
- * Template method that returns the name of the operation coupled to the given {@link Message}. Subclasses can return
- * {@code null} to indicate that a message should not be coupled to an operation.
- *
+ * Template method that returns the name of the operation coupled to the given
+ * {@link Message}. Subclasses can return {@code null} to indicate that a message
+ * should not be coupled to an operation.
* @param message the WSDL4J {@code Message}
* @return the operation name; or {@code null}
*/
protected abstract String getOperationName(Message message);
/**
- * Indicates whether the given name name should be included as {@link Input} message in the definition.
- *
+ * Indicates whether the given name name should be included as {@link Input} message
+ * in the definition.
* @param message the message
* @return {@code true} if to be included as input; {@code false} otherwise
*/
protected abstract boolean isInputMessage(Message message);
/**
- * Called after the {@link javax.wsdl.Input} has been created, but it's added to the operation. Subclasses can
- * override this method to define the input name.
+ * Called after the {@link javax.wsdl.Input} has been created, but it's added to the
+ * operation. Subclasses can override this method to define the input name.
*
* Default implementation sets the input name to the message name.
- *
* @param definition the WSDL4J {@code Definition}
* @param input the WSDL4J {@code Input}
*/
@@ -174,19 +176,18 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
}
/**
- * Indicates whether the given name name should be included as {@link Output} message in the definition.
- *
+ * Indicates whether the given name name should be included as {@link Output} message
+ * in the definition.
* @param message the message
* @return {@code true} if to be included as output; {@code false} otherwise
*/
protected abstract boolean isOutputMessage(Message message);
/**
- * Called after the {@link javax.wsdl.Output} has been created, but it's added to the operation. Subclasses can
- * override this method to define the output name.
+ * Called after the {@link javax.wsdl.Output} has been created, but it's added to the
+ * operation. Subclasses can override this method to define the output name.
*
* Default implementation sets the output name to the message name.
- *
* @param definition the WSDL4J {@code Definition}
* @param output the WSDL4J {@code Output}
*/
@@ -195,19 +196,18 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
}
/**
- * Indicates whether the given name name should be included as {@link Fault} message in the definition.
- *
+ * Indicates whether the given name name should be included as {@link Fault} message
+ * in the definition.
* @param message the message
* @return {@code true} if to be included as fault; {@code false} otherwise
*/
protected abstract boolean isFaultMessage(Message message);
/**
- * Called after the {@link javax.wsdl.Fault} has been created, but it's added to the operation. Subclasses can
- * override this method to define the fault name.
+ * Called after the {@link javax.wsdl.Fault} has been created, but it's added to the
+ * operation. Subclasses can override this method to define the fault name.
*
* Default implementation sets the fault name to the message name.
- *
* @param definition the WSDL4J {@code Definition}
* @param fault the WSDL4J {@code Fault}
*/
@@ -218,9 +218,9 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
/**
* Returns the {@link OperationType} for the given operation.
*
- * Default implementation returns {@link OperationType#REQUEST_RESPONSE} if both input and output are set;
- * {@link OperationType#ONE_WAY} if only input is set, or {@link OperationType#NOTIFICATION} if only output is set.
- *
+ * Default implementation returns {@link OperationType#REQUEST_RESPONSE} if both input
+ * and output are set; {@link OperationType#ONE_WAY} if only input is set, or
+ * {@link OperationType#NOTIFICATION} if only output is set.
* @param operation the WSDL4J {@code Operation}
* @return the operation type for the operation
*/
@@ -228,11 +228,14 @@ public abstract class AbstractPortTypesProvider implements PortTypesProvider {
if (operation.getInput() != null && operation.getOutput() != null) {
return OperationType.REQUEST_RESPONSE;
- } else if (operation.getInput() != null && operation.getOutput() == null) {
+ }
+ else if (operation.getInput() != null && operation.getOutput() == null) {
return OperationType.ONE_WAY;
- } else if (operation.getInput() == null && operation.getOutput() != null) {
+ }
+ else if (operation.getInput() == null && operation.getOutput() != null) {
return OperationType.NOTIFICATION;
- } else {
+ }
+ else {
return null;
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java
index 7cc3a207..08a14ea4 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultConcretePartProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,36 @@
package org.springframework.ws.wsdl.wsdl11.provider;
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Operation;
+import javax.wsdl.OperationType;
+import javax.wsdl.Output;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.WSDLException;
import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
- * Default implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces.
+ * Default implementation of the {@link BindingsProvider} and {@link ServicesProvider}
+ * interfaces.
*
- * Creates a {@code binding} that matches any present {@code portType}, and a service containing {@code port}s that
- * match the {@code binding}s. Lets subclasses populate these through template methods. *
+ * Creates a {@code binding} that matches any present {@code portType}, and a service
+ * containing {@code port}s that match the {@code binding}s. Lets subclasses populate
+ * these through template methods. *
*
* @author Arjen Poutsma
* @since 1.5.0
@@ -68,11 +85,11 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
/**
* Creates a {@link Binding} for each {@link PortType} in the definition, and calls
- * {@link #populateBinding(Definition,javax.wsdl.Binding)} with it. Creates a {@link BindingOperation} for each
- * {@link Operation} in the port type, a {@link BindingInput} for each {@link Input} in the operation, etc.
+ * {@link #populateBinding(Definition,javax.wsdl.Binding)} with it. Creates a
+ * {@link BindingOperation} for each {@link Operation} in the port type, a
+ * {@link BindingInput} for each {@link Input} in the operation, etc.
*
* Calls the various {@code populate} methods with the created WSDL4J objects.
- *
* @param definition the WSDL4J {@code Definition}
* @throws WSDLException in case of errors
* @see #populateBinding(Definition,javax.wsdl.Binding)
@@ -104,12 +121,12 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
- * this method to define the binding name, or add extensions to it.
+ * Called after the {@link Binding} has been created, but before any sub-elements are
+ * added. Subclasses can override this method to define the binding name, or add
+ * extensions to it.
*
- * Default implementation sets the binding name to the port type name with the {@link #getBindingSuffix() suffix}
- * appended to it.
- *
+ * Default implementation sets the binding name to the port type name with the
+ * {@link #getBindingSuffix() suffix} appended to it.
* @param definition the WSDL4J {@code Definition}
* @param binding the WSDL4J {@code Binding}
*/
@@ -119,7 +136,8 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
if (portTypeName != null) {
- QName bindingName = new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + getBindingSuffix());
+ QName bindingName = new QName(portTypeName.getNamespaceURI(),
+ portTypeName.getLocalPart() + getBindingSuffix());
if (logger.isDebugEnabled()) {
logger.debug("Creating binding [" + bindingName + "]");
}
@@ -141,11 +159,14 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
if (OperationType.REQUEST_RESPONSE.equals(operation.getStyle())) {
createBindingInput(definition, operation, bindingOperation);
createBindingOutput(definition, operation, bindingOperation);
- } else if (OperationType.ONE_WAY.equals(operation.getStyle())) {
+ }
+ else if (OperationType.ONE_WAY.equals(operation.getStyle())) {
createBindingInput(definition, operation, bindingOperation);
- } else if (OperationType.NOTIFICATION.equals(operation.getStyle())) {
+ }
+ else if (OperationType.NOTIFICATION.equals(operation.getStyle())) {
createBindingOutput(definition, operation, bindingOperation);
- } else if (OperationType.SOLICIT_RESPONSE.equals(operation.getStyle())) {
+ }
+ else if (OperationType.SOLICIT_RESPONSE.equals(operation.getStyle())) {
createBindingOutput(definition, operation, bindingOperation);
createBindingInput(definition, operation, bindingOperation);
}
@@ -164,11 +185,12 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link BindingOperation} has been created, but before any sub-elements are added. Subclasses can
- * override this method to define the binding name, or add extensions to it.
+ * Called after the {@link BindingOperation} has been created, but before any
+ * sub-elements are added. Subclasses can override this method to define the binding
+ * name, or add extensions to it.
*
- * Default implementation sets the name of the binding operation to the name of the operation.
- *
+ * Default implementation sets the name of the binding operation to the name of the
+ * operation.
* @param definition the WSDL4J {@code Definition}
* @param bindingOperation the WSDL4J {@code BindingOperation}
* @throws WSDLException in case of errors
@@ -195,14 +217,14 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link BindingInput} has been created. Subclasses can override this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingInput} has been created. Subclasses can override
+ * this method to define the name, or add extensions to it.
*
* Default implementation set the name of the binding input to the name of the input.
- *
* @param definition the WSDL4J {@code Definition}
* @param bindingInput the WSDL4J {@code BindingInput}
- * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case of errors
+ * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case
+ * of errors
*/
protected void populateBindingInput(Definition definition, BindingInput bindingInput, Input input)
throws WSDLException {
@@ -210,14 +232,15 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link BindingOutput} has been created. Subclasses can override this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingOutput} has been created. Subclasses can override
+ * this method to define the name, or add extensions to it.
*
- * Default implementation sets the name of the binding output to the name of the output.
- *
+ * Default implementation sets the name of the binding output to the name of the
+ * output.
* @param definition the WSDL4J {@code Definition}
* @param bindingOutput the WSDL4J {@code BindingOutput}
- * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case of errors
+ * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case
+ * of errors
*/
protected void populateBindingOutput(Definition definition, BindingOutput bindingOutput, Output output)
throws WSDLException {
@@ -225,13 +248,13 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link BindingFault} has been created. Subclasses can implement this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingFault} has been created. Subclasses can implement
+ * this method to define the name, or add extensions to it.
*
* Default implementation set the name of the binding fault to the name of the fault.
- *
* @param bindingFault the WSDL4J {@code BindingFault}
- * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case of errors
+ * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case
+ * of errors
*/
protected void populateBindingFault(Definition definition, BindingFault bindingFault, Fault fault)
throws WSDLException {
@@ -239,10 +262,10 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Creates a single {@link Service} if not present, and calls {@link #populateService(Definition, Service)} with it.
- * Creates a corresponding {@link Port} for each {@link Binding}, which is passed to
+ * Creates a single {@link Service} if not present, and calls
+ * {@link #populateService(Definition, Service)} with it. Creates a corresponding
+ * {@link Port} for each {@link Binding}, which is passed to
* {@link #populatePort(javax.wsdl.Definition,javax.wsdl.Port)}.
- *
* @param definition the WSDL4J {@code Definition}
* @throws WSDLException in case of errors
*/
@@ -254,7 +277,8 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
Service service;
if (definition.getServices().isEmpty()) {
service = definition.createService();
- } else {
+ }
+ else {
service = (Service) definition.getServices().values().iterator().next();
}
@@ -267,11 +291,12 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link Service} has been created, but before any sub-elements are added. Subclasses can implement
- * this method to define the service name, or add extensions to it.
+ * Called after the {@link Service} has been created, but before any sub-elements are
+ * added. Subclasses can implement this method to define the service name, or add
+ * extensions to it.
*
- * Default implementation sets the name to the {@link #setServiceName(String) serviceName} property.
- *
+ * Default implementation sets the name to the {@link #setServiceName(String)
+ * serviceName} property.
* @param service the WSDL4J {@code Service}
* @throws WSDLException in case of errors
*/
@@ -316,11 +341,11 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
}
/**
- * Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
- * this method to define the port name, or add extensions to it.
+ * Called after the {@link Port} has been created, but before any sub-elements are
+ * added. Subclasses can implement this method to define the port name, or add
+ * extensions to it.
*
* Default implementation sets the port name to the binding name.
- *
* @param definition the WSDL4J {@code Definition}
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
@@ -330,4 +355,5 @@ public class DefaultConcretePartProvider implements BindingsProvider, ServicesPr
String portName = port.getBinding().getQName().getLocalPart();
port.setName(portName);
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java
index 3dc7b6f4..c3c7ba0a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/DefaultMessagesProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,11 +27,12 @@ import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.util.Assert;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.springframework.util.Assert;
+
/**
* Default implementation of the {@link MessagesProvider}.
*
@@ -97,7 +98,6 @@ public class DefaultMessagesProvider implements MessagesProvider {
/**
* Returns the name attribute of the given element.
- *
* @param element the element whose name to return
* @return the name of the element
*/
@@ -106,11 +106,11 @@ public class DefaultMessagesProvider implements MessagesProvider {
}
/**
- * Indicates whether the given element should be includes as {@link Message} in the definition.
+ * Indicates whether the given element should be includes as {@link Message} in the
+ * definition.
*
- * Default implementation checks whether the element has the XML Schema namespace, and if it has the local name
- * "element".
- *
+ * Default implementation checks whether the element has the XML Schema namespace, and
+ * if it has the local name "element".
* @param element the element elligable for being a message
* @return {@code true} if to be included as message; {@code false} otherwise
*/
@@ -124,7 +124,6 @@ public class DefaultMessagesProvider implements MessagesProvider {
* Called after the {@link Message} has been created.
*
* Default implementation sets the name of the message to the element name.
- *
* @param definition the WSDL4J {@code Definition}
* @param message the WSDL4J {@code Message}
* @param elementName the element name
@@ -143,7 +142,6 @@ public class DefaultMessagesProvider implements MessagesProvider {
* Called after the {@link Part} has been created.
*
* Default implementation sets the element name of the part.
- *
* @param definition the WSDL4J {@code Definition}
* @param part the WSDL4J {@code Part}
* @param elementName the elementName @throws WSDLException in case of errors
@@ -154,4 +152,5 @@ public class DefaultMessagesProvider implements MessagesProvider {
part.setElementName(elementName);
part.setName(elementName.getLocalPart());
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java
index f4cca7c7..1115d777 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/InliningXsdSchemaTypesProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,18 +26,19 @@ import javax.xml.transform.dom.DOMResult;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
import org.springframework.util.Assert;
import org.springframework.ws.wsdl.WsdlDefinitionException;
import org.springframework.xml.transform.TransformerObjectSupport;
import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.xsd.XsdSchema;
import org.springframework.xml.xsd.XsdSchemaCollection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
/**
- * Implementation of {@link TypesProvider} that inlines a {@link XsdSchema} or {@link XsdSchemaCollection} into the
- * WSDL.
+ * Implementation of {@link TypesProvider} that inlines a {@link XsdSchema} or
+ * {@link XsdSchemaCollection} into the WSDL.
*
* @author Arjen Poutsma
* @since 1.5.0
@@ -52,8 +53,8 @@ public class InliningXsdSchemaTypesProvider extends TransformerObjectSupport imp
private XsdSchemaCollection schemaCollection;
/**
- * Sets the single XSD schema to inline. Either this property, or {@link #setSchemaCollection(XsdSchemaCollection)
- * schemaCollection} must be set.
+ * Sets the single XSD schema to inline. Either this property, or
+ * {@link #setSchemaCollection(XsdSchemaCollection) schemaCollection} must be set.
*/
public void setSchema(final XsdSchema schema) {
this.schemaCollection = new XsdSchemaCollection() {
@@ -74,8 +75,8 @@ public class InliningXsdSchemaTypesProvider extends TransformerObjectSupport imp
}
/**
- * Sets the XSD schema collection to inline. Either this property, or {@link #setSchema(XsdSchema) schema} must be
- * set.
+ * Sets the XSD schema collection to inline. Either this property, or
+ * {@link #setSchema(XsdSchema) schema} must be set.
*/
public void setSchemaCollection(XsdSchemaCollection schemaCollection) {
this.schemaCollection = schemaCollection;
@@ -92,13 +93,14 @@ public class InliningXsdSchemaTypesProvider extends TransformerObjectSupport imp
}
if (schemas.length == 1) {
definition.addNamespace(SCHEMA_PREFIX, schemas[i].getTargetNamespace());
- } else {
+ }
+ else {
String prefix = SCHEMA_PREFIX + i;
definition.addNamespace(prefix, schemas[i].getTargetNamespace());
}
Element schemaElement = getSchemaElement(schemas[i]);
- Schema schema = (Schema) definition.getExtensionRegistry().createExtension(Types.class,
- new QName("http://www.w3.org/2001/XMLSchema", "schema"));
+ Schema schema = (Schema) definition.getExtensionRegistry()
+ .createExtension(Types.class, new QName("http://www.w3.org/2001/XMLSchema", "schema"));
types.addExtensibilityElement(schema);
schema.setElement(schemaElement);
}
@@ -111,7 +113,8 @@ public class InliningXsdSchemaTypesProvider extends TransformerObjectSupport imp
transform(schema.getSource(), result);
Document schemaDocument = (Document) result.getNode();
return schemaDocument.getDocumentElement();
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
throw new WsdlDefinitionException("Could not transform schema source to Document");
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap11Provider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap11Provider.java
index c615fdb1..d18b586b 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap11Provider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap11Provider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,7 +18,17 @@ package org.springframework.ws.wsdl.wsdl11.provider;
import java.util.Properties;
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Output;
+import javax.wsdl.Port;
+import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.ExtensionRegistry;
import javax.wsdl.extensions.soap.SOAPAddress;
@@ -31,10 +41,12 @@ import javax.xml.namespace.QName;
import org.springframework.util.Assert;
/**
- * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces that are SOAP 1.1 specific.
+ * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces
+ * that are SOAP 1.1 specific.
*
- * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the SOAP Actions defined in the
- * resulting WSDL can be set. Additionaly, the transport uri can be changed from the default HTTP transport by using the
+ * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the
+ * SOAP Actions defined in the resulting WSDL can be set. Additionaly, the transport uri
+ * can be changed from the default HTTP transport by using the
* {@link #setTransportUri(String) transportUri} property.
*
* @author Arjen Poutsma
@@ -67,9 +79,10 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Returns the SOAP Actions for this binding. Keys are {@link BindingOperation#getName() binding operation names};
- * values are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Returns the SOAP Actions for this binding. Keys are
+ * {@link BindingOperation#getName() binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @return the soap actions
*/
public Properties getSoapActions() {
@@ -77,9 +90,10 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Sets the SOAP Actions for this binding. Keys are {@link BindingOperation#getName() binding operation names}; values
- * are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Sets the SOAP Actions for this binding. Keys are {@link BindingOperation#getName()
+ * binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @param soapActions the soap
*/
public void setSoapActions(Properties soapActions) {
@@ -89,8 +103,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Returns the value used for the binding transport attribute value. Defaults to {@link #DEFAULT_TRANSPORT_URI}.
- *
+ * Returns the value used for the binding transport attribute value. Defaults to
+ * {@link #DEFAULT_TRANSPORT_URI}.
* @return the binding transport value
*/
public String getTransportUri() {
@@ -98,8 +112,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Sets the value used for the binding transport attribute value. Defaults to {@link #DEFAULT_TRANSPORT_URI}.
- *
+ * Sets the value used for the binding transport attribute value. Defaults to
+ * {@link #DEFAULT_TRANSPORT_URI}.
* @param transportUri the binding transport value
*/
public void setTransportUri(String transportUri) {
@@ -119,13 +133,15 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
- * this method to define the binding name, or add extensions to it.
+ * Called after the {@link Binding} has been created, but before any sub-elements are
+ * added. Subclasses can override this method to define the binding name, or add
+ * extensions to it.
*
- * Default implementation calls {@link DefaultConcretePartProvider#populateBinding(Definition, Binding)}, adds the
- * SOAP 1.1 namespace, creates a {@link SOAPBinding}, and calls {@link #populateSoapBinding(SOAPBinding, Binding)}
- * sets the binding name to the port type name with the {@link #getBindingSuffix() suffix} appended to it.
- *
+ * Default implementation calls
+ * {@link DefaultConcretePartProvider#populateBinding(Definition, Binding)}, adds the
+ * SOAP 1.1 namespace, creates a {@link SOAPBinding}, and calls
+ * {@link #populateSoapBinding(SOAPBinding, Binding)} sets the binding name to the
+ * port type name with the {@link #getBindingSuffix() suffix} appended to it.
* @param definition the WSDL4J {@code Definition}
* @param binding the WSDL4J {@code Binding}
*/
@@ -142,9 +158,9 @@ public class Soap11Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link SOAPBinding} has been created.
*
- * Default implementation sets the binding style to {@code "document"}, and set the transport URI to the
- * {@link #setTransportUri(String) transportUri} property value. Subclasses can override this behavior.
- *
+ * Default implementation sets the binding style to {@code "document"}, and set the
+ * transport URI to the {@link #setTransportUri(String) transportUri} property value.
+ * Subclasses can override this behavior.
* @param soapBinding the WSDL4J {@code SOAPBinding}
* @throws WSDLException in case of errors
* @see SOAPBinding#setStyle(String)
@@ -159,16 +175,17 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link BindingFault} has been created. Subclasses can override this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingFault} has been created. Subclasses can override
+ * this method to define the name, or add extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populateBindingFault(Definition, BindingFault, Fault)}, creates a
- * {@link SOAPFault}, and calls {@link #populateSoapFault(BindingFault, SOAPFault)}.
- *
+ * {@link DefaultConcretePartProvider#populateBindingFault(Definition, BindingFault, Fault)},
+ * creates a {@link SOAPFault}, and calls
+ * {@link #populateSoapFault(BindingFault, SOAPFault)}.
* @param definition the WSDL4J {@code Definition}
* @param bindingFault the WSDL4J {@code BindingFault}
- * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case of errors
+ * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingFault(Definition definition, BindingFault bindingFault, Fault fault)
@@ -183,9 +200,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link SOAPFault} has been created.
*
- * Default implementation sets the use style to {@code "literal"}, and sets the name equal to the binding fault.
- * Subclasses can override this behavior.
- *
+ * Default implementation sets the use style to {@code "literal"}, and sets the name
+ * equal to the binding fault. Subclasses can override this behavior.
* @param bindingFault the WSDL4J {@code BindingFault}
* @param soapFault the WSDL4J {@code SOAPFault}
* @throws WSDLException in case of errors
@@ -198,16 +214,16 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link BindingInput} has been created. Subclasses can implement this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingInput} has been created. Subclasses can implement
+ * this method to define the name, or add extensions to it.
*
* Default implementation calls
* {@link DefaultConcretePartProvider#populateBindingInput(Definition, javax.wsdl.BindingInput, javax.wsdl.Input)},
* creates a {@link SOAPBody}, and calls {@link #populateSoapBody(SOAPBody)}.
- *
* @param definition the WSDL4J {@code Definition}
* @param bindingInput the WSDL4J {@code BindingInput}
- * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case of errors
+ * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingInput(Definition definition, BindingInput bindingInput, Input input)
@@ -222,8 +238,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link SOAPBody} has been created.
*
- * Default implementation sets the use style to {@code "literal"}. Subclasses can override this behavior.
- *
+ * Default implementation sets the use style to {@code "literal"}. Subclasses can
+ * override this behavior.
* @param soapBody the WSDL4J {@code SOAPBody}
* @throws WSDLException in case of errors
* @see SOAPBody#setUse(String)
@@ -233,14 +249,14 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link BindingOperation} has been created, but before any sub-elements are added. Subclasses can
- * implement this method to define the binding name, or add extensions to it.
+ * Called after the {@link BindingOperation} has been created, but before any
+ * sub-elements are added. Subclasses can implement this method to define the binding
+ * name, or add extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populateBindingOperation(Definition, BindingOperation)}, creates a
- * {@link SOAPOperation}, and calls {@link #populateSoapOperation} sets the name of the binding operation to the name
- * of the operation.
- *
+ * {@link DefaultConcretePartProvider#populateBindingOperation(Definition, BindingOperation)},
+ * creates a {@link SOAPOperation}, and calls {@link #populateSoapOperation} sets the
+ * name of the binding operation to the name of the operation.
* @param definition the WSDL4J {@code Definition}
* @param bindingOperation the WSDL4J {@code BindingOperation}
* @throws WSDLException in case of errors
@@ -250,7 +266,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
throws WSDLException {
super.populateBindingOperation(definition, bindingOperation);
- SOAPOperation soapOperation = (SOAPOperation) createSoapExtension(definition, BindingOperation.class, "operation");
+ SOAPOperation soapOperation = (SOAPOperation) createSoapExtension(definition, BindingOperation.class,
+ "operation");
populateSoapOperation(soapOperation, bindingOperation);
bindingOperation.addExtensibilityElement(soapOperation);
}
@@ -258,9 +275,9 @@ public class Soap11Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link SOAPOperation} has been created.
*
- * Default implementation sets {@code SOAPAction} to the corresponding {@link #setSoapActions(java.util.Properties)
- * soapActions} property, and defaults to "".
- *
+ * Default implementation sets {@code SOAPAction} to the corresponding
+ * {@link #setSoapActions(java.util.Properties) soapActions} property, and defaults to
+ * "".
* @param soapOperation the WSDL4J {@code SOAPOperation}
* @param bindingOperation the WSDL4J {@code BindingOperation}
* @throws WSDLException in case of errors
@@ -276,16 +293,16 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link BindingInput} has been created. Subclasses can implement this method to define the name, or
- * add extensions to it.
+ * Called after the {@link BindingInput} has been created. Subclasses can implement
+ * this method to define the name, or add extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populateBindingOutput(Definition, BindingOutput, Output)}, creates a
- * {@link SOAPBody}, and calls {@link #populateSoapBody(SOAPBody)}.
- *
+ * {@link DefaultConcretePartProvider#populateBindingOutput(Definition, BindingOutput, Output)},
+ * creates a {@link SOAPBody}, and calls {@link #populateSoapBody(SOAPBody)}.
* @param definition the WSDL4J {@code Definition}
* @param bindingOutput the WSDL4J {@code BindingOutput}
- * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case of errors
+ * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingOutput(Definition definition, BindingOutput bindingOutput, Output output)
@@ -298,13 +315,13 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
- * this method to define the port name, or add extensions to it.
+ * Called after the {@link Port} has been created, but before any sub-elements are
+ * added. Subclasses can implement this method to define the port name, or add
+ * extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populatePort(javax.wsdl.Definition,javax.wsdl.Port)}, creates a
- * {@link SOAPAddress}, and calls {@link #populateSoapAddress(SOAPAddress)}.
- *
+ * {@link DefaultConcretePartProvider#populatePort(javax.wsdl.Definition,javax.wsdl.Port)},
+ * creates a {@link SOAPAddress}, and calls {@link #populateSoapAddress(SOAPAddress)}.
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
*/
@@ -325,9 +342,9 @@ public class Soap11Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link SOAPAddress} has been created. Default implementation sets the location URI to the value
- * set on this builder. Subclasses can override this behavior.
- *
+ * Called after the {@link SOAPAddress} has been created. Default implementation sets
+ * the location URI to the value set on this builder. Subclasses can override this
+ * behavior.
* @param soapAddress the WSDL4J {@code SOAPAddress}
* @throws WSDLException in case of errors
* @see SOAPAddress#setLocationURI(String)
@@ -339,9 +356,9 @@ public class Soap11Provider extends DefaultConcretePartProvider {
/**
* Creates a SOAP extensibility element.
- *
* @param definition the WSDL4J {@code Definition}
- * @param parentType a class object indicating where in the WSDL definition this extension will exist
+ * @param parentType a class object indicating where in the WSDL definition this
+ * extension will exist
* @param localName the local name of the extensibility element
* @return the extensibility element
* @throws WSDLException in case of errors
@@ -349,7 +366,8 @@ public class Soap11Provider extends DefaultConcretePartProvider {
*/
private ExtensibilityElement createSoapExtension(Definition definition, Class> parentType, String localName)
throws WSDLException {
- return definition.getExtensionRegistry().createExtension(parentType, new QName(SOAP_11_NAMESPACE_URI, localName));
+ return definition.getExtensionRegistry()
+ .createExtension(parentType, new QName(SOAP_11_NAMESPACE_URI, localName));
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap12Provider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap12Provider.java
index 0614e63f..9b57ed5a 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap12Provider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/Soap12Provider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,7 +18,17 @@ package org.springframework.ws.wsdl.wsdl11.provider;
import java.util.Properties;
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Output;
+import javax.wsdl.Port;
+import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.soap12.SOAP12Address;
import javax.wsdl.extensions.soap12.SOAP12Binding;
@@ -30,10 +40,12 @@ import javax.xml.namespace.QName;
import org.springframework.util.Assert;
/**
- * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces that are SOAP 1.2 specific.
+ * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces
+ * that are SOAP 1.2 specific.
*
- * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the SOAP Actions defined in the
- * resulting WSDL can be set. Additionaly, the transport uri can be changed from the default HTTP transport by using the
+ * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the
+ * SOAP Actions defined in the resulting WSDL can be set. Additionaly, the transport uri
+ * can be changed from the default HTTP transport by using the
* {@link #setTransportUri(String) transportUri} property.
*
* @author Arjen Poutsma
@@ -66,9 +78,10 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Returns the SOAP Actions for this binding. Keys are {@link javax.wsdl.BindingOperation#getName() binding operation
- * names}; values are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Returns the SOAP Actions for this binding. Keys are
+ * {@link javax.wsdl.BindingOperation#getName() binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @return the soap actions
*/
public Properties getSoapActions() {
@@ -76,9 +89,10 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Sets the SOAP Actions for this binding. Keys are {@link javax.wsdl.BindingOperation#getName() binding operation
- * names}; values are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Sets the SOAP Actions for this binding. Keys are
+ * {@link javax.wsdl.BindingOperation#getName() binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @param soapActions the soap
*/
public void setSoapActions(Properties soapActions) {
@@ -88,8 +102,8 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Returns the value used for the binding transport attribute value. Defaults to {@link #DEFAULT_TRANSPORT_URI}.
- *
+ * Returns the value used for the binding transport attribute value. Defaults to
+ * {@link #DEFAULT_TRANSPORT_URI}.
* @return the binding transport value
*/
public String getTransportUri() {
@@ -97,8 +111,8 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Sets the value used for the binding transport attribute value. Defaults to {@link #DEFAULT_TRANSPORT_URI}.
- *
+ * Sets the value used for the binding transport attribute value. Defaults to
+ * {@link #DEFAULT_TRANSPORT_URI}.
* @param transportUri the binding transport value
*/
public void setTransportUri(String transportUri) {
@@ -118,15 +132,17 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.Binding} has been created, but before any sub-elements are added. Subclasses can
- * override this method to define the binding name, or add extensions to it.
+ * Called after the {@link javax.wsdl.Binding} has been created, but before any
+ * sub-elements are added. Subclasses can override this method to define the binding
+ * name, or add extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populateBinding(javax.wsdl.Definition, javax.wsdl.Binding)}, adds the SOAP 1.1
- * namespace, creates a {@link javax.wsdl.extensions.soap.SOAPBinding}, and calls
- * {@link #populateSoapBinding(javax.wsdl.extensions.soap12.SOAP12Binding, javax.wsdl.Binding)} sets the binding name
- * to the port type name with the {@link #getBindingSuffix() suffix} appended to it.
- *
+ * {@link DefaultConcretePartProvider#populateBinding(javax.wsdl.Definition, javax.wsdl.Binding)},
+ * adds the SOAP 1.1 namespace, creates a
+ * {@link javax.wsdl.extensions.soap.SOAPBinding}, and calls
+ * {@link #populateSoapBinding(javax.wsdl.extensions.soap12.SOAP12Binding, javax.wsdl.Binding)}
+ * sets the binding name to the port type name with the {@link #getBindingSuffix()
+ * suffix} appended to it.
* @param definition the WSDL4J {@code Definition}
* @param binding the WSDL4J {@code Binding}
*/
@@ -143,9 +159,9 @@ public class Soap12Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link javax.wsdl.extensions.soap.SOAPBinding} has been created.
*
- * Default implementation sets the binding style to {@code "document"}, and set the transport URI to the
- * {@link #setTransportUri(String) transportUri} property value. Subclasses can override this behavior.
- *
+ * Default implementation sets the binding style to {@code "document"}, and set the
+ * transport URI to the {@link #setTransportUri(String) transportUri} property value.
+ * Subclasses can override this behavior.
* @param soapBinding the WSDL4J {@code SOAPBinding}
* @throws javax.wsdl.WSDLException in case of errors
* @see javax.wsdl.extensions.soap.SOAPBinding#setStyle(String)
@@ -160,17 +176,17 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.BindingFault} has been created. Subclasses can override this method to define
- * the name, or add extensions to it.
+ * Called after the {@link javax.wsdl.BindingFault} has been created. Subclasses can
+ * override this method to define the name, or add extensions to it.
*
* Default implementation calls
* {@link DefaultConcretePartProvider#populateBindingFault(javax.wsdl.Definition, javax.wsdl.BindingFault, javax.wsdl.Fault)},
* creates a {@link javax.wsdl.extensions.soap.SOAPFault}, and calls
* {@link #populateSoapFault(javax.wsdl.BindingFault, javax.wsdl.extensions.soap12.SOAP12Fault)}.
- *
* @param definition the WSDL4J {@code Definition}
* @param bindingFault the WSDL4J {@code BindingFault}
- * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case of errors
+ * @param fault the corresponding WSDL4J {@code Fault} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingFault(Definition definition, BindingFault bindingFault, Fault fault)
@@ -185,9 +201,8 @@ public class Soap12Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link javax.wsdl.extensions.soap.SOAPFault} has been created.
*
- * Default implementation sets the use style to {@code "literal"}, and sets the name equal to the binding fault.
- * Subclasses can override this behavior.
- *
+ * Default implementation sets the use style to {@code "literal"}, and sets the name
+ * equal to the binding fault. Subclasses can override this behavior.
* @param bindingFault the WSDL4J {@code BindingFault}
* @param soapFault the WSDL4J {@code SOAPFault}
* @throws javax.wsdl.WSDLException in case of errors
@@ -200,17 +215,17 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.BindingInput} has been created. Subclasses can implement this method to define
- * the name, or add extensions to it.
+ * Called after the {@link javax.wsdl.BindingInput} has been created. Subclasses can
+ * implement this method to define the name, or add extensions to it.
*
* Default implementation calls
* {@link DefaultConcretePartProvider#populateBindingInput(javax.wsdl.Definition, javax.wsdl.BindingInput, javax.wsdl.Input)},
* creates a {@link javax.wsdl.extensions.soap.SOAPBody}, and calls
* {@link #populateSoapBody(javax.wsdl.extensions.soap12.SOAP12Body)}. 2
- *
* @param definition the WSDL4J {@code Definition}
* @param bindingInput the WSDL4J {@code BindingInput}
- * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case of errors
+ * @param input the corresponding WSDL4J {@code Input} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingInput(Definition definition, BindingInput bindingInput, Input input)
@@ -225,8 +240,8 @@ public class Soap12Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link javax.wsdl.extensions.soap.SOAPBody} has been created.
*
- * Default implementation sets the use style to {@code "literal"}. Subclasses can override this behavior.
- *
+ * Default implementation sets the use style to {@code "literal"}. Subclasses can
+ * override this behavior.
* @param soapBody the WSDL4J {@code SOAPBody}
* @throws javax.wsdl.WSDLException in case of errors
* @see javax.wsdl.extensions.soap.SOAPBody#setUse(String)
@@ -236,14 +251,15 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.BindingOperation} has been created, but before any sub-elements are added.
- * Subclasses can implement this method to define the binding name, or add extensions to it.
+ * Called after the {@link javax.wsdl.BindingOperation} has been created, but before
+ * any sub-elements are added. Subclasses can implement this method to define the
+ * binding name, or add extensions to it.
*
* Default implementation calls
* {@link DefaultConcretePartProvider#populateBindingOperation(javax.wsdl.Definition, javax.wsdl.BindingOperation)},
- * creates a {@link javax.wsdl.extensions.soap.SOAPOperation}, and calls {@link #populateSoapOperation} sets the name
- * of the binding operation to the name of the operation.
- *
+ * creates a {@link javax.wsdl.extensions.soap.SOAPOperation}, and calls
+ * {@link #populateSoapOperation} sets the name of the binding operation to the name
+ * of the operation.
* @param definition the WSDL4J {@code Definition}
* @param bindingOperation the WSDL4J {@code BindingOperation}
* @throws javax.wsdl.WSDLException in case of errors
@@ -262,9 +278,9 @@ public class Soap12Provider extends DefaultConcretePartProvider {
/**
* Called after the {@link javax.wsdl.extensions.soap.SOAPOperation} has been created.
*
- * Default implementation sets {@code SOAPAction} to the corresponding {@link #setSoapActions(java.util.Properties)
- * soapActions} property, and defaults to "".
- *
+ * Default implementation sets {@code SOAPAction} to the corresponding
+ * {@link #setSoapActions(java.util.Properties) soapActions} property, and defaults to
+ * "".
* @param soapOperation the WSDL4J {@code SOAPOperation}
* @param bindingOperation the WSDL4J {@code BindingOperation}
* @throws javax.wsdl.WSDLException in case of errors
@@ -280,17 +296,17 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.BindingInput} has been created. Subclasses can implement this method to define
- * the name, or add extensions to it.
+ * Called after the {@link javax.wsdl.BindingInput} has been created. Subclasses can
+ * implement this method to define the name, or add extensions to it.
*
* Default implementation calls
* {@link DefaultConcretePartProvider#populateBindingOutput(javax.wsdl.Definition, javax.wsdl.BindingOutput, javax.wsdl.Output)},
* creates a {@link javax.wsdl.extensions.soap.SOAPBody}, and calls
* {@link #populateSoapBody(javax.wsdl.extensions.soap12.SOAP12Body)}.
- *
* @param definition the WSDL4J {@code Definition}
* @param bindingOutput the WSDL4J {@code BindingOutput}
- * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case of errors
+ * @param output the corresponding WSDL4J {@code Output} @throws WSDLException in case
+ * of errors
*/
@Override
protected void populateBindingOutput(Definition definition, BindingOutput bindingOutput, Output output)
@@ -303,13 +319,14 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link javax.wsdl.Port} has been created, but before any sub-elements are added. Subclasses can
- * implement this method to define the port name, or add extensions to it.
+ * Called after the {@link javax.wsdl.Port} has been created, but before any
+ * sub-elements are added. Subclasses can implement this method to define the port
+ * name, or add extensions to it.
*
* Default implementation calls
- * {@link DefaultConcretePartProvider#populatePort(javax.wsdl.Definition,javax.wsdl.Port)}, creates a
- * {@link javax.wsdl.extensions.soap.SOAPAddress}, and calls {@link #populateSoapAddress(SOAP12Address)}.
- *
+ * {@link DefaultConcretePartProvider#populatePort(javax.wsdl.Definition,javax.wsdl.Port)},
+ * creates a {@link javax.wsdl.extensions.soap.SOAPAddress}, and calls
+ * {@link #populateSoapAddress(SOAP12Address)}.
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
*/
@@ -330,9 +347,9 @@ public class Soap12Provider extends DefaultConcretePartProvider {
}
/**
- * Called after the {@link SOAP12Address} has been created. Default implementation sets the location URI to the value
- * set on this builder. Subclasses can override this behavior.
- *
+ * Called after the {@link SOAP12Address} has been created. Default implementation
+ * sets the location URI to the value set on this builder. Subclasses can override
+ * this behavior.
* @param soapAddress the WSDL4J {@code SOAPAddress}
* @throws WSDLException in case of errors
* @see SOAP12Address#setLocationURI(String)
@@ -344,9 +361,9 @@ public class Soap12Provider extends DefaultConcretePartProvider {
/**
* Creates a SOAP extensibility element.
- *
* @param definition the WSDL4J {@code Definition}
- * @param parentType a class object indicating where in the WSDL definition this extension will exist
+ * @param parentType a class object indicating where in the WSDL definition this
+ * extension will exist
* @param localName the local name of the extensibility element
* @return the extensibility element
* @throws WSDLException in case of errors
@@ -354,7 +371,8 @@ public class Soap12Provider extends DefaultConcretePartProvider {
*/
private ExtensibilityElement createSoapExtension(Definition definition, Class> parentType, String localName)
throws WSDLException {
- return definition.getExtensionRegistry().createExtension(parentType, new QName(SOAP_12_NAMESPACE_URI, localName));
+ return definition.getExtensionRegistry()
+ .createExtension(parentType, new QName(SOAP_12_NAMESPACE_URI, localName));
}
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java
index 5ca20bad..c8c81d96 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SoapProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,15 +22,18 @@ import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
/**
- * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces that supports SOAP 1.1 and
- * SOAP 1.2. Delegates to {@link Soap11Provider} and {@link Soap12Provider}.
+ * Implementation of the {@link BindingsProvider} and {@link ServicesProvider} interfaces
+ * that supports SOAP 1.1 and SOAP 1.2. Delegates to {@link Soap11Provider} and
+ * {@link Soap12Provider}.
*
- * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the SOAP Actions defined in the
- * resulting WSDL can be set. Additionally, the transport uri can be changed from the default HTTP transport by using
- * the {@link #setTransportUri(String) transportUri} property.
+ * By setting the {@link #setSoapActions(java.util.Properties) soapActions} property, the
+ * SOAP Actions defined in the resulting WSDL can be set. Additionally, the transport uri
+ * can be changed from the default HTTP transport by using the
+ * {@link #setTransportUri(String) transportUri} property.
*
- * The {@link #setCreateSoap11Binding(boolean) createSoap11} and {@link #setCreateSoap12Binding(boolean) createSoap12}
- * properties indicate whether a SOAP 1.1 or SOAP 1.2 binding should be created. These properties default to
+ * The {@link #setCreateSoap11Binding(boolean) createSoap11} and
+ * {@link #setCreateSoap12Binding(boolean) createSoap12} properties indicate whether a
+ * SOAP 1.1 or SOAP 1.2 binding should be created. These properties default to
* {@code true} and {@code false} respectively.
*
* @author Arjen Poutsma
@@ -65,9 +68,10 @@ public class SoapProvider implements BindingsProvider, ServicesProvider {
}
/**
- * Sets the SOAP Actions for this binding. Keys are {@link javax.wsdl.BindingOperation#getName() binding operation
- * names}; values are {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action URIs}.
- *
+ * Sets the SOAP Actions for this binding. Keys are
+ * {@link javax.wsdl.BindingOperation#getName() binding operation names}; values are
+ * {@link javax.wsdl.extensions.soap.SOAPOperation#getSoapActionURI() SOAP Action
+ * URIs}.
* @param soapActions the soap
*/
public void setSoapActions(Properties soapActions) {
@@ -75,7 +79,9 @@ public class SoapProvider implements BindingsProvider, ServicesProvider {
soap12BindingProvider.setSoapActions(soapActions);
}
- /** Sets the value used for the binding transport attribute value. Defaults to HTTP. */
+ /**
+ * Sets the value used for the binding transport attribute value. Defaults to HTTP.
+ */
public void setTransportUri(String transportUri) {
soap11BindingProvider.setTransportUri(transportUri);
soap12BindingProvider.setTransportUri(transportUri);
@@ -112,4 +118,5 @@ public class SoapProvider implements BindingsProvider, ServicesProvider {
soap12BindingProvider.addServices(definition);
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedMessagesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedMessagesProvider.java
index 810f5b73..151c540f 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedMessagesProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedMessagesProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,10 @@
package org.springframework.ws.wsdl.wsdl11.provider;
-import org.springframework.util.Assert;
import org.w3c.dom.Element;
+import org.springframework.util.Assert;
+
/**
* Implementation of the {@link MessagesProvider} interface that is based on suffixes.
*
@@ -44,7 +45,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Returns the suffix used to detect request elements in the schema.
- *
* @see #DEFAULT_REQUEST_SUFFIX
*/
public String getRequestSuffix() {
@@ -53,7 +53,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Sets the suffix used to detect request elements in the schema.
- *
* @see #DEFAULT_REQUEST_SUFFIX
*/
public void setRequestSuffix(String requestSuffix) {
@@ -63,7 +62,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Returns the suffix used to detect response elements in the schema.
- *
* @see #DEFAULT_RESPONSE_SUFFIX
*/
public String getResponseSuffix() {
@@ -72,7 +70,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Sets the suffix used to detect response elements in the schema.
- *
* @see #DEFAULT_RESPONSE_SUFFIX
*/
public void setResponseSuffix(String responseSuffix) {
@@ -82,7 +79,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Returns the suffix used to detect fault elements in the schema.
- *
* @see #DEFAULT_FAULT_SUFFIX
*/
public String getFaultSuffix() {
@@ -91,7 +87,6 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
/**
* Sets the suffix used to detect fault elements in the schema.
- *
* @see #DEFAULT_FAULT_SUFFIX
*/
public void setFaultSuffix(String faultSuffix) {
@@ -106,8 +101,10 @@ public class SuffixBasedMessagesProvider extends DefaultMessagesProvider {
Assert.hasText(elementName, "Element has no name");
return elementName.endsWith(getRequestSuffix()) || elementName.endsWith(getResponseSuffix())
|| elementName.endsWith(getFaultSuffix());
- } else {
+ }
+ else {
return false;
}
}
+
}
diff --git a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedPortTypesProvider.java b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedPortTypesProvider.java
index 7a834f56..bdff0c25 100644
--- a/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedPortTypesProvider.java
+++ b/spring-ws-core/src/main/java/org/springframework/ws/wsdl/wsdl11/provider/SuffixBasedPortTypesProvider.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -45,7 +45,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Returns the suffix used to detect request elements in the schema.
- *
* @see #DEFAULT_REQUEST_SUFFIX
*/
public String getRequestSuffix() {
@@ -54,7 +53,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Sets the suffix used to detect request elements in the schema.
- *
* @see #DEFAULT_REQUEST_SUFFIX
*/
public void setRequestSuffix(String requestSuffix) {
@@ -64,7 +62,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Returns the suffix used to detect response elements in the schema.
- *
* @see #DEFAULT_RESPONSE_SUFFIX
*/
public String getResponseSuffix() {
@@ -73,7 +70,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Sets the suffix used to detect response elements in the schema.
- *
* @see #DEFAULT_RESPONSE_SUFFIX
*/
public void setResponseSuffix(String responseSuffix) {
@@ -83,7 +79,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Returns the suffix used to detect fault elements in the schema.
- *
* @see #DEFAULT_FAULT_SUFFIX
*/
public String getFaultSuffix() {
@@ -92,7 +87,6 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
/**
* Sets the suffix used to detect fault elements in the schema.
- *
* @see #DEFAULT_FAULT_SUFFIX
*/
public void setFaultSuffix(String faultSuffix) {
@@ -106,9 +100,11 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
if (messageName != null) {
if (messageName.endsWith(getRequestSuffix())) {
return messageName.substring(0, messageName.length() - getRequestSuffix().length());
- } else if (messageName.endsWith(getResponseSuffix())) {
+ }
+ else if (messageName.endsWith(getResponseSuffix())) {
return messageName.substring(0, messageName.length() - getResponseSuffix().length());
- } else if (messageName.endsWith(getFaultSuffix())) {
+ }
+ else if (messageName.endsWith(getFaultSuffix())) {
return messageName.substring(0, messageName.length() - getFaultSuffix().length());
}
}
@@ -116,10 +112,11 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
}
/**
- * Indicates whether the given name name should be included as {@link javax.wsdl.Input} message in the definition.
+ * Indicates whether the given name name should be included as
+ * {@link javax.wsdl.Input} message in the definition.
*
- * This implementation checks whether the message name ends with the {@link #setRequestSuffix(String) requestSuffix}.
- *
+ * This implementation checks whether the message name ends with the
+ * {@link #setRequestSuffix(String) requestSuffix}.
* @param message the message
* @return {@code true} if to be included as input; {@code false} otherwise
*/
@@ -130,11 +127,11 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
}
/**
- * Indicates whether the given name name should be included as {@link javax.wsdl.Output} message in the definition.
+ * Indicates whether the given name name should be included as
+ * {@link javax.wsdl.Output} message in the definition.
*
- * This implementation checks whether the message name ends with the {@link #setResponseSuffix(String)
- * responseSuffix}.
- *
+ * This implementation checks whether the message name ends with the
+ * {@link #setResponseSuffix(String) responseSuffix}.
* @param message the message
* @return {@code true} if to be included as output; {@code false} otherwise
*/
@@ -145,10 +142,11 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
}
/**
- * Indicates whether the given name name should be included as {@link javax.wsdl.Fault} message in the definition.
+ * Indicates whether the given name name should be included as
+ * {@link javax.wsdl.Fault} message in the definition.
*
- * This implementation checks whether the message name ends with the {@link #setFaultSuffix(String) faultSuffix}.
- *
+ * This implementation checks whether the message name ends with the
+ * {@link #setFaultSuffix(String) faultSuffix}.
* @param message the message
* @return {@code true} if to be included as fault; {@code false} otherwise
*/
@@ -161,4 +159,5 @@ public class SuffixBasedPortTypesProvider extends AbstractPortTypesProvider {
private String getMessageName(Message message) {
return message.getQName().getLocalPart();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageFactoryTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageFactoryTestCase.java
index 6ba4ecf2..b9e7a2f9 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageFactoryTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageFactoryTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,11 +16,11 @@
package org.springframework.ws;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractWebServiceMessageFactoryTestCase {
protected WebServiceMessageFactory messageFactory;
@@ -39,4 +39,5 @@ public abstract class AbstractWebServiceMessageFactoryTestCase {
}
protected abstract WebServiceMessageFactory createMessageFactory() throws Exception;
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
index e9b016f1..d83ee053 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/AbstractWebServiceMessageTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws;
-import static org.xmlunit.assertj.XmlAssert.*;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -46,6 +44,12 @@ import javax.xml.transform.stream.StreamSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
+
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;
@@ -55,11 +59,8 @@ import org.springframework.xml.XMLInputFactoryUtils;
import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-import org.xml.sax.helpers.XMLReaderFactory;
+
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public abstract class AbstractWebServiceMessageTestCase {
@@ -159,7 +160,9 @@ public abstract class AbstractWebServiceMessageTestCase {
ByteArrayOutputStream expectedStream = new ByteArrayOutputStream();
FileCopyUtils.copy(payload.getInputStream(), expectedStream);
- assertThat(resultStream.toString(StandardCharsets.UTF_8)).and(expectedStream.toString(StandardCharsets.UTF_8)).ignoreWhitespace().areIdentical();
+ assertThat(resultStream.toString(StandardCharsets.UTF_8)).and(expectedStream.toString(StandardCharsets.UTF_8))
+ .ignoreWhitespace()
+ .areIdentical();
validateMessage();
}
@@ -194,4 +197,5 @@ public abstract class AbstractWebServiceMessageTestCase {
}
protected abstract WebServiceMessage createWebServiceMessage() throws Exception;
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java
index a811d812..1a299059 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessage.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -57,7 +57,8 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage {
private String faultReason;
- public MockWebServiceMessage() {}
+ public MockWebServiceMessage() {
+ }
public MockWebServiceMessage(Source source) throws TransformerException {
@@ -192,21 +193,26 @@ public class MockWebServiceMessage implements FaultAwareWebServiceMessage {
}
@Override
- public void close() {}
+ public void close() {
+ }
@Override
- public void flush() {}
+ public void flush() {
+ }
@Override
public void write(char cbuf[], int off, int len) {
if (off < 0 || off > cbuf.length || len < 0 || off + len > cbuf.length || off + len < 0) {
throw new IndexOutOfBoundsException();
- } else if (len == 0) {
+ }
+ else if (len == 0) {
return;
}
content.append(cbuf, off, len);
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java
index 9b579f36..9ea07b83 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -34,8 +34,10 @@ public class MockWebServiceMessageFactory implements WebServiceMessageFactory {
try {
return new MockWebServiceMessage(new StreamSource(inputStream));
- } catch (TransformerException ex) {
+ }
+ catch (TransformerException ex) {
throw new IOException(ex.getMessage());
}
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
index 0b576e63..fc87e94c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap11WebServiceTemplateIntegrationTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +16,17 @@
package org.springframework.ws.client.core;
-import static org.assertj.core.api.Assertions.*;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
import jakarta.activation.DataHandler;
import jakarta.mail.util.ByteArrayDataSource;
@@ -31,19 +41,6 @@ import jakarta.xml.soap.MimeHeaders;
import jakarta.xml.soap.SOAPBody;
import jakarta.xml.soap.SOAPException;
import jakarta.xml.soap.SOAPMessage;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.jetty.server.Connector;
@@ -55,6 +52,8 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.oxm.XmlMappingException;
@@ -68,7 +67,9 @@ import org.springframework.ws.transport.support.FreePortScanner;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
@@ -137,7 +138,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
logger.info(">>> Test case");
StringResult result = new StringResult();
- boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo", new StringSource(messagePayload), result);
+ boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo", new StringSource(messagePayload),
+ result);
assertThat(b).isTrue();
XmlAssert.assertThat(result.toString()).and(messagePayload).ignoreWhitespace().areIdentical();
@@ -146,8 +148,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
@Test
public void sendSourceAndReceiveToResultNoResponse() {
- boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse", new StringSource(messagePayload),
- new StringResult());
+ boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse",
+ new StringSource(messagePayload), new StringResult());
assertThat(b).isFalse();
}
@@ -166,7 +168,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
assertThat(requestObject).isEqualTo(graph);
try {
transformer.transform(new StringSource(messagePayload), result);
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
throw new RuntimeException(e);
}
}
@@ -217,7 +220,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
assertThat(requestObject).isEqualTo(graph);
try {
transformer.transform(new StringSource(messagePayload), result);
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
throw new RuntimeException(e);
}
}
@@ -240,8 +244,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
public void notFound() {
assertThatExceptionOfType(WebServiceTransportException.class)
- .isThrownBy(() -> template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
- new StringSource(messagePayload), new StringResult()));
+ .isThrownBy(() -> template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
+ new StringSource(messagePayload), new StringResult()));
}
@Test
@@ -249,8 +253,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
Result result = new StringResult();
- assertThatExceptionOfType(SoapFaultClientException.class).isThrownBy(
- () -> template.sendSourceAndReceiveToResult(baseUrl + "/soap/fault", new StringSource(messagePayload), result));
+ assertThatExceptionOfType(SoapFaultClientException.class).isThrownBy(() -> template
+ .sendSourceAndReceiveToResult(baseUrl + "/soap/fault", new StringSource(messagePayload), result));
}
@Test
@@ -261,19 +265,20 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
template.setCheckConnectionForError(false);
assertThatExceptionOfType(SoapFaultClientException.class).isThrownBy(() -> template
- .sendSourceAndReceiveToResult(baseUrl + "/soap/badRequestFault", new StringSource(messagePayload), result));
+ .sendSourceAndReceiveToResult(baseUrl + "/soap/badRequestFault", new StringSource(messagePayload), result));
}
@Test
public void attachment() {
- template.sendSourceAndReceiveToResult(baseUrl + "/soap/attachment", new StringSource(messagePayload), message -> {
+ template.sendSourceAndReceiveToResult(baseUrl + "/soap/attachment", new StringSource(messagePayload),
+ message -> {
- SoapMessage soapMessage = (SoapMessage) message;
- final String attachmentContent = "content";
- soapMessage.addAttachment("attachment-1",
- new DataHandler(new ByteArrayDataSource(attachmentContent, "text/plain")));
- }, new StringResult());
+ SoapMessage soapMessage = (SoapMessage) message;
+ final String attachmentContent = "content";
+ soapMessage.addAttachment("attachment-1",
+ new DataHandler(new ByteArrayDataSource(attachmentContent, "text/plain")));
+ }, new StringResult());
}
/** Servlet that returns and error message for a given status code. */
@@ -290,6 +295,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.sendError(sc);
}
+
}
/** Abstract SOAP Servlet */
@@ -311,7 +317,8 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
try {
messageFactory = MessageFactory.newInstance();
- } catch (SOAPException ex) {
+ }
+ catch (SOAPException ex) {
throw new ServletException("Unable to create message factory" + ex.getMessage());
}
}
@@ -339,10 +346,12 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
putHeaders(reply.getMimeHeaders(), resp);
reply.writeTo(resp.getOutputStream());
- } else if (sc == -1) {
+ }
+ else if (sc == -1) {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
}
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new ServletException("SAAJ POST failed " + ex.getMessage(), ex);
}
}
@@ -378,6 +387,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException;
+
}
@SuppressWarnings("serial")
@@ -387,6 +397,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
protected SOAPMessage onMessage(SOAPMessage message) {
return message;
}
+
}
@SuppressWarnings("serial")
@@ -396,6 +407,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
protected SOAPMessage onMessage(SOAPMessage message) {
return null;
}
+
}
@SuppressWarnings("serial")
@@ -409,6 +421,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
body.addFault(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"), "Server fault");
return response;
}
+
}
@SuppressWarnings("serial")
@@ -420,6 +433,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
assertThat(message.countAttachments()).isEqualTo(1);
return null;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
index e5d3c006..94391b67 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/AbstractSoap12WebServiceTemplateIntegrationTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +16,16 @@
package org.springframework.ws.client.core;
-import static org.assertj.core.api.Assertions.*;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
import jakarta.activation.CommandMap;
import jakarta.activation.DataHandler;
@@ -34,18 +43,6 @@ import jakarta.xml.soap.SOAPBody;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPException;
import jakarta.xml.soap.SOAPMessage;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
@@ -55,6 +52,8 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.oxm.XmlMappingException;
@@ -67,7 +66,9 @@ import org.springframework.ws.transport.support.FreePortScanner;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
@@ -117,8 +118,9 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
/**
- * A workaround for the faulty XmlDataContentHandler in the SAAJ RI, which cannot handle mime types such as "text/xml;
- * charset=UTF-8", causing issues with Axiom. We basically reset the command map
+ * A workaround for the faulty XmlDataContentHandler in the SAAJ RI, which cannot
+ * handle mime types such as "text/xml; charset=UTF-8", causing issues with Axiom. We
+ * basically reset the command map
*/
@BeforeEach
public void removeXmlDataContentHandler() throws SOAPException {
@@ -142,7 +144,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
public void sendSourceAndReceiveToResult() {
StringResult result = new StringResult();
- boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo", new StringSource(messagePayload), result);
+ boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo", new StringSource(messagePayload),
+ result);
assertThat(b).isTrue();
XmlAssert.assertThat(result.toString()).and(messagePayload).ignoreWhitespace().areIdentical();
@@ -151,8 +154,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
@Test
public void sendSourceAndReceiveToResultNoResponse() {
- boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse", new StringSource(messagePayload),
- new StringResult());
+ boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse",
+ new StringSource(messagePayload), new StringResult());
assertThat(b).isFalse();
}
@@ -170,7 +173,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
assertThat(requestObject).isEqualTo(graph);
try {
transformer.transform(new StringSource(messagePayload), result);
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
throw new RuntimeException(e);
}
}
@@ -221,7 +225,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
try {
transformer.transform(new StringSource(messagePayload), result);
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
throw new RuntimeException(e);
}
}
@@ -244,8 +249,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
public void notFound() {
assertThatExceptionOfType(WebServiceTransportException.class)
- .isThrownBy(() -> template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
- new StringSource(messagePayload), new StringResult()));
+ .isThrownBy(() -> template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
+ new StringSource(messagePayload), new StringResult()));
}
@Test
@@ -254,7 +259,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
Result result = new StringResult();
assertThatExceptionOfType(SoapFaultClientException.class).isThrownBy(() -> template
- .sendSourceAndReceiveToResult(baseUrl + "/soap/receiverFault", new StringSource(messagePayload), result));
+ .sendSourceAndReceiveToResult(baseUrl + "/soap/receiverFault", new StringSource(messagePayload), result));
}
@Test
@@ -263,19 +268,20 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
Result result = new StringResult();
assertThatExceptionOfType(SoapFaultClientException.class).isThrownBy(() -> template
- .sendSourceAndReceiveToResult(baseUrl + "/soap/senderFault", new StringSource(messagePayload), result));
+ .sendSourceAndReceiveToResult(baseUrl + "/soap/senderFault", new StringSource(messagePayload), result));
}
@Test
public void attachment() {
- template.sendSourceAndReceiveToResult(baseUrl + "/soap/attachment", new StringSource(messagePayload), message -> {
+ template.sendSourceAndReceiveToResult(baseUrl + "/soap/attachment", new StringSource(messagePayload),
+ message -> {
- SoapMessage soapMessage = (SoapMessage) message;
- final String attachmentContent = "content";
- soapMessage.addAttachment("attachment-1",
- new DataHandler(new ByteArrayDataSource(attachmentContent, "text/plain")));
- }, new StringResult());
+ SoapMessage soapMessage = (SoapMessage) message;
+ final String attachmentContent = "content";
+ soapMessage.addAttachment("attachment-1",
+ new DataHandler(new ByteArrayDataSource(attachmentContent, "text/plain")));
+ }, new StringResult());
}
/** Servlet that returns and error message for a given status code. */
@@ -292,6 +298,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.sendError(sc);
}
+
}
/** Abstract SOAP Servlet */
@@ -307,7 +314,8 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
try {
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
- } catch (SOAPException ex) {
+ }
+ catch (SOAPException ex) {
throw new ServletException("Unable to create message factory" + ex.getMessage());
}
}
@@ -325,20 +333,24 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
SOAPBody replyBody = reply.getSOAPBody();
if (!replyBody.hasFault()) {
resp.setStatus(HttpServletResponse.SC_OK);
- } else {
+ }
+ else {
if (replyBody.getFault().getFaultCodeAsQName().equals(SOAPConstants.SOAP_SENDER_FAULT)) {
resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- } else {
+ }
+ else {
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
putHeaders(reply.getMimeHeaders(), resp);
reply.writeTo(resp.getOutputStream());
- } else {
+ }
+ else {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
}
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new ServletException("SAAJ POST failed " + ex.getMessage(), ex);
}
}
@@ -374,6 +386,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException;
+
}
@SuppressWarnings("serial")
@@ -383,6 +396,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
protected SOAPMessage onMessage(SOAPMessage message) {
return message;
}
+
}
@SuppressWarnings("serial")
@@ -392,6 +406,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
protected SOAPMessage onMessage(SOAPMessage message) {
return null;
}
+
}
@SuppressWarnings("serial")
@@ -405,6 +420,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
body.addFault(SOAPConstants.SOAP_RECEIVER_FAULT, "Receiver Fault");
return response;
}
+
}
@SuppressWarnings("serial")
@@ -418,6 +434,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
body.addFault(SOAPConstants.SOAP_SENDER_FAULT, "Sender Fault");
return response;
}
+
}
@SuppressWarnings("serial")
@@ -429,5 +446,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
assertThat(message.countAttachments()).isEqualTo(1);
return null;
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
index 3e394640..b8193bec 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/DomPoxWebServiceTemplateIntegrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,6 @@
package org.springframework.ws.client.core;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.servlet.ServletConfig;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.http.HttpServlet;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
@@ -33,6 +25,11 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import jakarta.servlet.ServletConfig;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
@@ -41,6 +38,9 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.client.WebServiceTransportException;
import org.springframework.ws.pox.dom.DomPoxMessageFactory;
import org.springframework.ws.transport.http.HttpComponentsMessageSender;
@@ -49,8 +49,8 @@ import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.w3c.dom.Document;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
public class DomPoxWebServiceTemplateIntegrationTest {
@@ -102,9 +102,9 @@ public class DomPoxWebServiceTemplateIntegrationTest {
XmlAssert.assertThat(result.toString()).and(content).ignoreWhitespace().areIdentical();
assertThatExceptionOfType(WebServiceTransportException.class).isThrownBy(() -> template
- .sendSourceAndReceiveToResult(baseUrl + "/errors/notfound", new StringSource(content), new StringResult()));
- assertThatExceptionOfType(WebServiceTransportException.class).isThrownBy(
- () -> template.sendSourceAndReceiveToResult(baseUrl + "/errors/server", new StringSource(content), result));
+ .sendSourceAndReceiveToResult(baseUrl + "/errors/notfound", new StringSource(content), new StringResult()));
+ assertThatExceptionOfType(WebServiceTransportException.class).isThrownBy(() -> template
+ .sendSourceAndReceiveToResult(baseUrl + "/errors/server", new StringSource(content), result));
}
/** Servlet that returns and error message for a given status code. */
@@ -121,6 +121,7 @@ public class DomPoxWebServiceTemplateIntegrationTest {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.sendError(sc);
}
+
}
/** Simple POX Servlet. */
@@ -148,10 +149,12 @@ public class DomPoxWebServiceTemplateIntegrationTest {
Document message = documentBuilder.parse(req.getInputStream());
Transformer transformer = transformerFactory.newTransformer();
transformer.transform(new DOMSource(message), new StreamResult(resp.getOutputStream()));
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new ServletException("POX POST failed" + ex.getMessage());
}
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap11WebServiceTemplateIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap11WebServiceTemplateIntegrationTest.java
index 70c1d77e..d4b5b4ee 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap11WebServiceTemplateIntegrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap11WebServiceTemplateIntegrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@ public class SaajSoap11WebServiceTemplateIntegrationTest extends AbstractSoap11W
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
return new SaajSoapMessageFactory(messageFactory);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap12WebServiceTemplateIntegrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap12WebServiceTemplateIntegrationTest.java
index e42ca14c..4df53833 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap12WebServiceTemplateIntegrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SaajSoap12WebServiceTemplateIntegrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@ public class SaajSoap12WebServiceTemplateIntegrationTest extends AbstractSoap12W
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
return new SaajSoapMessageFactory(messageFactory);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleFaultMessageResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleFaultMessageResolverTest.java
index d549d948..5e7d1f35 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleFaultMessageResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleFaultMessageResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,18 @@
package org.springframework.ws.client.core;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.FaultAwareWebServiceMessage;
import org.springframework.ws.client.WebServiceFaultException;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class SimpleFaultMessageResolverTest {
private SimpleFaultMessageResolver resolver;
@@ -43,8 +47,9 @@ public class SimpleFaultMessageResolverTest {
replay(messageMock);
assertThatExceptionOfType(WebServiceFaultException.class).isThrownBy(() -> resolver.resolveFault(messageMock))
- .withMessage(message);
+ .withMessage(message);
verify(messageMock);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java
index 6d5790a8..dbf68f0b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/SimpleSaajServlet.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,6 +16,10 @@
package org.springframework.ws.client.core;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
@@ -27,10 +31,6 @@ import jakarta.xml.soap.MimeHeaders;
import jakarta.xml.soap.SOAPException;
import jakarta.xml.soap.SOAPMessage;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
import org.springframework.util.StringUtils;
/**
@@ -51,7 +51,8 @@ public class SimpleSaajServlet extends HttpServlet {
try {
msgFactory = MessageFactory.newInstance();
- } catch (SOAPException ex) {
+ }
+ catch (SOAPException ex) {
throw new ServletException("Unable to create message factory" + ex.getMessage());
}
}
@@ -97,14 +98,16 @@ public class SimpleSaajServlet extends HttpServlet {
if (reply.saveRequired()) {
reply.saveChanges();
}
- resp.setStatus(
- !reply.getSOAPBody().hasFault() ? HttpServletResponse.SC_OK : HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ resp.setStatus(!reply.getSOAPBody().hasFault() ? HttpServletResponse.SC_OK
+ : HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
putHeaders(reply.getMimeHeaders(), resp);
reply.writeTo(resp.getOutputStream());
- } else {
+ }
+ else {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
}
- } catch (Exception ex) {
+ }
+ catch (Exception ex) {
throw new ServletException("SAAJ POST failed " + ex.getMessage());
}
}
@@ -112,4 +115,5 @@ public class SimpleSaajServlet extends HttpServlet {
protected SOAPMessage onMessage(SOAPMessage message) {
return message;
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java
index 4649cf07..d022508f 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/core/WebServiceTemplateTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.client.core;
-import static org.assertj.core.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
import java.io.IOException;
import java.net.URI;
@@ -27,6 +24,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.ws.MockWebServiceMessage;
@@ -43,6 +41,15 @@ import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
+import static org.mockito.Mockito.isA;
+import static org.mockito.Mockito.isNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.when;
+
@SuppressWarnings("unchecked")
public class WebServiceTemplateTest {
@@ -171,7 +178,8 @@ public class WebServiceTemplateTest {
connectionMock.close();
assertThatExceptionOfType(WebServiceTransportException.class)
- .isThrownBy(() -> template.sendAndReceive(null, extractorMock)).withMessage(errorMessage);
+ .isThrownBy(() -> template.sendAndReceive(null, extractorMock))
+ .withMessage(errorMessage);
}
@Test
@@ -446,4 +454,5 @@ public class WebServiceTemplateTest {
assertThat(result).isNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProviderTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProviderTest.java
index a31ba0eb..c4ba8f35 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProviderTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/support/destination/Wsdl11DestinationProviderTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,16 +16,17 @@
package org.springframework.ws.client.support.destination;
-import static org.assertj.core.api.Assertions.*;
-
import java.net.URI;
import java.net.URISyntaxException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class Wsdl11DestinationProviderTest {
private Wsdl11DestinationProvider provider;
@@ -66,4 +67,5 @@ public class Wsdl11DestinationProviderTest {
assertThat(result).isEqualTo(new URI("http://example.com/soap12"));
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapterTest.java
index bf7d709d..955ab117 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/ClientInterceptorAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,15 +15,16 @@
*/
package org.springframework.ws.client.support.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.client.WebServiceClientException;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Greg Turnquist
*/
@@ -32,7 +33,8 @@ public class ClientInterceptorAdapterTest {
@Test
public void handleEmptyInterceptor() {
- ClientInterceptor interceptor = new ClientInterceptorAdapter() {};
+ ClientInterceptor interceptor = new ClientInterceptorAdapter() {
+ };
assertThat(interceptor.handleRequest(null)).isTrue();
assertThat(interceptor.handleResponse(null)).isTrue();
@@ -53,7 +55,8 @@ public class ClientInterceptorAdapterTest {
List bits = interceptor.getBits();
- assertThat(bits).containsExactly("handled request", "handled response", "handled fault", "handled afterCompletion");
+ assertThat(bits).containsExactly("handled request", "handled response", "handled fault",
+ "handled afterCompletion");
}
static class TestClientInterceptorAdapter extends ClientInterceptorAdapter {
@@ -93,5 +96,7 @@ public class ClientInterceptorAdapterTest {
public void afterCompletion(MessageContext messageContext, Exception ex) throws WebServiceClientException {
bits.add("handled afterCompletion");
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java
index 620d9c09..366c8657 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/client/support/interceptor/PayloadValidatingInterceptorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,20 +16,18 @@
package org.springframework.ws.client.support.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPConstants;
-import jakarta.xml.soap.SOAPMessage;
-
import java.io.InputStream;
import javax.xml.XMLConstants;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPConstants;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.io.ClassPathResource;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -43,6 +41,10 @@ import org.springframework.ws.soap.saaj.support.SaajUtils;
import org.springframework.xml.transform.TransformerFactoryUtils;
import org.springframework.xml.xsd.SimpleXsdSchema;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+
public class PayloadValidatingInterceptorTest {
private PayloadValidatingInterceptor interceptor;
@@ -90,7 +92,7 @@ public class PayloadValidatingInterceptorTest {
context = new DefaultMessageContext(invalidMessage, soap11Factory);
assertThatExceptionOfType(WebServiceClientException.class).isThrownBy(() -> interceptor.handleRequest(context))
- .withMessageContaining("XML validation error on response");
+ .withMessageContaining("XML validation error on response");
}
@Test
@@ -101,7 +103,7 @@ public class PayloadValidatingInterceptorTest {
context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
assertThatExceptionOfType(WebServiceClientException.class).isThrownBy(() -> interceptor.handleRequest(context))
- .withMessageContaining("XML validation error on response");
+ .withMessageContaining("XML validation error on response");
}
@Test
@@ -144,10 +146,11 @@ public class PayloadValidatingInterceptorTest {
@Test
public void testNamespacesInType() throws Exception {
- // Make sure we use Xerces for this testcase: the JAXP implementation used internally by JDK 1.5 has a bug
+ // Make sure we use Xerces for this testcase: the JAXP implementation used
+ // internally by JDK 1.5 has a bug
// See http://opensource.atlassian.com/projects/spring/browse/SWS-35
String previousSchemaFactory = System
- .getProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI, "");
+ .getProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI, "");
System.setProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI,
"org.apache.xerces.jaxp.validation.XMLSchemaFactory");
@@ -158,13 +161,15 @@ public class PayloadValidatingInterceptorTest {
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage saajMessage = SaajUtils.loadMessage(new ClassPathResource(VALID_SOAP_MESSAGE, getClass()),
messageFactory);
- context = new DefaultMessageContext(new SaajSoapMessage(saajMessage), new SaajSoapMessageFactory(messageFactory));
+ context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
+ new SaajSoapMessageFactory(messageFactory));
boolean result = interceptor.handleRequest(context);
assertThat(result).isTrue();
assertThat(context.hasResponse()).isFalse();
- } finally {
+ }
+ finally {
// Reset the property
System.setProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI,
previousSchemaFactory);
@@ -191,7 +196,7 @@ public class PayloadValidatingInterceptorTest {
context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
assertThatExceptionOfType(WebServiceClientException.class).isThrownBy(() -> interceptor.handleRequest(context))
- .withMessageContaining("XML validation error on response");
+ .withMessageContaining("XML validation error on response");
}
@Test
@@ -257,4 +262,5 @@ public class PayloadValidatingInterceptorTest {
assertThat(result).isTrue();
assertThat(context.hasResponse()).isFalse();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java
index 92fcd8e8..e3d4b795 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/AnnotationDrivenBeanDefinitionParserTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,12 @@
package org.springframework.ws.config;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.server.EndpointAdapter;
@@ -49,6 +48,8 @@ import org.springframework.ws.soap.server.endpoint.adapter.method.SoapHeaderElem
import org.springframework.ws.soap.server.endpoint.adapter.method.SoapMethodArgumentResolver;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
*/
@@ -58,7 +59,8 @@ public class AnnotationDrivenBeanDefinitionParserTest {
@BeforeEach
public void setUp() throws Exception {
- applicationContext = new ClassPathXmlApplicationContext("annotationDrivenBeanDefinitionParserTest.xml", getClass());
+ applicationContext = new ClassPathXmlApplicationContext("annotationDrivenBeanDefinitionParserTest.xml",
+ getClass());
}
@Test
@@ -89,7 +91,8 @@ public class AnnotationDrivenBeanDefinitionParserTest {
SoapHeaderElementMethodArgumentResolver.class, DomPayloadMethodProcessor.class,
SourcePayloadMethodProcessor.class, Dom4jPayloadMethodProcessor.class,
XmlRootElementPayloadMethodProcessor.class, JaxbElementPayloadMethodProcessor.class,
- JDomPayloadMethodProcessor.class, StaxPayloadMethodArgumentResolver.class, XomPayloadMethodProcessor.class);
+ JDomPayloadMethodProcessor.class, StaxPayloadMethodArgumentResolver.class,
+ XomPayloadMethodProcessor.class);
List returnValueHandlers = endpointAdapter.getMethodReturnValueHandlers();
@@ -103,10 +106,12 @@ public class AnnotationDrivenBeanDefinitionParserTest {
@Test
public void endpointExceptionResolver() {
- Map result = applicationContext.getBeansOfType(EndpointExceptionResolver.class);
+ Map result = applicationContext
+ .getBeansOfType(EndpointExceptionResolver.class);
assertThat(result).hasSize(2);
assertThat(result.values()).hasAtLeastOneElementOfType(SoapFaultAnnotationExceptionResolver.class);
assertThat(result.values()).hasAtLeastOneElementOfType(SimpleSoapExceptionResolver.class);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java
index c0bab74d..e8ce7ae5 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,7 +22,8 @@ import org.springframework.ws.server.EndpointInterceptor;
public class DummyInterceptor implements EndpointInterceptor {
- @Autowired private DummyInterceptorDependency autowiredDependency;
+ @Autowired
+ private DummyInterceptorDependency autowiredDependency;
private DummyInterceptorDependency propertyDependency;
@@ -54,5 +55,7 @@ public class DummyInterceptor implements EndpointInterceptor {
}
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception {
+ }
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java
index a6e0bda0..12c7b665 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/DummyMarshaller.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -41,4 +41,5 @@ public class DummyMarshaller implements Marshaller, Unmarshaller {
public Object unmarshal(Source source) throws XmlMappingException, IOException {
throw new UnsupportedOperationException();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java b/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java
index 148afd89..32dce4ff 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/MyInterceptor.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -50,5 +50,7 @@ public class MyInterceptor implements EndpointInterceptor {
}
@Override
- public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {}
+ public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) {
+ }
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/WebServiceNamespaceHandlerTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/WebServiceNamespaceHandlerTest.java
index 6edca6dc..1cd0a8f0 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/WebServiceNamespaceHandlerTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/WebServiceNamespaceHandlerTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,16 +16,17 @@
package org.springframework.ws.config;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class WebServiceNamespaceHandlerTest {
private ApplicationContext applicationContext;
@@ -39,8 +40,9 @@ public class WebServiceNamespaceHandlerTest {
public void testMarshallingMethods() throws Exception {
Map result = applicationContext
- .getBeansOfType(MarshallingMethodEndpointAdapter.class);
+ .getBeansOfType(MarshallingMethodEndpointAdapter.class);
assertThat(result).isNotEmpty();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/WebServicesNamespaceHandlerTigerTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/WebServicesNamespaceHandlerTigerTest.java
index 5d21ac00..8c98c6c5 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/WebServicesNamespaceHandlerTigerTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/WebServicesNamespaceHandlerTigerTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,31 +16,33 @@
package org.springframework.ws.config;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter;
import org.springframework.ws.server.endpoint.adapter.XPathParamAnnotationMethodEndpointAdapter;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class WebServicesNamespaceHandlerTigerTest {
private ApplicationContext applicationContext;
@BeforeEach
public void setUp() throws Exception {
- applicationContext = new ClassPathXmlApplicationContext("webServicesNamespaceHandlerTest-tiger.xml", getClass());
+ applicationContext = new ClassPathXmlApplicationContext("webServicesNamespaceHandlerTest-tiger.xml",
+ getClass());
}
@Test
public void testMarshallingEndpoints() {
Map result = applicationContext
- .getBeansOfType(GenericMarshallingMethodEndpointAdapter.class);
+ .getBeansOfType(GenericMarshallingMethodEndpointAdapter.class);
assertThat(result).isNotEmpty();
}
@@ -49,8 +51,9 @@ public class WebServicesNamespaceHandlerTigerTest {
public void testXpathEndpoints() {
Map result = applicationContext
- .getBeansOfType(XPathParamAnnotationMethodEndpointAdapter.class);
+ .getBeansOfType(XPathParamAnnotationMethodEndpointAdapter.class);
assertThat(result).isNotEmpty();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/WsdlBeanDefinitionParserTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/WsdlBeanDefinitionParserTest.java
index 355ca0a9..12b2f5cd 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/WsdlBeanDefinitionParserTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/WsdlBeanDefinitionParserTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,19 @@
package org.springframework.ws.config;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
import org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
*/
@@ -63,4 +64,5 @@ public class WsdlBeanDefinitionParserTest {
assertThat(result).isNotEmpty();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/DefaultWsConfigurationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/DefaultWsConfigurationTest.java
index 0fe5d086..30d4d276 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/DefaultWsConfigurationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/DefaultWsConfigurationTest.java
@@ -1,9 +1,24 @@
-package org.springframework.ws.config.annotation;
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-import static org.assertj.core.api.Assertions.*;
+package org.springframework.ws.config.annotation;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -15,6 +30,8 @@ import org.springframework.ws.soap.addressing.server.AnnotationActionEndpointMap
import org.springframework.ws.soap.server.endpoint.annotation.SoapAction;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
*/
@@ -36,7 +53,7 @@ public class DefaultWsConfigurationTest {
public void payloadRootAnnotationMethodEndpointMapping() {
PayloadRootAnnotationMethodEndpointMapping endpointMapping = this.applicationContext
- .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
+ .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
assertThat(endpointMapping.getOrder()).isEqualTo(0);
}
@@ -45,7 +62,7 @@ public class DefaultWsConfigurationTest {
public void soapActionAnnotationMethodEndpointMapping() {
SoapActionAnnotationMethodEndpointMapping endpointMapping = this.applicationContext
- .getBean(SoapActionAnnotationMethodEndpointMapping.class);
+ .getBean(SoapActionAnnotationMethodEndpointMapping.class);
assertThat(endpointMapping.getOrder()).isEqualTo(1);
}
@@ -54,7 +71,7 @@ public class DefaultWsConfigurationTest {
public void annotationActionEndpointMapping() {
AnnotationActionEndpointMapping endpointMapping = this.applicationContext
- .getBean(AnnotationActionEndpointMapping.class);
+ .getBean(AnnotationActionEndpointMapping.class);
assertThat(endpointMapping.getOrder()).isEqualTo(2);
}
@@ -76,13 +93,15 @@ public class DefaultWsConfigurationTest {
public TestEndpoint testEndpoint() {
return new TestEndpoint();
}
+
}
@Endpoint
private static class TestEndpoint {
@SoapAction("handle")
- public void handle() {}
+ public void handle() {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurationSupportTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurationSupportTest.java
index 79558b6c..22734395 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurationSupportTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurationSupportTest.java
@@ -1,11 +1,26 @@
-package org.springframework.ws.config.annotation;
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-import static org.assertj.core.api.Assertions.*;
+package org.springframework.ws.config.annotation;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -15,6 +30,8 @@ import org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapt
import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter;
import org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
*/
@@ -36,7 +53,7 @@ public class WsConfigurationSupportTest {
public void interceptors() {
PayloadRootAnnotationMethodEndpointMapping endpointMapping = this.applicationContext
- .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
+ .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
assertThat(endpointMapping.getOrder()).isEqualTo(0);
@@ -49,7 +66,8 @@ public class WsConfigurationSupportTest {
@Test
public void defaultMethodEndpointAdapter() {
- DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);
+ DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext
+ .getBean(DefaultMethodEndpointAdapter.class);
assertThat(endpointAdapter).isNotNull();
assertThat(endpointAdapter).isInstanceOf(MyDefaultMethodEndpointAdapter.class);
@@ -68,6 +86,7 @@ public class WsConfigurationSupportTest {
public DefaultMethodEndpointAdapter defaultMethodEndpointAdapter() {
return new MyDefaultMethodEndpointAdapter();
}
+
}
public static class MyInterceptor extends EndpointInterceptorAdapter {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
index a47ba18d..20f4dee0 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/config/annotation/WsConfigurerAdapterTest.java
@@ -1,11 +1,26 @@
-package org.springframework.ws.config.annotation;
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-import static org.assertj.core.api.Assertions.*;
+package org.springframework.ws.config.annotation;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
@@ -18,6 +33,8 @@ import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHa
import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter;
import org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
*/
@@ -39,7 +56,7 @@ public class WsConfigurerAdapterTest {
public void interceptors() {
PayloadRootAnnotationMethodEndpointMapping endpointMapping = this.applicationContext
- .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
+ .getBean(PayloadRootAnnotationMethodEndpointMapping.class);
assertThat(endpointMapping.getOrder()).isEqualTo(0);
@@ -52,7 +69,8 @@ public class WsConfigurerAdapterTest {
@Test
public void argumentResolvers() {
- DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);
+ DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext
+ .getBean(DefaultMethodEndpointAdapter.class);
List argumentResolvers = endpointAdapter.getCustomMethodArgumentResolvers();
@@ -67,7 +85,8 @@ public class WsConfigurerAdapterTest {
@Test
public void returnValueHandlers() {
- DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext.getBean(DefaultMethodEndpointAdapter.class);
+ DefaultMethodEndpointAdapter endpointAdapter = this.applicationContext
+ .getBean(DefaultMethodEndpointAdapter.class);
List returnValueHandlers = endpointAdapter.getCustomMethodReturnValueHandlers();
@@ -97,9 +116,12 @@ public class WsConfigurerAdapterTest {
public void addReturnValueHandlers(List returnValueHandlers) {
returnValueHandlers.add(new MyReturnValueHandler());
}
+
}
- public static class MyInterceptor extends EndpointInterceptorAdapter {}
+ public static class MyInterceptor extends EndpointInterceptorAdapter {
+
+ }
public static class MyMethodArgumentResolver implements MethodArgumentResolver {
@@ -112,6 +134,7 @@ public class WsConfigurerAdapterTest {
public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception {
return null;
}
+
}
public static class MyReturnValueHandler implements MethodReturnValueHandler {
@@ -123,6 +146,9 @@ public class WsConfigurerAdapterTest {
@Override
public void handleReturnValue(MessageContext messageContext, MethodParameter returnType, Object returnValue)
- throws Exception {}
+ throws Exception {
+ }
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/context/DefaultMessageContextTest.java b/spring-ws-core/src/test/java/org/springframework/ws/context/DefaultMessageContextTest.java
index 7e14c126..8502c79d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/context/DefaultMessageContextTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/context/DefaultMessageContextTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,19 @@
package org.springframework.ws.context;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class DefaultMessageContextTest {
private DefaultMessageContext context;
@@ -81,4 +85,5 @@ public class DefaultMessageContextTest {
assertThat(context.containsProperty(name)).isFalse();
assertThat(context.getPropertyNames()).isEmpty();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageFactoryTest.java b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageFactoryTest.java
index d1c18f84..24bd645b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageFactoryTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageFactoryTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -25,4 +25,5 @@ public class DomPoxMessageFactoryTest extends AbstractWebServiceMessageFactoryTe
protected WebServiceMessageFactory createMessageFactory() throws Exception {
return new DomPoxMessageFactory();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
index 6fa382ce..2ef85263 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/pox/dom/DomPoxMessageTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.pox.dom;
-import static org.xmlunit.assertj.XmlAssert.*;
-
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
@@ -28,11 +26,14 @@ import javax.xml.transform.TransformerFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.w3c.dom.Document;
+
+import static org.xmlunit.assertj.XmlAssert.assertThat;
public class DomPoxMessageTest {
@@ -86,4 +87,5 @@ public class DomPoxMessageTest {
assertThat(os.toString(StandardCharsets.UTF_8)).and(content).ignoreWhitespace().areIdentical();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java
index ebe187b1..9b2a8056 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/MessageDispatcherTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,11 @@
package org.springframework.ws.server;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.util.Collections;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.NoEndpointFoundException;
@@ -33,6 +31,16 @@ import org.springframework.ws.server.endpoint.adapter.PayloadEndpointAdapter;
import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping;
import org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class MessageDispatcherTest {
private MessageDispatcher dispatcher;
@@ -150,7 +158,8 @@ public class MessageDispatcherTest {
try {
dispatcher.processEndpointException(messageContext, endpoint, ex);
- } catch (Exception result) {
+ }
+ catch (Exception result) {
assertThat(result).isEqualTo(ex);
}
@@ -341,7 +350,8 @@ public class MessageDispatcherTest {
messageContext.getResponse();
try {
dispatcher.dispatch(messageContext);
- } catch (RuntimeException ex) {
+ }
+ catch (RuntimeException ex) {
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractEndpointTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractEndpointTestCase.java
index a489cc78..9aad3758 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractEndpointTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractEndpointTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,14 +33,15 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.junit.jupiter.api.Test;
-import org.springframework.util.xml.StaxUtils;
-import org.springframework.xml.DocumentBuilderFactoryUtils;
-import org.springframework.xml.XMLInputFactoryUtils;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
+import org.springframework.util.xml.StaxUtils;
+import org.springframework.xml.DocumentBuilderFactoryUtils;
+import org.springframework.xml.XMLInputFactoryUtils;
+
@SuppressWarnings("Since15")
public abstract class AbstractEndpointTestCase {
@@ -103,4 +104,5 @@ public abstract class AbstractEndpointTestCase {
}
protected abstract void testSource(Source requestSource) throws Exception;
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
index 6d08d86c..628fdd51 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractMessageEndpointTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,19 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.xml.transform.StringSource;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractMessageEndpointTestCase extends AbstractEndpointTestCase {
@@ -71,8 +72,10 @@ public abstract class AbstractMessageEndpointTestCase extends AbstractEndpointTe
endpoint.invoke(context);
assertThat(context.hasResponse()).isTrue();
- XmlAssert.assertThat(((MockWebServiceMessage) context.getResponse()).getPayloadAsString()).and(RESPONSE)
- .ignoreWhitespace().areSimilar();
+ XmlAssert.assertThat(((MockWebServiceMessage) context.getResponse()).getPayloadAsString())
+ .and(RESPONSE)
+ .ignoreWhitespace()
+ .areSimilar();
}
protected abstract MessageEndpoint createNoResponseEndpoint();
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
index a23c2764..c3cac787 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/AbstractPayloadEndpointTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,18 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractPayloadEndpointTestCase extends AbstractEndpointTestCase {
@@ -78,4 +79,5 @@ public abstract class AbstractPayloadEndpointTestCase extends AbstractEndpointTe
protected abstract PayloadEndpoint createResponseEndpoint() throws Exception;
protected abstract PayloadEndpoint createNoRequestEndpoint() throws Exception;
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/DomPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/DomPayloadEndpointTest.java
index ee40d079..a8c1661a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/DomPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/DomPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,11 +16,11 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class DomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
@Override
@@ -65,4 +65,5 @@ public class DomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
}
};
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/EndpointExceptionResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/EndpointExceptionResolverTest.java
index 3836f0d3..5d8947a6 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/EndpointExceptionResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/EndpointExceptionResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,15 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Collections;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* Test for AbstractEndpointExceptionResolver
*
@@ -59,5 +60,7 @@ public class EndpointExceptionResolverTest {
assertThat(matched).isTrue();
}
- public void emptyMethod() {}
+ public void emptyMethod() {
+ }
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/JDomPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/JDomPayloadEndpointTest.java
index e801ccb4..a07a9f0a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/JDomPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/JDomPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,11 +16,11 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import org.jdom2.Element;
import org.jdom2.Namespace;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
@Override
@@ -64,4 +64,5 @@ public class JDomPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
}
};
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
index 7e6fbd15..ae462528 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MarshallingPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
@@ -32,6 +29,8 @@ import javax.xml.transform.stream.StreamSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.oxm.XmlMappingException;
@@ -46,7 +45,15 @@ import org.springframework.ws.mime.MimeMessage;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
public class MarshallingPayloadEndpointTest {
@@ -80,7 +87,8 @@ public class MarshallingPayloadEndpointTest {
XmlAssert.assertThat(writer.toString()).and("").ignoreWhitespace().areIdentical();
return 42L;
- } catch (Exception e) {
+ }
+ catch (Exception e) {
fail(e.getMessage());
return null;
@@ -97,7 +105,8 @@ public class MarshallingPayloadEndpointTest {
try {
transformer.transform(new StreamSource(new StringReader("")), result);
- } catch (TransformerException e) {
+ }
+ catch (TransformerException e) {
fail(e.getMessage());
}
}
@@ -145,7 +154,8 @@ public class MarshallingPayloadEndpointTest {
XmlAssert.assertThat(writer.toString()).and("").ignoreWhitespace().areIdentical();
return (long) 42;
- } catch (Exception e) {
+ }
+ catch (Exception e) {
fail(e.getMessage());
return null;
}
@@ -264,6 +274,7 @@ public class MarshallingPayloadEndpointTest {
public boolean supports(Class> clazz) {
return false;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MethodEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MethodEndpointTest.java
index ac7e45c4..dd2f0019 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MethodEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/MethodEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,13 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import java.lang.reflect.Method;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class MethodEndpointTest {
private MethodEndpoint endpoint;
@@ -88,4 +88,5 @@ public class MethodEndpointTest {
myMethodInvoked = true;
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/SaxPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/SaxPayloadEndpointTest.java
index 33011b48..886e6192 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/SaxPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/SaxPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,17 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.transform.Source;
-import org.springframework.xml.transform.StringSource;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.helpers.DefaultHandler;
+import org.springframework.xml.transform.StringSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
public class SaxPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
@Override
@@ -97,5 +99,7 @@ public class SaxPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
assertThat(qName).isEqualTo(localName);
assertThat(uri).isEqualTo(NAMESPACE_URI);
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxEventPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxEventPayloadEndpointTest.java
index 6a5af73a..0a4ee164 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxEventPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/StaxEventPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Collections;
import javax.xml.namespace.QName;
@@ -28,6 +26,8 @@ import javax.xml.stream.events.Namespace;
import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.util.XMLEventConsumer;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* Test case for AbstractStaxEventPayloadEndpoint.
*
@@ -95,7 +95,8 @@ public class StaxEventPayloadEndpointTest extends AbstractMessageEndpointTestCas
Namespace namespace = eventFactory.createNamespace(NAMESPACE_URI);
QName name = new QName(NAMESPACE_URI, RESPONSE_ELEMENT);
- eventWriter.add(eventFactory.createStartElement(name, null, Collections.singleton(namespace).iterator()));
+ eventWriter
+ .add(eventFactory.createStartElement(name, null, Collections.singleton(namespace).iterator()));
eventWriter.add(eventFactory.createEndElement(name, Collections.singleton(namespace).iterator()));
eventWriter.add(eventFactory.createEndDocument());
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapterTest.java
index 3aef155c..4af56c87 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/DefaultMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,13 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -34,7 +32,19 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.server.endpoint.adapter.method.MethodArgumentResolver;
import org.springframework.ws.server.endpoint.adapter.method.MethodReturnValueHandler;
-/** @author Arjen Poutsma */
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.isNull;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+/**
+ * @author Arjen Poutsma
+ */
public class DefaultMethodEndpointAdapterTest {
private DefaultMethodEndpointAdapter adapter;
@@ -141,8 +151,7 @@ public class DefaultMethodEndpointAdapterTest {
// arg 1
expect(argumentResolver1.supportsParameter(isA(MethodParameter.class))).andReturn(false);
expect(argumentResolver2.supportsParameter(isA(MethodParameter.class))).andReturn(true);
- expect(argumentResolver2.resolveArgument(eq(messageContext), isA(MethodParameter.class)))
- .andReturn(42);
+ expect(argumentResolver2.resolveArgument(eq(messageContext), isA(MethodParameter.class))).andReturn(42);
expect(returnValueHandler.supportsReturnType(isA(MethodParameter.class))).andReturn(true);
returnValueHandler.handleReturnValue(eq(messageContext), isA(MethodParameter.class), eq(value));
@@ -195,7 +204,8 @@ public class DefaultMethodEndpointAdapterTest {
try {
adapter.invoke(messageContext, exceptionEndpoint);
fail("IOException expected");
- } catch (IOException expected) {
+ }
+ catch (IOException expected) {
// expected
}
@@ -226,4 +236,5 @@ public class DefaultMethodEndpointAdapterTest {
supportedArgument = s;
throw new IOException(s);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapterTest.java
index 381ca809..efb7cca3 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/GenericMarshallingMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.lang.reflect.Method;
import javax.xml.transform.Result;
@@ -26,6 +23,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.oxm.GenericMarshaller;
import org.springframework.oxm.GenericUnmarshaller;
import org.springframework.ws.WebServiceMessage;
@@ -36,6 +34,13 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class GenericMarshallingMethodEndpointAdapterTest {
private GenericMarshallingMethodEndpointAdapter adapter;
@@ -211,7 +216,8 @@ public class GenericMarshallingMethodEndpointAdapterTest {
return type;
}
- public void unsupportedMultipleParams(String s1, String s2) {}
+ public void unsupportedMultipleParams(String s1, String s2) {
+ }
public String unsupportedWrongParam(String s) {
return s;
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapterTest.java
index 3860b711..7129d35e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MarshallingMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.lang.reflect.Method;
import javax.xml.transform.Result;
@@ -26,6 +23,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
import org.springframework.ws.MockWebServiceMessage;
@@ -34,6 +32,13 @@ import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.MethodEndpoint;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class MarshallingMethodEndpointAdapterTest {
private MarshallingMethodEndpointAdapter adapter;
@@ -148,7 +153,8 @@ public class MarshallingMethodEndpointAdapterTest {
@Test
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
- Method unsupported = getClass().getMethod("unsupportedMultipleParams", new Class[] { String.class, String.class });
+ Method unsupported = getClass().getMethod("unsupportedMultipleParams",
+ new Class[] { String.class, String.class });
replay(marshallerMock, unmarshallerMock);
@@ -195,7 +201,8 @@ public class MarshallingMethodEndpointAdapterTest {
return new MyType();
}
- public void unsupportedMultipleParams(String s1, String s2) {}
+ public void unsupportedMultipleParams(String s1, String s2) {
+ }
public String unsupportedWrongParam(String s) {
return s;
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapterTest.java
index 3c608e0b..4b230e98 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/MessageMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,16 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.MethodEndpoint;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class MessageMethodEndpointAdapterTest {
private MessageMethodEndpointAdapter adapter;
@@ -50,15 +51,16 @@ public class MessageMethodEndpointAdapterTest {
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
assertThat(adapter.supportsInternal(new MethodEndpoint(this, "unsupportedMultipleParams",
- new Class[] { MessageContext.class, MessageContext.class }))).isFalse();
+ new Class[] { MessageContext.class, MessageContext.class })))
+ .isFalse();
}
@Test
public void testUnsupportedMethodWrongParam() throws NoSuchMethodException {
- assertThat(
- adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
- .isFalse();
+ assertThat(adapter
+ .supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
+ .isFalse();
}
@Test
@@ -77,7 +79,10 @@ public class MessageMethodEndpointAdapterTest {
supportedInvoked = true;
}
- public void unsupportedMultipleParams(MessageContext s1, MessageContext s2) {}
+ public void unsupportedMultipleParams(MessageContext s1, MessageContext s2) {
+ }
+
+ public void unsupportedWrongParam(String request) {
+ }
- public void unsupportedWrongParam(String request) {}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapterTest.java
index 47df19bb..c494e770 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/PayloadMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,13 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.WebServiceMessage;
@@ -31,6 +30,8 @@ import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.MethodEndpoint;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class PayloadMethodEndpointAdapterTest {
private PayloadMethodEndpointAdapter adapter;
@@ -66,23 +67,24 @@ public class PayloadMethodEndpointAdapterTest {
public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
assertThat(adapter.supportsInternal(
- new MethodEndpoint(this, "unsupportedMultipleParams", new Class[] { Source.class, Source.class }))).isFalse();
+ new MethodEndpoint(this, "unsupportedMultipleParams", new Class[] { Source.class, Source.class })))
+ .isFalse();
}
@Test
public void testUnsupportedMethodWrongReturnType() throws NoSuchMethodException {
- assertThat(
- adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongReturnType", new Class[] { Source.class })))
- .isFalse();
+ assertThat(adapter
+ .supportsInternal(new MethodEndpoint(this, "unsupportedWrongReturnType", new Class[] { Source.class })))
+ .isFalse();
}
@Test
public void testUnsupportedMethodWrongParam() throws NoSuchMethodException {
- assertThat(
- adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
- .isFalse();
+ assertThat(adapter
+ .supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class })))
+ .isFalse();
}
@Test
@@ -121,7 +123,8 @@ public class PayloadMethodEndpointAdapterTest {
return request;
}
- public void unsupportedMultipleParams(Source s1, Source s2) {}
+ public void unsupportedMultipleParams(Source s1, Source s2) {
+ }
public Source unsupportedWrongParam(String request) {
return null;
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapterTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapterTest.java
index 8ee8bc6f..e9b02573 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapterTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/XPathParamAnnotationMethodEndpointAdapterTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.server.endpoint.adapter;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.util.HashMap;
import java.util.Map;
@@ -29,6 +26,12 @@ import javax.xml.transform.dom.DOMSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -38,11 +41,12 @@ import org.springframework.ws.server.endpoint.annotation.XPathParam;
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
public class XPathParamAnnotationMethodEndpointAdapterTest {
@@ -74,7 +78,8 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
@Test
public void testUnsupportedInvalidReturnType() throws NoSuchMethodException {
- MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidReturnType", new Class[] { String.class });
+ MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidReturnType",
+ new Class[] { String.class });
assertThat(adapter.supports(endpoint)).isFalse();
}
@@ -191,7 +196,8 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
assertThat(namespacesInvoked).isTrue();
}
- public void supportedVoid(@XPathParam("/") String param1) {}
+ public void supportedVoid(@XPathParam("/") String param1) {
+ }
public Source supportedSource(@XPathParam("/") String param1) {
@@ -203,9 +209,9 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
return null;
}
- public void supportedTypes(@XPathParam("/root/child") boolean param1, @XPathParam("/root/child/number") double param2,
- @XPathParam("/root/child") Node param3, @XPathParam("/root/*") NodeList param4,
- @XPathParam("/root/child/text") String param5) {
+ public void supportedTypes(@XPathParam("/root/child") boolean param1,
+ @XPathParam("/root/child/number") double param2, @XPathParam("/root/child") Node param3,
+ @XPathParam("/root/*") NodeList param4, @XPathParam("/root/child/text") String param5) {
supportedTypesInvoked = true;
@@ -225,11 +231,13 @@ public class XPathParamAnnotationMethodEndpointAdapterTest {
return null;
}
- public void unsupportedInvalidParamType(@XPathParam("/") int param1) {}
+ public void unsupportedInvalidParamType(@XPathParam("/") int param1) {
+ }
public void namespaces(@XPathParam(".") Node param) {
namespacesInvoked = true;
assertThat(param.getLocalName()).isEqualTo("child");
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractMethodArgumentResolverTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractMethodArgumentResolverTestCase.java
index b8fb7f09..1f6f8288 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractMethodArgumentResolverTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractMethodArgumentResolverTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,12 +16,12 @@
package org.springframework.ws.server.endpoint.adapter.method;
+import javax.xml.transform.TransformerException;
+
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.SOAPException;
import jakarta.xml.soap.SOAPMessage;
-import javax.xml.transform.TransformerException;
-
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -75,4 +75,5 @@ public class AbstractMethodArgumentResolverTestCase extends TransformerObjectSup
return new DefaultMessageContext(request, soapMessageFactory);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
index 83c687df..ff3192f6 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/AbstractPayloadMethodProcessorTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,16 +16,17 @@
package org.springframework.ws.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
import org.springframework.xml.transform.StringResult;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractPayloadMethodProcessorTestCase extends AbstractMethodArgumentResolverTestCase {
@@ -56,7 +57,8 @@ public abstract class AbstractPayloadMethodProcessorTestCase extends AbstractMet
assertThat(processor.supportsParameter(supportedParameter)).isTrue();
}
- MethodParameter unsupportedParameter = new MethodParameter(getClass().getMethod("unsupported", String.class), 0);
+ MethodParameter unsupportedParameter = new MethodParameter(getClass().getMethod("unsupported", String.class),
+ 0);
assertThat(processor.supportsParameter(unsupportedParameter)).isFalse();
}
@@ -68,7 +70,8 @@ public abstract class AbstractPayloadMethodProcessorTestCase extends AbstractMet
assertThat(processor.supportsReturnType(supportedReturnType)).isTrue();
}
- MethodParameter unsupportedReturnType = new MethodParameter(getClass().getMethod("unsupported", String.class), -1);
+ MethodParameter unsupportedReturnType = new MethodParameter(getClass().getMethod("unsupported", String.class),
+ -1);
assertThat(processor.supportsReturnType(unsupportedReturnType)).isFalse();
}
@@ -104,7 +107,8 @@ public abstract class AbstractPayloadMethodProcessorTestCase extends AbstractMet
}
}
- protected void testArgument(Object argument, MethodParameter parameter) {}
+ protected void testArgument(Object argument, MethodParameter parameter) {
+ }
@Test
public void saajReturnValue() throws Exception {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessorTest.java
index 0b66b76c..730c9b0a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MarshallingPayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.lang.reflect.Type;
import javax.xml.transform.Result;
@@ -26,6 +23,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.oxm.GenericMarshaller;
import org.springframework.oxm.GenericUnmarshaller;
@@ -33,6 +31,15 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class MarshallingPayloadMethodProcessorTest extends AbstractMethodArgumentResolverTestCase {
private MarshallingPayloadMethodProcessor processor;
@@ -203,4 +210,5 @@ public class MarshallingPayloadMethodProcessorTest extends AbstractMethodArgumen
public static class MyObject {
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolverTest.java
index c595086d..d794cbe9 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/MessageContextMethodArgumentResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,16 @@
package org.springframework.ws.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class MessageContextMethodArgumentResolverTest {
private MessageContextMethodArgumentResolver resolver;
@@ -53,6 +54,7 @@ public class MessageContextMethodArgumentResolverTest {
assertThat(result).isSameAs(messageContext);
}
- public void supported(MessageContext messageContext) {}
+ public void supported(MessageContext messageContext) {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessorTest.java
index e2d6f4b8..5f9336e0 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/SourcePayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,7 +27,9 @@ import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import org.springframework.xml.transform.StringSource;
-/** @author Arjen Poutsma */
+/**
+ * @author Arjen Poutsma
+ */
public class SourcePayloadMethodProcessorTest extends AbstractPayloadMethodProcessorTestCase {
@Override
@@ -86,4 +88,5 @@ public class SourcePayloadMethodProcessorTest extends AbstractPayloadMethodProce
public StAXSource stax(@RequestPayload StAXSource source) {
return source;
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolverTest.java
index 729dbe0f..5950f7f4 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/StaxPayloadMethodArgumentResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
@@ -27,11 +25,16 @@ import javax.xml.stream.events.XMLEvent;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
-/** @author Arjen Poutsma */
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Arjen Poutsma
+ */
@SuppressWarnings("Since15")
public class StaxPayloadMethodArgumentResolverTest extends AbstractMethodArgumentResolverTestCase {
@@ -170,9 +173,13 @@ public class StaxPayloadMethodArgumentResolverTest extends AbstractMethodArgumen
assertThat(startElement.getName().getLocalPart()).isEqualTo(LOCAL_NAME);
}
- public void invalid(XMLStreamReader streamReader) {}
+ public void invalid(XMLStreamReader streamReader) {
+ }
- public void streamReader(@RequestPayload XMLStreamReader streamReader) {}
+ public void streamReader(@RequestPayload XMLStreamReader streamReader) {
+ }
+
+ public void eventReader(@RequestPayload XMLEventReader streamReader) {
+ }
- public void eventReader(@RequestPayload XMLEventReader streamReader) {}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolverTest.java
index f29f1fd0..9a2c715c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/XPathParamMethodArgumentResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,12 +16,13 @@
package org.springframework.ws.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import java.lang.reflect.Method;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -30,8 +31,8 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.Namespace;
import org.springframework.ws.server.endpoint.annotation.Namespaces;
import org.springframework.ws.server.endpoint.annotation.XPathParam;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+
+import static org.assertj.core.api.Assertions.assertThat;
@Namespaces(@Namespace(prefix = "tns", uri = "http://springframework.org/spring-ws"))
public class XPathParamMethodArgumentResolverTest {
@@ -201,20 +202,25 @@ public class XPathParamMethodArgumentResolverTest {
assertThat(result).isEqualTo("text");
}
- public void unsupported(String s) {}
+ public void unsupported(String s) {
+ }
public void supportedTypes( //
@XPathParam("/root/child") boolean param1, //
@XPathParam("/root/child/number") double param2, //
@XPathParam("/root/child") Node param3, //
@XPathParam("/root/*") NodeList param4, //
- @XPathParam("/root/child/text") String param5) {}
+ @XPathParam("/root/child/text") String param5) {
+ }
- public void convertedType(@XPathParam("/root/child/number") int param) {}
+ public void convertedType(@XPathParam("/root/child/number") int param) {
+ }
@Namespaces(@Namespace(prefix = "tns", uri = "http://springframework.org/spring-ws"))
- public void namespacesMethod(@XPathParam("/tns:root") String s) {}
+ public void namespacesMethod(@XPathParam("/tns:root") String s) {
+ }
- public void namespacesClass(@XPathParam("/tns:root") String s) {}
+ public void namespacesClass(@XPathParam("/tns:root") String s) {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessorTest.java
index 0474501c..6b53ca76 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/JDomPayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,16 @@
package org.springframework.ws.server.endpoint.adapter.method.dom;
-import static org.assertj.core.api.Assertions.*;
-
import org.jdom2.Element;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadMethodProcessorTestCase;
import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSourceMethodProcessor;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class JDomPayloadMethodProcessorTest extends AbstractPayloadMethodProcessorTestCase {
@Override
@@ -62,4 +63,5 @@ public class JDomPayloadMethodProcessorTest extends AbstractPayloadMethodProcess
public Element element(@RequestPayload Element element) {
return element;
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessorTest.java
index 573ca819..86b8042e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/dom/XomPayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint.adapter.method.dom;
-import static org.assertj.core.api.Assertions.*;
-
import nu.xom.Element;
import org.springframework.core.MethodParameter;
@@ -26,6 +24,8 @@ import org.springframework.ws.server.endpoint.adapter.method.AbstractPayloadSour
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class XomPayloadMethodProcessorTest extends AbstractPayloadMethodProcessorTestCase {
@Override
@@ -63,4 +63,5 @@ public class XomPayloadMethodProcessorTest extends AbstractPayloadMethodProcesso
public Element element(@RequestPayload Element element) {
return element;
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
index 75d866ba..8499fbd8 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/JaxbElementPayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,16 @@
package org.springframework.ws.server.endpoint.adapter.method.jaxb;
-import static org.assertj.core.api.Assertions.*;
+import javax.xml.namespace.QName;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
-
-import javax.xml.namespace.QName;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -35,7 +34,8 @@ import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public class JaxbElementPayloadMethodProcessorTest {
@@ -98,7 +98,9 @@ public class JaxbElementPayloadMethodProcessorTest {
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
XmlAssert.assertThat(response.getPayloadAsString())
- .and("Foo").ignoreWhitespace().areIdentical();
+ .and("Foo")
+ .ignoreWhitespace()
+ .areIdentical();
}
@Test
@@ -107,15 +109,18 @@ public class JaxbElementPayloadMethodProcessorTest {
MessageContext messageContext = new DefaultMessageContext(new MockWebServiceMessageFactory());
String s = "Foo";
- JAXBElement element = new JAXBElement<>(new QName("http://springframework.org", "string"), String.class, s);
+ JAXBElement element = new JAXBElement<>(new QName("http://springframework.org", "string"), String.class,
+ s);
processor.handleReturnValue(messageContext, stringReturnType, element);
assertThat(messageContext.hasResponse()).isTrue();
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
- XmlAssert.assertThat(response.getPayloadAsString()).and("Foo")
- .ignoreWhitespace().areIdentical();
+ XmlAssert.assertThat(response.getPayloadAsString())
+ .and("Foo")
+ .ignoreWhitespace()
+ .areIdentical();
}
@Test
@@ -151,6 +156,7 @@ public class JaxbElementPayloadMethodProcessorTest {
public void setString(String string) {
this.string = string;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
index cc037c5a..1bd4e582 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/adapter/method/jaxb/XmlRootElementPayloadMethodProcessorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,21 +16,25 @@
package org.springframework.ws.server.endpoint.adapter.method.jaxb;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.bind.JAXBException;
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlRootElement;
-import jakarta.xml.bind.annotation.XmlType;
-
import java.io.OutputStream;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -40,12 +44,8 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import org.springframework.xml.sax.AbstractXmlReader;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.AttributesImpl;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public class XmlRootElementPayloadMethodProcessorTest {
@@ -164,7 +164,8 @@ public class XmlRootElementPayloadMethodProcessorTest {
}
};
- // Create a message context with that request. Note that the message factory doesn't matter here:
+ // Create a message context with that request. Note that the message factory
+ // doesn't matter here:
// it is required but not used.
MessageContext messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
@@ -191,7 +192,9 @@ public class XmlRootElementPayloadMethodProcessorTest {
MockWebServiceMessage response = (MockWebServiceMessage) messageContext.getResponse();
XmlAssert.assertThat(response.getPayloadAsString())
- .and("Foo").ignoreWhitespace().areIdentical();
+ .and("Foo")
+ .ignoreWhitespace()
+ .areIdentical();
}
@Test
@@ -210,7 +213,8 @@ public class XmlRootElementPayloadMethodProcessorTest {
return rootElement;
}
- public void type(@RequestPayload MyType type) {}
+ public void type(@RequestPayload MyType type) {
+ }
@XmlRootElement(name = "root", namespace = "http://springframework.org")
public static class MyRootElement {
@@ -225,6 +229,7 @@ public class XmlRootElementPayloadMethodProcessorTest {
public void setString(String string) {
this.string = string;
}
+
}
@XmlType(name = "root", namespace = "http://springframework.org")
@@ -240,6 +245,7 @@ public class XmlRootElementPayloadMethodProcessorTest {
public void setString(String string) {
this.string = string;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
index 645f500c..bd34659c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/interceptor/PayloadTransformingInterceptorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,16 @@
package org.springframework.ws.server.endpoint.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPMessage;
-
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ws.MockWebServiceMessage;
@@ -41,7 +40,9 @@ import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.transform.ResourceSource;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class PayloadTransformingInterceptorTest {
@@ -187,4 +188,5 @@ public class PayloadTransformingInterceptorTest {
public void testNoStylesheetsSet() {
assertThatIllegalArgumentException().isThrownBy(() -> interceptor.afterPropertiesSet());
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/BridgedMethodRegistrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/BridgedMethodRegistrationTest.java
index f5c04816..e8dd994d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/BridgedMethodRegistrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/BridgedMethodRegistrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,13 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
@@ -32,18 +31,23 @@ import org.springframework.ws.server.endpoint.MethodEndpoint;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
+import static org.assertj.core.api.Assertions.assertThat;
+
@ExtendWith(SpringExtension.class)
@ContextConfiguration("bridged-method-registration.xml")
public class BridgedMethodRegistrationTest {
- @Autowired private PayloadRootAnnotationMethodEndpointMapping mapping;
+ @Autowired
+ private PayloadRootAnnotationMethodEndpointMapping mapping;
- @Autowired private ApplicationContext applicationContext;
+ @Autowired
+ private ApplicationContext applicationContext;
@Test
public void registration() throws NoSuchMethodException {
- MethodEndpoint bridgedMethod = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
+ MethodEndpoint bridgedMethod = mapping
+ .lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
assertThat(bridgedMethod).isNotNull();
@@ -60,6 +64,7 @@ public class BridgedMethodRegistrationTest {
public A doIt() {
return this;
}
+
}
public static class B extends A {
@@ -68,6 +73,7 @@ public class BridgedMethodRegistrationTest {
public B doIt() {
return this;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/CgLibProxyRegistrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/CgLibProxyRegistrationTest.java
index 38b48155..8c4dc59e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/CgLibProxyRegistrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/CgLibProxyRegistrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
@@ -25,6 +23,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
@@ -34,18 +33,23 @@ import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
+import static org.assertj.core.api.Assertions.assertThat;
+
@ExtendWith(SpringExtension.class)
@ContextConfiguration("cglib-proxy-registration.xml")
public class CgLibProxyRegistrationTest {
- @Autowired private PayloadRootAnnotationMethodEndpointMapping mapping;
+ @Autowired
+ private PayloadRootAnnotationMethodEndpointMapping mapping;
- @Autowired private ApplicationContext applicationContext;
+ @Autowired
+ private ApplicationContext applicationContext;
@Test
public void registration() throws NoSuchMethodException {
- MethodEndpoint cglibProxy = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
+ MethodEndpoint cglibProxy = mapping
+ .lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
assertThat(cglibProxy).isNotNull();
@@ -60,7 +64,8 @@ public class CgLibProxyRegistrationTest {
@PayloadRoot(localPart = "Request", namespace = "http://springframework.org/spring-ws")
@Log
- public void doIt(@RequestPayload Source payload) {}
+ public void doIt(@RequestPayload Source payload) {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/EndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/EndpointMappingTest.java
index d8a58673..d2901941 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/EndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/EndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,9 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -29,6 +28,8 @@ import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.endpoint.interceptor.DelegatingSmartEndpointInterceptor;
import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* Test case for {@link AbstractEndpointMapping}.
*/
@@ -198,6 +199,7 @@ public class EndpointMappingTest {
private MyEndpoint() {
constructorCount++;
}
+
}
private static class MySmartEndpointInterceptor extends DelegatingSmartEndpointInterceptor {
@@ -205,6 +207,7 @@ public class EndpointMappingTest {
private MySmartEndpointInterceptor() {
super(new EndpointInterceptorAdapter());
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java
index d739e420..fca9360f 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/JdkProxyRegistrationTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
@@ -25,6 +23,7 @@ import javax.xml.transform.Source;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
@@ -34,13 +33,17 @@ import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
+import static org.assertj.core.api.Assertions.assertThat;
+
@ExtendWith(SpringExtension.class)
@ContextConfiguration("jdk-proxy-registration.xml")
public class JdkProxyRegistrationTest {
- @Autowired private PayloadRootAnnotationMethodEndpointMapping mapping;
+ @Autowired
+ private PayloadRootAnnotationMethodEndpointMapping mapping;
- @Autowired private ApplicationContext applicationContext;
+ @Autowired
+ private ApplicationContext applicationContext;
@Test
public void registration() throws NoSuchMethodException {
@@ -61,12 +64,14 @@ public class JdkProxyRegistrationTest {
@PayloadRoot(localPart = "Request", namespace = "http://springframework.org/spring-ws")
@Log
void doIt(Source payload);
+
}
public static class MyEndpointImpl implements MyEndpoint {
@Override
- public void doIt(@RequestPayload Source payload) {}
+ public void doIt(@RequestPayload Source payload) {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/LogAspect.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/LogAspect.java
index 04d22a73..fecd32a2 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/LogAspect.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/LogAspect.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -47,7 +47,8 @@ public class LogAspect {
try {
return joinPoint.proceed();
- } finally {
+ }
+ finally {
logger.info("After: " + joinPoint.getSignature());
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/MapBasedSoapEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/MapBasedSoapEndpointMappingTest.java
index f65b5508..e615f4b7 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/MapBasedSoapEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/MapBasedSoapEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,16 +16,17 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Arrays;
import java.util.Map;
import java.util.TreeMap;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* Test case for AbstractMapBasedEndpointMapping.
*/
@@ -126,6 +127,7 @@ public class MapBasedSoapEndpointMappingTest {
protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
return key;
}
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootAnnotationMethodEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootAnnotationMethodEndpointMappingTest.java
index 8a9e8277..720d53df 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootAnnotationMethodEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootAnnotationMethodEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,20 +16,18 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPMessage;
-
import java.lang.reflect.Method;
import java.util.Collections;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPMessage;
import org.apache.commons.logging.LogFactory;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
@@ -49,13 +47,17 @@ import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.server.SoapMessageDispatcher;
+import static org.assertj.core.api.Assertions.assertThat;
+
@ExtendWith(SpringExtension.class)
@ContextConfiguration("payloadRootAnnotationMethodEndpointMapping.xml")
public class PayloadRootAnnotationMethodEndpointMappingTest {
- @Autowired private PayloadRootAnnotationMethodEndpointMapping mapping;
+ @Autowired
+ private PayloadRootAnnotationMethodEndpointMapping mapping;
- @Autowired private ApplicationContext applicationContext;
+ @Autowired
+ private ApplicationContext applicationContext;
@Test
public void registrationSingle() throws NoSuchMethodException {
@@ -122,8 +124,8 @@ public class PayloadRootAnnotationMethodEndpointMappingTest {
MessageDispatcher messageDispatcher = new SoapMessageDispatcher();
messageDispatcher.setApplicationContext(applicationContext);
- messageDispatcher.setEndpointMappings(Collections. singletonList(mapping));
- messageDispatcher.setEndpointAdapters(Collections. singletonList(adapter));
+ messageDispatcher.setEndpointMappings(Collections.singletonList(mapping));
+ messageDispatcher.setEndpointAdapters(Collections.singletonList(adapter));
messageDispatcher.receive(messageContext);
@@ -156,7 +158,8 @@ public class PayloadRootAnnotationMethodEndpointMappingTest {
@PayloadRoots({ //
@PayloadRoot(localPart = "Request1", namespace = "http://springframework.org/spring-ws"),
@PayloadRoot(localPart = "Request2", namespace = "http://springframework.org/spring-ws") })
- public void doItMultiple() {}
+ public void doItMultiple() {
+ }
@PayloadRoot(localPart = "Request3", namespace = "http://springframework.org/spring-ws")
@PayloadRoot(localPart = "Request4", namespace = "http://springframework.org/spring-ws")
@@ -174,4 +177,5 @@ public class PayloadRootAnnotationMethodEndpointMappingTest {
}
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootQNameEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootQNameEndpointMappingTest.java
index c0992274..6ed6cd7d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootQNameEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/PayloadRootQNameEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,18 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.namespace.QName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class PayloadRootQNameEndpointMappingTest {
private PayloadRootQNameEndpointMapping mapping;
@@ -59,4 +60,5 @@ public class PayloadRootQNameEndpointMappingTest {
assertThat(qName).isNotNull();
assertThat(qName).isEqualTo(new QName("namespace", "localname", "prefix"));
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMappingTest.java
index f49ea413..22475ae9 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/SimpleMethodEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,16 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SimpleMethodEndpointMappingTest {
private SimpleMethodEndpointMapping mapping;
@@ -77,5 +78,7 @@ public class SimpleMethodEndpointMappingTest {
public void request() {
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/UriEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/UriEndpointMappingTest.java
index bbde46ad..46bd1465 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/UriEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/UriEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,12 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.net.URI;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
@@ -31,6 +29,12 @@ import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.context.DefaultTransportContext;
import org.springframework.ws.transport.context.TransportContextHolder;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class UriEndpointMappingTest {
private UriEndpointMapping mapping;
@@ -89,4 +93,5 @@ public class UriEndpointMappingTest {
assertThat(mapping.validateLookupKey("http://example.com/services")).isTrue();
assertThat(mapping.validateLookupKey("some string")).isFalse();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/XPathPayloadEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/XPathPayloadEndpointMappingTest.java
index 98f46b0d..9a036393 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/XPathPayloadEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/XPathPayloadEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,15 +16,16 @@
package org.springframework.ws.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class XPathPayloadEndpointMappingTest {
private XPathPayloadEndpointMapping mapping;
@@ -48,4 +49,5 @@ public class XPathPayloadEndpointMappingTest {
assertThat(result).isNotNull();
assertThat(result).isEqualTo("value");
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/jaxb/XmlRootElementEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/jaxb/XmlRootElementEndpointMappingTest.java
index 6b7a126f..76d61f0b 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/jaxb/XmlRootElementEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/mapping/jaxb/XmlRootElementEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,16 @@
package org.springframework.ws.server.endpoint.mapping.jaxb;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.bind.annotation.XmlRootElement;
-
import java.lang.reflect.Method;
import javax.xml.namespace.QName;
+import jakarta.xml.bind.annotation.XmlRootElement;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class XmlRootElementEndpointMappingTest {
private XmlRootElementEndpointMapping mapping;
@@ -45,7 +44,8 @@ public class XmlRootElementEndpointMappingTest {
assertThat(name).isEqualTo(new QName("myNamespace", "myRoot"));
}
- public void rootElement(MyRootElement rootElement) {}
+ public void rootElement(MyRootElement rootElement) {
+ }
@XmlRootElement(name = "myRoot", namespace = "myNamespace")
public static class MyRootElement {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/support/PayloadRootUtilsTest.java b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/support/PayloadRootUtilsTest.java
index d743bb1f..a324a10e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/support/PayloadRootUtilsTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/server/endpoint/support/PayloadRootUtilsTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.server.endpoint.support;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.StringReader;
import javax.xml.namespace.QName;
@@ -32,13 +30,16 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.junit.jupiter.api.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
import org.springframework.util.xml.StaxUtils;
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.XMLInputFactoryUtils;
import org.springframework.xml.transform.TransformerFactoryUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
+
+import static org.assertj.core.api.Assertions.assertThat;
public class PayloadRootUtilsTest {
@@ -120,4 +121,5 @@ public class PayloadRootUtilsTest {
assertThat(qName).isNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapElementTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapElementTestCase.java
index 5f4800cc..4f12d17e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapElementTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapElementTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Iterator;
import javax.xml.namespace.QName;
@@ -26,8 +24,11 @@ import javax.xml.transform.TransformerFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.xml.transform.TransformerFactoryUtils;
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractSoapElementTestCase {
private SoapElement soapElement;
@@ -73,4 +74,5 @@ public abstract class AbstractSoapElementTestCase {
String namespace = "http://springframework.org/spring-ws";
soapElement.addNamespaceDeclaration(prefix, namespace);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapEnvelopeTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapEnvelopeTestCase.java
index 351f0e34..f9586965 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapEnvelopeTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapEnvelopeTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,10 @@
package org.springframework.ws.soap;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractSoapEnvelopeTestCase extends AbstractSoapElementTestCase {
protected SoapEnvelope soapEnvelope;
@@ -48,4 +48,5 @@ public abstract class AbstractSoapEnvelopeTestCase extends AbstractSoapElementTe
assertThat(body).isNotNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
index be6331f3..eb6dec14 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapHeaderTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,16 +16,17 @@
package org.springframework.ws.soap;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Iterator;
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoapHeaderTestCase extends AbstractSoapElementTestCase {
@@ -100,8 +101,9 @@ public abstract class AbstractSoapHeaderTestCase extends AbstractSoapElementTest
transformer.transform(headerElement.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("")
- .ignoreWhitespace().areSimilar();
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
assertThat(iterator.hasNext()).isFalse();
}
@@ -169,4 +171,5 @@ public abstract class AbstractSoapHeaderTestCase extends AbstractSoapElementTest
XmlAssert.assertThat(result.toString()).and(expected).ignoreWhitespace().areSimilar();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageFactoryTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageFactoryTestCase.java
index 878b8895..bce5ff1c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageFactoryTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageFactoryTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,15 @@
package org.springframework.ws.soap;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.AbstractWebServiceMessageFactoryTestCase;
import org.springframework.ws.InvalidXmlException;
import org.springframework.ws.WebServiceMessage;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+
public abstract class AbstractSoapMessageFactoryTestCase extends AbstractWebServiceMessageFactoryTestCase {
@Test
@@ -51,4 +53,5 @@ public abstract class AbstractSoapMessageFactoryTestCase extends AbstractWebServ
@Test
public abstract void testCreateSoapMessageMissingContentType() throws Exception;
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
index f072276a..7594923a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/AbstractSoapMessageTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.ByteArrayOutputStream;
import java.util.Map;
import java.util.regex.Matcher;
@@ -28,6 +26,9 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.junit.jupiter.api.Test;
+import org.xml.sax.SAXParseException;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
import org.springframework.ws.mime.AbstractMimeMessageTestCase;
@@ -39,8 +40,9 @@ import org.springframework.ws.transport.TransportConstants;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.validation.XmlValidator;
import org.springframework.xml.validation.XmlValidatorFactory;
-import org.xml.sax.SAXParseException;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
public abstract class AbstractSoapMessageTestCase extends AbstractMimeMessageTestCase {
@@ -64,7 +66,8 @@ public abstract class AbstractSoapMessageTestCase extends AbstractMimeMessageTes
@Test
public void testValidate() throws Exception {
- XmlValidator validator = XmlValidatorFactory.createValidator(getSoapSchemas(), XmlValidatorFactory.SCHEMA_W3C_XML);
+ XmlValidator validator = XmlValidatorFactory.createValidator(getSoapSchemas(),
+ XmlValidatorFactory.SCHEMA_W3C_XML);
SAXParseException[] errors = validator.validate(soapMessage.getEnvelope().getSource());
if (errors.length > 0) {
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
index 7387f28b..34e5b938 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/AbstractWsAddressingTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,21 +16,21 @@
package org.springframework.ws.soap.addressing;
-import static org.assertj.core.api.Assertions.*;
+import java.io.IOException;
+import java.io.InputStream;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.MimeHeaders;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
import org.junit.jupiter.api.BeforeEach;
-import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.w3c.dom.Document;
import org.xmlunit.assertj.XmlAssert;
+import org.springframework.ws.soap.saaj.SaajSoapMessage;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractWsAddressingTestCase {
protected MessageFactory messageFactory;
@@ -50,7 +50,8 @@ public abstract class AbstractWsAddressingTestCase {
try {
return new SaajSoapMessage(messageFactory.createMessage(mimeHeaders, is));
- } finally {
+ }
+ finally {
is.close();
}
}
@@ -60,10 +61,11 @@ public abstract class AbstractWsAddressingTestCase {
Document expectedDocument = expected.getSaajMessage().getSOAPPart();
Document resultDocument = result.getSaajMessage().getSOAPPart();
- XmlAssert.assertThat(resultDocument).and(expectedDocument) //
- .ignoreWhitespace() //
- .ignoreChildNodesOrder() //
- .areSimilar();
+ XmlAssert.assertThat(resultDocument)
+ .and(expectedDocument) //
+ .ignoreWhitespace() //
+ .ignoreChildNodesOrder() //
+ .areSimilar();
}
protected void assertXMLNotSimilar(SaajSoapMessage expected, SaajSoapMessage result) {
@@ -71,8 +73,10 @@ public abstract class AbstractWsAddressingTestCase {
Document expectedDocument = expected.getSaajMessage().getSOAPPart();
Document resultDocument = result.getSaajMessage().getSOAPPart();
- XmlAssert.assertThat(resultDocument).and(expectedDocument) //
- .ignoreWhitespace() //
- .areNotSimilar();
+ XmlAssert.assertThat(resultDocument)
+ .and(expectedDocument) //
+ .ignoreWhitespace() //
+ .areNotSimilar();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback10Test.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback10Test.java
index df9cb1b8..6d4e826e 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback10Test.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback10Test.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@ public class ActionCallback10Test extends AbstractActionCallbackTestCase {
protected String getTestPath() {
return "10";
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback200408Test.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback200408Test.java
index d6c90a54..480a6881 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback200408Test.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/client/ActionCallback200408Test.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,4 +30,5 @@ public class ActionCallback200408Test extends AbstractActionCallbackTestCase {
protected String getTestPath() {
return "200408";
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategyTest.java
index f24c5893..23d6b6d7 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategyTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/messageid/UuidMessageIdStrategyTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,13 @@
package org.springframework.ws.soap.addressing.messageid;
-import static org.assertj.core.api.Assertions.*;
-
import java.net.URI;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class UuidMessageIdStrategyTest {
private MessageIdStrategy strategy;
@@ -44,4 +44,5 @@ public class UuidMessageIdStrategyTest {
assertThat(messageId2).isNotNull();
assertThat(messageId2).isNotEqualTo(messageId1);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
index 5943c075..f3a4fccc 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor10Test.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,6 @@
package org.springframework.ws.soap.addressing.server;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.net.URI;
import org.springframework.ws.context.DefaultMessageContext;
@@ -29,6 +26,11 @@ import org.springframework.ws.soap.addressing.version.AddressingVersion;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class AddressingInterceptor10Test extends AbstractAddressingInterceptorTestCase {
@Override
@@ -55,8 +57,7 @@ public class AddressingInterceptor10Test extends AbstractAddressingInterceptorTe
SaajSoapMessage expectedResponse = loadSaajMessage(getTestPath() + "/response-anonymous.xml");
- assertXMLSimilar(expectedResponse,
- (SaajSoapMessage) context.getResponse());
+ assertXMLSimilar(expectedResponse, (SaajSoapMessage) context.getResponse());
verify(strategyMock);
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor200408Test.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor200408Test.java
index d9df59f4..7c3b7a3c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor200408Test.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AddressingInterceptor200408Test.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -35,4 +35,5 @@ public class AddressingInterceptor200408Test extends AbstractAddressingIntercept
public void testNoneReplyTo() throws Exception {
// This version of the spec does not have none addresses
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
index 8a98fb64..cc532eff 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/AnnotationActionMethodEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,16 @@
package org.springframework.ws.soap.addressing.server;
-import static org.assertj.core.api.Assertions.*;
+import java.io.IOException;
+import java.io.InputStream;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.MimeHeaders;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
@@ -41,6 +39,8 @@ import org.springframework.ws.soap.addressing.server.annotation.Address;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+
/**
* @author Arjen Poutsma
* @author Nate Stoddard
@@ -96,7 +96,8 @@ public class AnnotationActionMethodEndpointMappingTest {
try {
SaajSoapMessage message = new SaajSoapMessage(messageFactory.createMessage(mimeHeaders, is));
return new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));
- } finally {
+ }
+ finally {
is.close();
}
}
@@ -109,6 +110,7 @@ public class AnnotationActionMethodEndpointMappingTest {
public void doIt() {
}
+
}
private static class MyInterceptor extends DelegatingSmartEndpointInterceptor {
@@ -116,6 +118,7 @@ public class AnnotationActionMethodEndpointMappingTest {
public MyInterceptor() {
super(new PayloadLoggingInterceptor());
}
+
}
private static class MySmartInterceptor extends DelegatingSmartEndpointInterceptor {
@@ -127,5 +130,7 @@ public class AnnotationActionMethodEndpointMappingTest {
public boolean shouldIntercept(MessageContext messageContext, Object endpoint) {
return false;
}
+
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMappingTest.java
index 906541b0..f717df21 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/addressing/server/SimpleActionEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,13 @@
package org.springframework.ws.soap.addressing.server;
-import static org.assertj.core.api.Assertions.*;
-
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
@@ -34,6 +33,8 @@ import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SimpleActionEndpointMappingTest extends AbstractWsAddressingTestCase {
private SimpleActionEndpointMapping mapping;
@@ -96,4 +97,5 @@ public class SimpleActionEndpointMappingTest extends AbstractWsAddressingTestCas
private static class Endpoint2 {
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/client/core/SaajSoapActionCallbackTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/client/core/SaajSoapActionCallbackTest.java
index 33eaa7d5..12212b3c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/client/core/SaajSoapActionCallbackTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/client/core/SaajSoapActionCallbackTest.java
@@ -1,21 +1,37 @@
+/*
+ * Copyright 2005-2025 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.springframework.ws.soap.client.core;
-import static org.assertj.core.api.Assertions.*;
+import java.io.IOException;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPException;
-
-import java.io.IOException;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.support.SoapUtils;
import org.springframework.ws.transport.TransportConstants;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SaajSoapActionCallbackTest {
private SaajSoapMessageFactory saaj11Factory = new SaajSoapMessageFactory();
@@ -41,8 +57,9 @@ public class SaajSoapActionCallbackTest {
public void noSoapAction11ShouldProduceEmptySoapActionHeader() {
SaajSoapMessage message = saaj11Factory.createWebServiceMessage();
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
assertThat(soapActionHeaders).containsExactly("\"\"");
}
@@ -53,8 +70,9 @@ public class SaajSoapActionCallbackTest {
SaajSoapMessage message = saaj11Factory.createWebServiceMessage();
SoapActionCallback callback = new SoapActionCallback("testAction");
callback.doWithMessage(message);
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
assertThat(soapActionHeaders).containsExactly("\"testAction\"");
}
@@ -65,8 +83,9 @@ public class SaajSoapActionCallbackTest {
SaajSoapMessage message = saaj11Factory.createWebServiceMessage();
SoapActionCallback callback = new SoapActionCallback(null);
callback.doWithMessage(message);
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
assertThat(soapActionHeaders).containsExactly("\"\"");
}
@@ -75,8 +94,9 @@ public class SaajSoapActionCallbackTest {
public void noSoapAction12() {
SaajSoapMessage message = saaj12Factory.createWebServiceMessage();
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
assertThat(soapActionHeaders).isNull();
}
@@ -87,9 +107,12 @@ public class SaajSoapActionCallbackTest {
SaajSoapMessage message = saaj12Factory.createWebServiceMessage();
SoapActionCallback callback = new SoapActionCallback("testAction");
callback.doWithMessage(message);
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
- String[] contentTypes = message.getSaajMessage().getMimeHeaders().getHeader(TransportConstants.HEADER_CONTENT_TYPE);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] contentTypes = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_CONTENT_TYPE);
assertThat(soapActionHeaders).isNull();
assertThat(SoapUtils.extractActionFromContentType(contentTypes[0])).isEqualTo("\"testAction\"");
@@ -101,11 +124,15 @@ public class SaajSoapActionCallbackTest {
SaajSoapMessage message = saaj12Factory.createWebServiceMessage();
SoapActionCallback callback = new SoapActionCallback(null);
callback.doWithMessage(message);
- String[] soapActionHeaders = message.getSaajMessage().getMimeHeaders()
- .getHeader(TransportConstants.HEADER_SOAP_ACTION);
- String[] contentTypes = message.getSaajMessage().getMimeHeaders().getHeader(TransportConstants.HEADER_CONTENT_TYPE);
+ String[] soapActionHeaders = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_SOAP_ACTION);
+ String[] contentTypes = message.getSaajMessage()
+ .getMimeHeaders()
+ .getHeader(TransportConstants.HEADER_CONTENT_TYPE);
assertThat(soapActionHeaders).isNull();
assertThat(SoapUtils.extractActionFromContentType(contentTypes[0])).isEqualTo("\"\"");
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11BodyTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11BodyTest.java
index 26318865..1a080f18 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11BodyTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11BodyTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,19 @@
package org.springframework.ws.soap.saaj;
-import static org.assertj.core.api.Assertions.*;
+import java.util.Locale;
import jakarta.xml.soap.MessageFactory;
import jakarta.xml.soap.SOAPBody;
import jakarta.xml.soap.SOAPConstants;
import jakarta.xml.soap.SOAPMessage;
-
-import java.util.Locale;
-
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.soap11.AbstractSoap11BodyTestCase;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SaajSoap11BodyTest extends AbstractSoap11BodyTestCase {
@Override
@@ -60,4 +60,5 @@ public class SaajSoap11BodyTest extends AbstractSoap11BodyTestCase {
assertThat(saajSoapBody.getFault().getFaultStringLocale()).isNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11EnvelopeTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11EnvelopeTest.java
index 4e8c0184..b2a08101 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11EnvelopeTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11EnvelopeTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@ public class SaajSoap11EnvelopeTest extends AbstractSoap11EnvelopeTestCase {
return new SaajSoapEnvelope(saajMessage.getSOAPPart().getEnvelope(), true);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11HeaderTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11HeaderTest.java
index ab4062e0..62ee5f06 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11HeaderTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11HeaderTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,4 +33,5 @@ public class SaajSoap11HeaderTest extends AbstractSoap11HeaderTestCase {
return new SaajSoap11Header(saajMessage.getSOAPPart().getEnvelope().getHeader());
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageFactoryTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageFactoryTest.java
index 45ae6c3c..3b946057 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageFactoryTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/saaj/SaajSoap11MessageFactoryTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,23 +16,23 @@
package org.springframework.ws.soap.saaj;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPConstants;
-import jakarta.xml.soap.SOAPMessage;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Map;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPConstants;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.soap11.AbstractSoap11MessageFactoryTestCase;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SaajSoap11MessageFactoryTest extends AbstractSoap11MessageFactoryTestCase {
@Override
@@ -54,4 +54,5 @@ public class SaajSoap11MessageFactoryTest extends AbstractSoap11MessageFactoryTe
assertThat(result).startsWith(" iterator = responseHeader.examineAllHeaderElements();
@@ -183,7 +188,8 @@ public class SoapMessageDispatcherTest {
SoapHeaderElement headerElement = iterator.next();
- assertThat(headerElement.getName()).isEqualTo(new QName(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE, "NotUnderstood"));
+ assertThat(headerElement.getName())
+ .isEqualTo(new QName(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE, "NotUnderstood"));
verify(interceptorMock);
}
@@ -194,7 +200,7 @@ public class SoapMessageDispatcherTest {
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
SOAPMessage request = messageFactory.createMessage();
SOAPHeaderElement header = request.getSOAPHeader()
- .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
+ .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
String headerActor = "http://www/springframework.org/role";
header.setActor(headerActor);
header.setMustUnderstand(true);
@@ -220,7 +226,7 @@ public class SoapMessageDispatcherTest {
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPMessage request = messageFactory.createMessage();
SOAPHeaderElement header = request.getSOAPHeader()
- .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
+ .addHeaderElement(new QName("http://www.springframework.org", "Header", "spring-ws"));
String headerRole = "http://www/springframework.org/role";
header.setRole(headerRole);
header.setMustUnderstand(true);
@@ -266,7 +272,7 @@ public class SoapMessageDispatcherTest {
MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
SOAPMessage request = messageFactory.createMessage();
SOAPHeaderElement header = request.getSOAPHeader()
- .addHeaderElement(new QName("http://www.springframework.org", "Header"));
+ .addHeaderElement(new QName("http://www.springframework.org", "Header"));
header.setActor(SOAPConstants.URI_SOAP_ACTOR_NEXT);
header.setMustUnderstand(true);
SoapMessageFactory factory = new SaajSoapMessageFactory(messageFactory);
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java
index 7aca8fd0..c7e51d34 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/FaultCreatingValidatingMarshallingPayloadEndpointTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,6 @@
package org.springframework.ws.soap.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.Detail;
-import jakarta.xml.soap.DetailEntry;
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPFault;
-import jakarta.xml.soap.SOAPMessage;
-
import java.io.IOException;
import java.util.Iterator;
@@ -31,8 +23,14 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
+import jakarta.xml.soap.Detail;
+import jakarta.xml.soap.DetailEntry;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPFault;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
@@ -45,6 +43,9 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
+
public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
private MessageContext messageContext;
@@ -91,7 +92,8 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
SOAPFault fault = response.getSOAPBody().getFault();
- assertThat(fault.getFaultCodeAsQName()).isEqualTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client"));
+ assertThat(fault.getFaultCodeAsQName())
+ .isEqualTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client"));
assertThat(fault.getFaultString()).isEqualTo(endpoint.getFaultStringOrReason());
Detail detail = fault.getDetail();
@@ -105,14 +107,14 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
DetailEntry detailEntry = (DetailEntry) iterator.next();
assertThat(detailEntry.getElementQName())
- .isEqualTo(new QName("http://springframework.org/spring-ws", "ValidationError"));
+ .isEqualTo(new QName("http://springframework.org/spring-ws", "ValidationError"));
assertThat(detailEntry.getTextContent()).isEqualTo("Name is required");
assertThat(iterator.hasNext()).isTrue();
detailEntry = (DetailEntry) iterator.next();
assertThat(detailEntry.getElementQName())
- .isEqualTo(new QName("http://springframework.org/spring-ws", "ValidationError"));
+ .isEqualTo(new QName("http://springframework.org/spring-ws", "ValidationError"));
assertThat(detailEntry.getTextContent()).isEqualTo("Age Cannot be negative");
assertThat(iterator.hasNext()).isFalse();
}
@@ -156,10 +158,12 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
if (p.getAge() < 0) {
e.rejectValue("age", "age.negativevalue");
- } else if (p.getAge() > 110) {
+ }
+ else if (p.getAge() > 110) {
e.rejectValue("age", "too.darn.old");
}
}
+
}
private static class Person {
@@ -193,6 +197,7 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
public String toString() {
return "Person{" + name + "," + age + "}";
}
+
}
private static class PersonMarshaller implements Unmarshaller, Marshaller {
@@ -214,7 +219,9 @@ public class FaultCreatingValidatingMarshallingPayloadEndpointTest {
}
@Override
- public void marshal(Object graph, Result result) throws XmlMappingException, IOException {}
+ public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
+ }
+
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SimpleSoapExceptionResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SimpleSoapExceptionResolverTest.java
index 7cffdc34..af6406eb 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SimpleSoapExceptionResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SimpleSoapExceptionResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,11 @@
package org.springframework.ws.soap.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.util.Locale;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -30,6 +28,12 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.soap11.Soap11Body;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class SimpleSoapExceptionResolverTest {
private SimpleSoapExceptionResolver exceptionResolver;
@@ -68,4 +72,5 @@ public class SimpleSoapExceptionResolverTest {
verify(factoryMock, messageMock, bodyMock);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java
index 3d19cfbe..9323af10 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultAnnotationExceptionResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,16 @@
package org.springframework.ws.soap.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPConstants;
-import jakarta.xml.soap.SOAPMessage;
-
import java.util.Locale;
import javax.xml.namespace.QName;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPConstants;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapMessage;
@@ -40,6 +38,8 @@ import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
import org.springframework.ws.soap.soap11.Soap11Fault;
import org.springframework.ws.soap.soap12.Soap12Fault;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SoapFaultAnnotationExceptionResolverTest {
private SoapFaultAnnotationExceptionResolver resolver;
@@ -256,6 +256,7 @@ public class SoapFaultAnnotationExceptionResolverTest {
public NoStringOrReasonException(String message) {
super(message);
}
+
}
@SoapFault(faultCode = FaultCode.SENDER, faultStringOrReason = "Sender error")
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultDefinitionEditorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultDefinitionEditorTest.java
index 490c7173..cb258810 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultDefinitionEditorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultDefinitionEditorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Locale;
import javax.xml.namespace.QName;
@@ -25,6 +23,8 @@ import javax.xml.namespace.QName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SoapFaultDefinitionEditorTest {
private SoapFaultDefinitionEditor editor;
@@ -92,4 +92,5 @@ public class SoapFaultDefinitionEditorTest {
assertThat(editor.getValue()).isNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultMappingExceptionResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultMappingExceptionResolverTest.java
index 7d8d19a8..56a0bcf5 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultMappingExceptionResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/SoapFaultMappingExceptionResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,18 +16,16 @@
package org.springframework.ws.soap.server.endpoint;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPConstants;
-import jakarta.xml.soap.SOAPMessage;
-
import java.io.IOException;
import java.util.Locale;
import java.util.Properties;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPConstants;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapMessage;
@@ -39,6 +37,8 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.soap11.Soap11Fault;
import org.springframework.ws.soap.soap12.Soap12Fault;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SoapFaultMappingExceptionResolverTest {
private SoapFaultMappingExceptionResolver resolver;
@@ -245,4 +245,5 @@ public class SoapFaultMappingExceptionResolverTest {
assertThat(fault.getFaultStringOrReason()).isEqualTo("java.io.IOException");
assertThat(fault.getFaultDetail()).isNull();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolverTest.java
index c2686d84..221d1739 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapHeaderElementMethodArgumentResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,13 @@
package org.springframework.ws.soap.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.List;
import javax.xml.namespace.QName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.adapter.method.AbstractMethodArgumentResolverTestCase;
@@ -31,6 +30,9 @@ import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.server.endpoint.annotation.SoapHeader;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+
/**
* @author Tareq Abedrabbo
*/
@@ -66,10 +68,12 @@ public class SoapHeaderElementMethodArgumentResolverTest extends AbstractMethodA
}
soapHeaderWithEmptyValue = new MethodParameter(
getClass().getMethod("soapHeaderWithEmptyValue", SoapHeaderElement.class), 0);
- soapHeaderElementParameter = new MethodParameter(getClass().getMethod("soapHeaderElement", SoapHeaderElement.class),
+ soapHeaderElementParameter = new MethodParameter(
+ getClass().getMethod("soapHeaderElement", SoapHeaderElement.class), 0);
+ soapHeaderElementListParameter = new MethodParameter(getClass().getMethod("soapHeaderElementList", List.class),
+ 0);
+ soapHeaderMismatch = new MethodParameter(getClass().getMethod("soapHeaderMismatch", SoapHeaderElement.class),
0);
- soapHeaderElementListParameter = new MethodParameter(getClass().getMethod("soapHeaderElementList", List.class), 0);
- soapHeaderMismatch = new MethodParameter(getClass().getMethod("soapHeaderMismatch", SoapHeaderElement.class), 0);
soapHeaderMismatchList = new MethodParameter(getClass().getMethod("soapHeaderMismatchList", List.class), 0);
}
@@ -84,7 +88,7 @@ public class SoapHeaderElementMethodArgumentResolverTest extends AbstractMethodA
public void failOnEmptyValue() {
assertThatIllegalArgumentException()
- .isThrownBy(() -> resolver.resolveArgument(messageContext, soapHeaderWithEmptyValue));
+ .isThrownBy(() -> resolver.resolveArgument(messageContext, soapHeaderWithEmptyValue));
}
@Test
@@ -138,16 +142,21 @@ public class SoapHeaderElementMethodArgumentResolverTest extends AbstractMethodA
assertThat((List>) result).isEmpty();
}
- public void soapHeaderWithEmptyValue(@SoapHeader("") SoapHeaderElement element) {}
+ public void soapHeaderWithEmptyValue(@SoapHeader("") SoapHeaderElement element) {
+ }
- public void soapHeaderElement(@SoapHeader("{http://springframework.org/ws}header") SoapHeaderElement element) {}
+ public void soapHeaderElement(@SoapHeader("{http://springframework.org/ws}header") SoapHeaderElement element) {
+ }
public void soapHeaderElementList(
- @SoapHeader("{http://springframework.org/ws}header") List elements) {}
+ @SoapHeader("{http://springframework.org/ws}header") List elements) {
+ }
- public void soapHeaderMismatch(@SoapHeader("{http://springframework.org/ws}xxx") SoapHeaderElement element) {}
+ public void soapHeaderMismatch(@SoapHeader("{http://springframework.org/ws}xxx") SoapHeaderElement element) {
+ }
public void soapHeaderMismatchList(
- @SoapHeader("{http://springframework.org/ws}xxx") List elements) {}
+ @SoapHeader("{http://springframework.org/ws}xxx") List elements) {
+ }
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolverTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolverTest.java
index 604e0e8d..be1d8c64 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolverTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/adapter/method/SoapMethodArgumentResolverTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,9 @@
package org.springframework.ws.soap.server.endpoint.adapter.method;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.core.MethodParameter;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.adapter.method.AbstractMethodArgumentResolverTestCase;
@@ -28,7 +27,11 @@ import org.springframework.ws.soap.SoapEnvelope;
import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.soap.SoapMessage;
-/** @author Arjen Poutsma */
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Arjen Poutsma
+ */
public class SoapMethodArgumentResolverTest extends AbstractMethodArgumentResolverTestCase {
private SoapMethodArgumentResolver resolver;
@@ -100,9 +103,13 @@ public class SoapMethodArgumentResolverTest extends AbstractMethodArgumentResolv
}
- public void soapEnvelope(SoapEnvelope soapEnvelope) {}
+ public void soapEnvelope(SoapEnvelope soapEnvelope) {
+ }
- public void soapBody(SoapBody soapBody) {}
+ public void soapBody(SoapBody soapBody) {
+ }
+
+ public void soapHeader(SoapHeader soapHeader) {
+ }
- public void soapHeader(SoapHeader soapHeader) {}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptorTest.java
index 72f35604..df633e51 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadRootSmartSoapEndpointInterceptorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,9 @@
package org.springframework.ws.soap.server.endpoint.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -27,6 +26,9 @@ import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+
public class PayloadRootSmartSoapEndpointInterceptorTest {
private EndpointInterceptor delegate;
@@ -45,7 +47,8 @@ public class PayloadRootSmartSoapEndpointInterceptorTest {
namespaceUri = "http://springframework.org/spring-ws";
localPart = "element";
- MockWebServiceMessage request = new MockWebServiceMessage("<" + localPart + " xmlns=\"" + namespaceUri + "\" />");
+ MockWebServiceMessage request = new MockWebServiceMessage(
+ "<" + localPart + " xmlns=\"" + namespaceUri + "\" />");
messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
}
@@ -53,7 +56,7 @@ public class PayloadRootSmartSoapEndpointInterceptorTest {
public void neitherNamespaceNorLocalPart() {
assertThatIllegalArgumentException()
- .isThrownBy(() -> new PayloadRootSmartSoapEndpointInterceptor(delegate, null, null));
+ .isThrownBy(() -> new PayloadRootSmartSoapEndpointInterceptor(delegate, null, null));
}
@Test
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
index 28fe58f6..e4bf27f9 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/PayloadValidatingInterceptorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,12 +16,6 @@
package org.springframework.ws.soap.server.endpoint.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
-import jakarta.xml.soap.MessageFactory;
-import jakarta.xml.soap.SOAPConstants;
-import jakarta.xml.soap.SOAPMessage;
-
import java.io.InputStream;
import java.util.Locale;
@@ -29,8 +23,14 @@ import javax.xml.XMLConstants;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
+import jakarta.xml.soap.MessageFactory;
+import jakarta.xml.soap.SOAPConstants;
+import jakarta.xml.soap.SOAPMessage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
import org.springframework.core.io.ClassPathResource;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.MockWebServiceMessageFactory;
@@ -46,8 +46,9 @@ import org.springframework.ws.soap.soap12.Soap12Fault;
import org.springframework.xml.transform.TransformerFactoryUtils;
import org.springframework.xml.validation.ValidationErrorHandler;
import org.springframework.xml.xsd.SimpleXsdSchema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
public class PayloadValidatingInterceptorTest {
@@ -109,7 +110,8 @@ public class PayloadValidatingInterceptorTest {
Soap11Fault fault = (Soap11Fault) response.getSoapBody().getFault();
assertThat(fault.getFaultCode()).isEqualTo(SoapVersion.SOAP_11.getClientOrSenderFaultName());
- assertThat(fault.getFaultStringOrReason()).isEqualTo(PayloadValidatingInterceptor.DEFAULT_FAULTSTRING_OR_REASON);
+ assertThat(fault.getFaultStringOrReason())
+ .isEqualTo(PayloadValidatingInterceptor.DEFAULT_FAULTSTRING_OR_REASON);
assertThat(fault.getFaultDetail()).isNotNull();
}
@@ -134,7 +136,7 @@ public class PayloadValidatingInterceptorTest {
assertThat(fault.getFaultCode()).isEqualTo(SoapVersion.SOAP_12.getClientOrSenderFaultName());
assertThat(fault.getFaultReasonText(Locale.ENGLISH))
- .isEqualTo(PayloadValidatingInterceptor.DEFAULT_FAULTSTRING_OR_REASON);
+ .isEqualTo(PayloadValidatingInterceptor.DEFAULT_FAULTSTRING_OR_REASON);
assertThat(fault.getFaultDetail()).isNotNull();
}
@@ -218,10 +220,11 @@ public class PayloadValidatingInterceptorTest {
@Test
public void testNamespacesInType() throws Exception {
- // Make sure we use Xerces for this testcase: the JAXP implementation used internally by JDK 1.5 has a bug
+ // Make sure we use Xerces for this testcase: the JAXP implementation used
+ // internally by JDK 1.5 has a bug
// See http://opensource.atlassian.com/projects/spring/browse/SWS-35
String previousSchemaFactory = System
- .getProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI, "");
+ .getProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI, "");
System.setProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI,
"org.apache.xerces.jaxp.validation.XMLSchemaFactory");
try {
@@ -231,13 +234,15 @@ public class PayloadValidatingInterceptorTest {
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage saajMessage = SaajUtils.loadMessage(new ClassPathResource(VALID_SOAP_MESSAGE, getClass()),
messageFactory);
- context = new DefaultMessageContext(new SaajSoapMessage(saajMessage), new SaajSoapMessageFactory(messageFactory));
+ context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
+ new SaajSoapMessageFactory(messageFactory));
boolean result = interceptor.handleRequest(context, null);
assertThat(result).isTrue();
assertThat(context.hasResponse()).isFalse();
- } finally {
+ }
+ finally {
// Reset the property
System.setProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI,
previousSchemaFactory);
@@ -339,11 +344,14 @@ public class PayloadValidatingInterceptorTest {
return new SAXParseException[0];
}
- public void warning(SAXParseException exception) throws SAXException {}
+ public void warning(SAXParseException exception) throws SAXException {
+ }
- public void error(SAXParseException exception) throws SAXException {}
+ public void error(SAXParseException exception) throws SAXException {
+ }
- public void fatalError(SAXParseException exception) throws SAXException {}
+ public void fatalError(SAXParseException exception) throws SAXException {
+ }
};
interceptor.setErrorHandler(errorHandler);
@@ -357,4 +365,5 @@ public class PayloadValidatingInterceptorTest {
assertThat(result).isTrue();
assertThat(context.hasResponse()).isFalse();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptorTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptorTest.java
index 3304f8a1..0bff675c 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptorTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/interceptor/SoapActionSmartEndpointInterceptorTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,9 @@
package org.springframework.ws.soap.server.endpoint.interceptor;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
@@ -27,6 +26,9 @@ import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAda
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
+
public class SoapActionSmartEndpointInterceptorTest {
private EndpointInterceptor delegate;
@@ -74,4 +76,5 @@ public class SoapActionSmartEndpointInterceptorTest {
assertThat(result).isFalse();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMappingTest.java
index 7ca1c01d..922da73d 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/DelegatingSoapEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,11 +16,9 @@
package org.springframework.ws.soap.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
@@ -28,6 +26,12 @@ import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.EndpointMapping;
import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class DelegatingSoapEndpointMappingTest {
private DelegatingSoapEndpointMapping endpointMapping;
@@ -60,4 +64,5 @@ public class DelegatingSoapEndpointMappingTest {
verify(mock);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMappingTest.java
index 03cb5f66..2eb09627 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionAnnotationMethodEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,11 @@
package org.springframework.ws.soap.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-import static org.easymock.EasyMock.*;
-
import java.lang.reflect.Method;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
@@ -34,6 +32,12 @@ import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.server.endpoint.annotation.SoapAction;
import org.springframework.ws.soap.server.endpoint.annotation.SoapActions;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
public class SoapActionAnnotationMethodEndpointMappingTest {
private SoapActionAnnotationMethodEndpointMapping mapping;
@@ -133,7 +137,8 @@ public class SoapActionAnnotationMethodEndpointMappingTest {
@SoapActions({ @SoapAction("http://springframework.org/spring-ws/SoapAction1"),
@SoapAction("http://springframework.org/spring-ws/SoapAction2") })
- public void doItMultiple() {}
+ public void doItMultiple() {
+ }
@SoapAction("http://springframework.org/spring-ws/SoapAction3")
@SoapAction("http://springframework.org/spring-ws/SoapAction4")
@@ -142,4 +147,5 @@ public class SoapActionAnnotationMethodEndpointMappingTest {
}
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMappingTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMappingTest.java
index 4bc3ea8e..7c009067 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMappingTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/server/endpoint/mapping/SoapActionEndpointMappingTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,17 +16,17 @@
package org.springframework.ws.soap.server.endpoint.mapping;
-import static org.assertj.core.api.Assertions.*;
-
import jakarta.xml.soap.MessageFactory;
-
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SoapActionEndpointMappingTest {
private SoapActionEndpointMapping mapping;
@@ -62,4 +62,5 @@ public class SoapActionEndpointMappingTest {
public void testValidateLookupKey() {
assertThat(mapping.validateLookupKey("SoapAction")).isTrue();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
index e1900201..a10f935f 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11BodyTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,13 +16,13 @@
package org.springframework.ws.soap.soap11;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Locale;
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapBodyTestCase;
import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultDetail;
@@ -30,7 +30,8 @@ import org.springframework.ws.soap.SoapFaultDetailElement;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCase {
@@ -50,8 +51,10 @@ public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCas
StringResult result = new StringResult();
transformer.transform(soapBody.getSource(), result);
- XmlAssert.assertThat(result.toString()).and("")
- .ignoreWhitespace().areSimilar();
+ XmlAssert.assertThat(result.toString())
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -60,7 +63,7 @@ public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCas
SoapFault fault = soapBody.addMustUnderstandFault("SOAP Must Understand Error", null);
assertThat(fault.getFaultCode())
- .isEqualTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "MustUnderstand"));
+ .isEqualTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "MustUnderstand"));
assertPayloadEqual("" + ""
+ soapBody.getName().getPrefix() + ":MustUnderstand"
+ "SOAP Must Understand Error");
@@ -108,8 +111,8 @@ public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCas
assertThat(fault.getFaultActorOrRole()).isEqualTo(actor);
assertPayloadEqual("" + "spring:fault"
- + "" + faultString + "" + "" + actor + ""
- + "");
+ + "" + faultString + "" + "" + actor
+ + "" + "");
}
@Test
@@ -149,7 +152,8 @@ public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCas
assertPayloadEqual(
""
- + "spring:fault" + "" + faultString + "" + ""
+ + "spring:fault" + "" + faultString + ""
+ + ""
+ ""
+ ""
+ "" + "");
@@ -159,14 +163,16 @@ public abstract class AbstractSoap11BodyTestCase extends AbstractSoapBodyTestCas
@Test
public void testAddFaultWithDetailResult() throws Exception {
- SoapFault fault = ((Soap11Body) soapBody).addFault(new QName("namespace", "localPart", "prefix"), "Fault", null);
+ SoapFault fault = ((Soap11Body) soapBody).addFault(new QName("namespace", "localPart", "prefix"), "Fault",
+ null);
SoapFaultDetail detail = fault.addFaultDetail();
transformer.transform(new StringSource(""), detail.getResult());
transformer.transform(new StringSource(""), detail.getResult());
assertPayloadEqual(""
- + "prefix:localPart" + "Fault"
- + "" + "" + ""
- + "");
+ + "prefix:localPart"
+ + "Fault" + "" + ""
+ + "" + "");
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11EnvelopeTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11EnvelopeTestCase.java
index df85945a..8ef520d9 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11EnvelopeTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11EnvelopeTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,21 +16,23 @@
package org.springframework.ws.soap.soap11;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapEnvelopeTestCase;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap11EnvelopeTestCase extends AbstractSoapEnvelopeTestCase {
@Test
public void testGetName() {
- assertThat(soapEnvelope.getName()).isEqualTo(new QName(SoapVersion.SOAP_11.getEnvelopeNamespaceUri(), "Envelope"));
+ assertThat(soapEnvelope.getName())
+ .isEqualTo(new QName(SoapVersion.SOAP_11.getEnvelopeNamespaceUri(), "Envelope"));
}
@Test
@@ -40,8 +42,9 @@ public abstract class AbstractSoap11EnvelopeTestCase extends AbstractSoapEnvelop
transformer.transform(soapEnvelope.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("")
- .ignoreWhitespace().areSimilar();
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java
index 98bcdf83..79c6f799 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11HeaderTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,20 @@
package org.springframework.ws.soap.soap11;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Iterator;
import javax.xml.namespace.QName;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapHeaderTestCase;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTestCase {
@@ -51,8 +52,9 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes
transformer.transform(soapHeader.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("").ignoreWhitespace()
- .areSimilar();
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -68,7 +70,7 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes
headerElement = soapHeader.addHeaderElement(qName);
headerElement.setActorOrRole(SoapVersion.SOAP_11.getNextActorOrRoleUri());
Iterator iterator = ((Soap11Header) soapHeader)
- .examineHeaderElementsToProcess(new String[] { "role1" });
+ .examineHeaderElementsToProcess(new String[] { "role1" });
assertThat(iterator).isNotNull();
assertThat(iterator.hasNext()).isTrue();
@@ -94,7 +96,8 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes
qName = new QName(NAMESPACE, "localName3", PREFIX);
headerElement = soapHeader.addHeaderElement(qName);
headerElement.setActorOrRole(SoapVersion.SOAP_11.getNextActorOrRoleUri());
- Iterator iterator = ((Soap11Header) soapHeader).examineHeaderElementsToProcess(new String[0]);
+ Iterator iterator = ((Soap11Header) soapHeader)
+ .examineHeaderElementsToProcess(new String[0]);
assertThat(iterator).isNotNull();
assertThat(iterator.hasNext()).isTrue();
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java
index 1ee8aa30..c81b18fd 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageFactoryTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap.soap11;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.InputStream;
import java.util.Collections;
import java.util.HashMap;
@@ -25,6 +23,7 @@ import java.util.Iterator;
import java.util.Map;
import org.junit.jupiter.api.Test;
+
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.mime.Attachment;
import org.springframework.ws.soap.AbstractSoapMessageFactoryTestCase;
@@ -33,6 +32,8 @@ import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.transport.MockTransportInputStream;
import org.springframework.ws.transport.TransportInputStream;
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractSoap11MessageFactoryTestCase extends AbstractSoapMessageFactoryTestCase {
@Test
@@ -214,4 +215,5 @@ public abstract class AbstractSoap11MessageFactoryTestCase extends AbstractSoapM
assertThat(soapMessage.getVersion()).isEqualTo(SoapVersion.SOAP_11);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java
index 00d98105..6fe370e7 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap11/AbstractSoap11MessageTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap.soap11;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
@@ -27,6 +25,10 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamSource;
@@ -37,9 +39,8 @@ import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.transport.MockTransportOutputStream;
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.StringSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageTestCase {
@@ -68,10 +69,11 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
- + getHeader() + "<" + getNS() + ":Body>" + getNS()
- + ":Body>" + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
String contentType = tos.getHeaders().get("Content-Type");
@@ -144,10 +146,11 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
- + getHeader() + "<" + getNS() + ":Body>" + getNS()
- + ":Body>" + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
}
@Override
@@ -173,10 +176,11 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
- + getHeader() + "<" + getNS() + ":Body>" + getNS()
- + ":Body>" + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12BodyTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12BodyTestCase.java
index 2c01676d..1f6163fb 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12BodyTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12BodyTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,14 +16,14 @@
package org.springframework.ws.soap.soap12;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Iterator;
import java.util.Locale;
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapBodyTestCase;
import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultDetail;
@@ -31,7 +31,8 @@ import org.springframework.ws.soap.SoapFaultDetailElement;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCase {
@@ -51,8 +52,10 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
StringResult result = new StringResult();
transformer.transform(soapBody.getSource(), result);
- XmlAssert.assertThat(result.toString()).and("")
- .ignoreWhitespace().areSimilar();
+ XmlAssert.assertThat(result.toString())
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -60,17 +63,20 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
SoapFault fault = soapBody.addMustUnderstandFault("SOAP Must Understand Error", Locale.ENGLISH);
- assertThat(fault.getFaultCode()).isEqualTo(new QName("http://www.w3.org/2003/05/soap-envelope", "MustUnderstand"));
+ assertThat(fault.getFaultCode())
+ .isEqualTo(new QName("http://www.w3.org/2003/05/soap-envelope", "MustUnderstand"));
StringResult result = new StringResult();
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":MustUnderstand"
- + "SOAP Must Understand Error"
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix()
+ + ":MustUnderstand"
+ + "SOAP Must Understand Error"
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -84,11 +90,13 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":Sender"
- + "faultString"
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix()
+ + ":Sender"
+ + "faultString"
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -102,11 +110,13 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":Receiver"
- + "faultString"
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix()
+ + ":Receiver"
+ + "faultString"
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -114,19 +124,22 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
SoapFault fault = soapBody.addServerOrReceiverFault("faultString", Locale.ENGLISH);
SoapFaultDetail detail = fault.addFaultDetail();
- SoapFaultDetailElement detailElement = detail.addFaultDetailElement(new QName("namespace", "localPart", "prefix"));
+ SoapFaultDetailElement detailElement = detail
+ .addFaultDetailElement(new QName("namespace", "localPart", "prefix"));
StringSource detailContents = new StringSource("");
transformer.transform(detailContents, detailElement.getResult());
StringResult result = new StringResult();
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":Receiver" + ""
- + "faultString"
- + ""
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix() + ":Receiver"
+ + ""
+ + "faultString"
+ + ""
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -140,12 +153,14 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":Receiver" + ""
- + "faultString"
- + "" + "" + ""
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix() + ":Receiver"
+ + ""
+ + "faultString"
+ + "" + "" + ""
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -168,14 +183,15 @@ public abstract class AbstractSoap12BodyTestCase extends AbstractSoapBodyTestCas
transformer.transform(fault.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + ""
- + soapBody.getName().getPrefix() + ":Receiver"
- + "spring-ws:Subcode1"
- + "spring-ws:Subcode2"
- + ""
- + "faultString"
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + "" + soapBody.getName().getPrefix() + ":Receiver"
+ + "spring-ws:Subcode1"
+ + "spring-ws:Subcode2"
+ + ""
+ + "faultString"
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12EnvelopeTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12EnvelopeTestCase.java
index 910d03bd..fdb33421 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12EnvelopeTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12EnvelopeTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,21 +16,23 @@
package org.springframework.ws.soap.soap12;
-import static org.assertj.core.api.Assertions.*;
-
import javax.xml.namespace.QName;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapEnvelopeTestCase;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap12EnvelopeTestCase extends AbstractSoapEnvelopeTestCase {
@Test
public void testGetName() {
- assertThat(soapEnvelope.getName()).isEqualTo(new QName(SoapVersion.SOAP_12.getEnvelopeNamespaceUri(), "Envelope"));
+ assertThat(soapEnvelope.getName())
+ .isEqualTo(new QName(SoapVersion.SOAP_12.getEnvelopeNamespaceUri(), "Envelope"));
}
@Test
@@ -40,8 +42,9 @@ public abstract class AbstractSoap12EnvelopeTestCase extends AbstractSoapEnvelop
transformer.transform(soapEnvelope.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and("" + "")
- .ignoreWhitespace().areSimilar();
+ .and("" + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java
index ef614964..980c742a 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12HeaderTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,19 +16,20 @@
package org.springframework.ws.soap.soap12;
-import static org.assertj.core.api.Assertions.*;
-
import java.util.Iterator;
import javax.xml.namespace.QName;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.ws.soap.AbstractSoapHeaderTestCase;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.xml.transform.StringResult;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTestCase {
@@ -48,8 +49,10 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
StringResult result = new StringResult();
transformer.transform(soapHeader.getSource(), result);
- XmlAssert.assertThat(result.toString()).and("")
- .ignoreWhitespace().areSimilar();
+ XmlAssert.assertThat(result.toString())
+ .and("")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -62,10 +65,11 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
transformer.transform(soapHeader.getSource(), result);
XmlAssert.assertThat(result.toString())
- .and(""
- + ""
- + "")
- .ignoreWhitespace().areSimilar();
+ .and(""
+ + ""
+ + "")
+ .ignoreWhitespace()
+ .areSimilar();
}
@Test
@@ -81,13 +85,13 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
assertThat(header.getName()).isEqualTo(new QName("http://www.w3.org/2003/05/soap-envelope", "Upgrade"));
// XMLUnit can't test this:
/*
- assertXMLEqual("Invalid contents of header", "" +
- "" +
- "" +
- "" +
- "" +
- "", result.toString());
- */
+ * assertXMLEqual("Invalid contents of header",
+ * "" + "" +
+ * ""
+ * +
+ * ""
+ * + "" + "", result.toString());
+ */
}
@Test
@@ -103,7 +107,7 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
headerElement = soapHeader.addHeaderElement(qName);
headerElement.setActorOrRole(SoapVersion.SOAP_12.getNextActorOrRoleUri());
Iterator iterator = ((Soap12Header) soapHeader)
- .examineHeaderElementsToProcess(new String[] { "role1" }, false);
+ .examineHeaderElementsToProcess(new String[] { "role1" }, false);
assertThat(iterator).isNotNull();
assertThat(iterator.hasNext()).isTrue();
@@ -151,7 +155,7 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
SoapHeaderElement headerElement = soapHeader.addHeaderElement(qName);
headerElement.setActorOrRole(SoapVersion.SOAP_12.getUltimateReceiverRoleUri());
Iterator iterator = ((Soap12Header) soapHeader)
- .examineHeaderElementsToProcess(new String[] { "role" }, true);
+ .examineHeaderElementsToProcess(new String[] { "role" }, true);
assertThat(iterator).isNotNull();
@@ -168,4 +172,5 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
assertThat(name).is(new Condition<>(value -> new QName(NAMESPACE, "localName1", PREFIX).equals(value)
|| new QName(NAMESPACE, "localName3", PREFIX).equals(value), ""));
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageFactoryTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageFactoryTestCase.java
index 6ad602ca..ef3dbcf5 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageFactoryTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageFactoryTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap.soap12;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.InputStream;
import java.util.Collections;
import java.util.HashMap;
@@ -33,6 +31,8 @@ import org.springframework.ws.transport.MockTransportInputStream;
import org.springframework.ws.transport.TransportConstants;
import org.springframework.ws.transport.TransportInputStream;
+import static org.assertj.core.api.Assertions.assertThat;
+
public abstract class AbstractSoap12MessageFactoryTestCase extends AbstractSoapMessageFactoryTestCase {
@Override
@@ -81,8 +81,8 @@ public abstract class AbstractSoap12MessageFactoryTestCase extends AbstractSoapM
InputStream is = AbstractSoap12MessageFactoryTestCase.class.getResourceAsStream("soap12-attachment.bin");
Map headers = new HashMap();
- headers.put("Content-Type",
- "multipart/related;" + "type=\"application/soap+xml\";" + "boundary=\"----=_Part_0_11416420.1149699787554\"");
+ headers.put("Content-Type", "multipart/related;" + "type=\"application/soap+xml\";"
+ + "boundary=\"----=_Part_0_11416420.1149699787554\"");
TransportInputStream tis = new MockTransportInputStream(is, headers);
WebServiceMessage message = messageFactory.createWebServiceMessage(tis);
@@ -138,4 +138,5 @@ public abstract class AbstractSoap12MessageFactoryTestCase extends AbstractSoapM
assertThat(soapMessage.getVersion()).isEqualTo(SoapVersion.SOAP_12);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageTestCase.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageTestCase.java
index 1ea2b5de..8b204d20 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageTestCase.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/soap12/AbstractSoap12MessageTestCase.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,8 +16,6 @@
package org.springframework.ws.soap.soap12;
-import static org.assertj.core.api.Assertions.*;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
@@ -27,6 +25,10 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xmlunit.assertj.XmlAssert;
+
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamSource;
@@ -38,9 +40,8 @@ import org.springframework.ws.transport.MockTransportOutputStream;
import org.springframework.ws.transport.TransportConstants;
import org.springframework.xml.DocumentBuilderFactoryUtils;
import org.springframework.xml.transform.StringSource;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xmlunit.assertj.XmlAssert;
+
+import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractSoap12MessageTestCase extends AbstractSoapMessageTestCase {
@@ -71,10 +72,11 @@ public abstract class AbstractSoap12MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>" + getHeader()
- + "<" + getNS() + ":Body>" + getNS() + ":Body>"
- + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
String contentType = tos.getHeaders().get(TransportConstants.HEADER_CONTENT_TYPE);
@@ -145,10 +147,11 @@ public abstract class AbstractSoap12MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>" + getHeader()
- + "<" + getNS() + ":Body>" + getNS() + ":Body>"
- + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
}
@Override
@@ -174,9 +177,11 @@ public abstract class AbstractSoap12MessageTestCase extends AbstractSoapMessageT
String result = bos.toString(StandardCharsets.UTF_8);
XmlAssert.assertThat(result)
- .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>" + getHeader()
- + "<" + getNS() + ":Body>" + getNS() + ":Body>"
- + getNS() + ":Envelope>")
- .ignoreWhitespace().areIdentical();
+ .and("<" + getNS() + ":Envelope xmlns:" + getNS() + "='http://www.w3.org/2003/05/soap-envelope'>"
+ + getHeader() + "<" + getNS() + ":Body>"
+ + getNS() + ":Body>" + getNS() + ":Envelope>")
+ .ignoreWhitespace()
+ .areIdentical();
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/soap/support/SoapUtilsTest.java b/spring-ws-core/src/test/java/org/springframework/ws/soap/support/SoapUtilsTest.java
index 2da60152..ae37c479 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/soap/support/SoapUtilsTest.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/soap/support/SoapUtilsTest.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,10 @@
package org.springframework.ws.soap.support;
-import static org.assertj.core.api.Assertions.*;
-
import org.junit.jupiter.api.Test;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class SoapUtilsTest {
@Test
@@ -85,4 +85,5 @@ public class SoapUtilsTest {
assertThat(SoapUtils.extractActionFromContentType(result)).isEqualTo(anotherSoapAction);
}
+
}
diff --git a/spring-ws-core/src/test/java/org/springframework/ws/support/ChangelogCreator.java b/spring-ws-core/src/test/java/org/springframework/ws/support/ChangelogCreator.java
index a160bd4f..ce26e237 100644
--- a/spring-ws-core/src/test/java/org/springframework/ws/support/ChangelogCreator.java
+++ b/spring-ws-core/src/test/java/org/springframework/ws/support/ChangelogCreator.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2005-2022 the original author or authors.
+ * Copyright 2005-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,21 +15,20 @@
*/
package org.springframework.ws.support;
-import net.minidev.json.JSONArray;
-
import java.time.Duration;
import java.time.LocalDate;
import java.util.Iterator;
import java.util.List;
+import com.jayway.jsonpath.JsonPath;
+import net.minidev.json.JSONArray;
+
import org.springframework.hateoas.IanaLinkRelations;
import org.springframework.hateoas.Links;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.client.WebClient;
-import com.jayway.jsonpath.JsonPath;
-
/**
* Little helper to build a changelog from the tickets of a particular milestone.
*
@@ -39,23 +38,27 @@ import com.jayway.jsonpath.JsonPath;
class ChangelogCreator {
private static final int MILESTONE_ID = 91;
+
private static final String URI_TEMPLATE = "https://api.github.com/repos/spring-projects/spring-ws/issues?milestone={id}&state=closed";
public static void main(String... args) {
/*
- * If you run into github rate limiting issues, you can always use a Github Personal Token by adding
- * {@code .header(HttpHeaders.AUTHORIZATION, "token your-github-token")} to the webClient call.
+ * If you run into github rate limiting issues, you can always use a Github
+ * Personal Token by adding {@code .header(HttpHeaders.AUTHORIZATION,
+ * "token your-github-token")} to the webClient call.
*/
WebClient webClient = WebClient.create();
try {
HttpEntity response = webClient //
- .get().uri(URI_TEMPLATE, MILESTONE_ID) //
- // .header(HttpHeaders.AUTHORIZATION, "token ") //
- .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) //
- .block(Duration.ofSeconds(10));
+ .get()
+ .uri(URI_TEMPLATE, MILESTONE_ID) //
+ // .header(HttpHeaders.AUTHORIZATION, "token ") //
+ .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) //
+ .block(Duration.ofSeconds(10));
boolean keepChecking = true;
boolean printHeader = true;
@@ -71,15 +74,18 @@ class ChangelogCreator {
if (links.getLink(IanaLinkRelations.NEXT).isPresent()) {
response = webClient //
- .get().uri(links.getRequiredLink(IanaLinkRelations.NEXT).expand().getHref()) //
- .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) //
- .block(Duration.ofSeconds(10));
+ .get()
+ .uri(links.getRequiredLink(IanaLinkRelations.NEXT).expand().getHref()) //
+ .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) //
+ .block(Duration.ofSeconds(10));
- } else {
+ }
+ else {
keepChecking = false;
}
}
- } catch (Exception e) {
+ }
+ catch (Exception e) {
System.out.println("Couldn't retrieve MILESTONE " + MILESTONE_ID);
}
}
@@ -93,8 +99,8 @@ class ChangelogCreator {
Iterator