Bumped up compile warnings

Bumped up the compiler warning to errors.
This commit is contained in:
Arjen Poutsma
2014-04-24 14:13:23 +02:00
parent ded1efd456
commit 12a10a34f1
125 changed files with 444 additions and 354 deletions

View File

@@ -19,27 +19,21 @@ configure(allprojects) {
apply plugin: "propdeps-idea"
apply plugin: "propdeps"
/* [compileJava, compileTestJava]*.options*.compilerArgs = [
"-Xlint:serial",
"-Xlint:varargs",
"-Xlint:cast",
"-Xlint:classfile",
"-Xlint:dep-ann",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:static",
"-Xlint:try",
"-Xlint:-options", // intentionally disabled
"-Xlint:-fallthrough", // intentionally disabled
"-Xlint:-rawtypes", // TODO enable and fix warnings
"-Xlint:-deprecation", // TODO enable and fix warnings
"-Xlint:-unchecked" // TODO enable and fix warnings
compileJava.options*.compilerArgs = [
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
"-Xlint:try", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
"-Xlint:unchecked", "-Xlint:-options", "-Werror"
]
*/
compileTestJava.options*.compilerArgs = [
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
"-Xlint:overrides", "-Xlint:path", "-Xlint:processing", "-Xlint:static",
"-Xlint:try", "-Xlint:-fallthrough", "-Xlint:-rawtypes", "-Xlint:-deprecation",
"-Xlint:-unchecked", "-Xlint:-options"]
compileJava {
sourceCompatibility=1.6
targetCompatibility=1.6

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2012 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -23,6 +23,7 @@ package org.springframework.ws;
* @author Arjen Poutsma
* @since 2.0.4
*/
@SuppressWarnings("serial")
public final class InvalidXmlException extends WebServiceException {
public InvalidXmlException(String msg, Throwable ex) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public final class NoEndpointFoundException extends WebServiceException {
public NoEndpointFoundException(WebServiceMessage request) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WebServiceException extends NestedRuntimeException {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WebServiceMessageException extends WebServiceException {
/** Constructor for {@code WebServiceMessageException}. */

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WebServiceClientException extends WebServiceException {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.FaultAwareWebServiceMessage;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class WebServiceFaultException extends WebServiceClientException {
private final FaultAwareWebServiceMessage faultMessage;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import java.io.IOException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class WebServiceIOException extends WebServiceClientException {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import javax.xml.transform.TransformerException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class WebServiceTransformerException extends WebServiceClientException {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.transport.TransportException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class WebServiceTransportException extends WebServiceIOException {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.client.WebServiceClientException;
* @author Arjen Poutsma
* @since 1.5.4
*/
@SuppressWarnings("serial")
public class DestinationProvisionException extends WebServiceClientException {
public DestinationProvisionException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +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.
*
@@ -27,6 +27,7 @@ import org.xml.sax.SAXParseException;
* @author Arjen Poutsma
* @since 1.5.4
*/
@SuppressWarnings("serial")
public class WebServiceValidationException extends WebServiceClientException {
private SAXParseException[] validationErrors;

View File

@@ -28,6 +28,7 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
public class WebServicesNamespaceHandler extends NamespaceHandlerSupport {
@Override
@SuppressWarnings("deprecation")
public void init() {
registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser());
registerBeanDefinitionParser("interceptors", new InterceptorsBeanDefinitionParser());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import org.springframework.ws.WebServiceMessageException;
* @see Attachment
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AttachmentException extends WebServiceMessageException {
public AttachmentException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceMessageException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class PoxMessageException extends WebServiceMessageException {
public PoxMessageException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.pox.PoxMessageException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class DomPoxMessageException extends PoxMessageException {
public DomPoxMessageException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,9 @@ import org.springframework.ws.context.MessageContext;
*
* @author Arjen Poutsma
* @since 1.0.2
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractValidatingMarshallingPayloadEndpoint extends AbstractMarshallingPayloadEndpoint {
/** Default request object name used for validating request objects. */

View File

@@ -208,6 +208,7 @@ public abstract class AbstractXomPayloadEndpoint extends TransformerObjectSuppor
}
}
@SuppressWarnings("serial")
private static class XomParsingException extends NestedRuntimeException {
private XomParsingException(ParsingException ex) {

View File

@@ -33,6 +33,7 @@ import org.w3c.dom.NodeList;
import org.springframework.core.MethodParameter;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.ConversionServiceFactory;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.annotation.XPathParam;
import org.springframework.ws.server.endpoint.support.NamespaceUtils;
@@ -55,7 +56,7 @@ public class XPathParamMethodArgumentResolver implements MethodArgumentResolver
private TransformerHelper transformerHelper = new TransformerHelper();
private ConversionService conversionService = ConversionServiceFactory.createDefaultConversionService();
private ConversionService conversionService = new DefaultConversionService();
/**
* Sets the conversion service to use.

View File

@@ -70,7 +70,7 @@ import org.springframework.xml.transform.TraxUtils;
*/
public abstract class AbstractJaxb2PayloadMethodProcessor extends AbstractPayloadMethodProcessor {
private final ConcurrentMap<Class, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class, JAXBContext>();
private final ConcurrentMap<Class<?>, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class<?>, JAXBContext>();
@Override
public final void handleReturnValue(MessageContext messageContext,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapBodyException extends SoapMessageException {
public SoapBodyException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapElementException extends SoapMessageException {
public SoapElementException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapEnvelopeException extends SoapMessageException {
public SoapEnvelopeException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapFaultException extends SoapEnvelopeException {
public SoapFaultException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapHeaderException extends SoapMessageException {
public SoapHeaderException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ package org.springframework.ws.soap;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapMessageCreationException extends SoapMessageException {
/** Constructor for {@code SoapMessageCreationException}. */

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceMessageException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class SoapMessageException extends WebServiceMessageException {
/** Constructor for {@code SoapMessageException}. */

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException;
* @author Arjen Poutsma
* @since 1.5.0
*/
@SuppressWarnings("serial")
public class AddressingException extends WebServiceException {
public AddressingException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ import org.springframework.beans.BeansException;
public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping {
// contents will be copied over to endpointMap
private final Map<URI, Object> actionMap = new HashMap();
private final Map<URI, Object> actionMap = new HashMap<URI, Object>();
private URI address;

View File

@@ -302,7 +302,8 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
}
else if (message.getSoapBody() instanceof Soap12Body) {
Soap12Body soapBody = (Soap12Body) message.getSoapBody();
Soap12Fault soapFault = (Soap12Fault) soapBody.addClientOrSenderFault(reason, Locale.ENGLISH);
Soap12Fault soapFault =
soapBody.addClientOrSenderFault(reason, Locale.ENGLISH);
soapFault.addFaultSubcode(subcode);
return soapFault;
}
@@ -339,37 +340,37 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
/** Returns the qualified name of the {@code To} addressing header. */
protected QName getToName() {
return QNameUtils.createQName(getNamespaceUri(), "To", getNamespacePrefix());
return new QName(getNamespaceUri(), "To", getNamespacePrefix());
}
/** Returns the qualified name of the {@code From} addressing header. */
protected QName getFromName() {
return QNameUtils.createQName(getNamespaceUri(), "From", getNamespacePrefix());
return new QName(getNamespaceUri(), "From", getNamespacePrefix());
}
/** Returns the qualified name of the {@code ReplyTo} addressing header. */
protected QName getReplyToName() {
return QNameUtils.createQName(getNamespaceUri(), "ReplyTo", getNamespacePrefix());
return new QName(getNamespaceUri(), "ReplyTo", getNamespacePrefix());
}
/** Returns the qualified name of the {@code FaultTo} addressing header. */
protected QName getFaultToName() {
return QNameUtils.createQName(getNamespaceUri(), "FaultTo", getNamespacePrefix());
return new QName(getNamespaceUri(), "FaultTo", getNamespacePrefix());
}
/** Returns the qualified name of the {@code Action} addressing header. */
protected QName getActionName() {
return QNameUtils.createQName(getNamespaceUri(), "Action", getNamespacePrefix());
return new QName(getNamespaceUri(), "Action", getNamespacePrefix());
}
/** Returns the qualified name of the {@code MessageID} addressing header. */
protected QName getMessageIdName() {
return QNameUtils.createQName(getNamespaceUri(), "MessageID", getNamespacePrefix());
return new QName(getNamespaceUri(), "MessageID", getNamespacePrefix());
}
/** Returns the qualified name of the {@code RelatesTo} addressing header. */
protected QName getRelatesToName() {
return QNameUtils.createQName(getNamespaceUri(), "RelatesTo", getNamespacePrefix());
return new QName(getNamespaceUri(), "RelatesTo", getNamespacePrefix());
}
/** Returns the qualified name of the {@code RelatesTo} addressing header. */
@@ -382,7 +383,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
* {@code null} when reference properties are not supported by this version of the spec.
*/
protected QName getReferencePropertiesName() {
return QNameUtils.createQName(getNamespaceUri(), "ReferenceProperties", getNamespacePrefix());
return new QName(getNamespaceUri(), "ReferenceProperties", getNamespacePrefix());
}
/**
@@ -390,7 +391,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
* {@code null} when reference parameters are not supported by this version of the spec.
*/
protected QName getReferenceParametersName() {
return QNameUtils.createQName(getNamespaceUri(), "ReferenceParameters", getNamespacePrefix());
return new QName(getNamespaceUri(), "ReferenceParameters", getNamespacePrefix());
}
/*
@@ -399,7 +400,7 @@ public abstract class AbstractAddressingVersion extends TransformerObjectSupport
/** The qualified name of the {@code Address} in {@code EndpointReference}. */
protected QName getAddressName() {
return QNameUtils.createQName(getNamespaceUri(), "Address", getNamespacePrefix());
return new QName(getNamespaceUri(), "Address", getNamespacePrefix());
}
/** Returns the default To URI. */

View File

@@ -23,7 +23,6 @@ import org.springframework.util.Assert;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.addressing.core.EndpointReference;
import org.springframework.ws.soap.addressing.core.MessageAddressingProperties;
import org.springframework.xml.namespace.QNameUtils;
/**
* Implements WS-Addressing 1.0 (May 2006). This version of the specification is used by Microsoft's Windows
@@ -88,7 +87,8 @@ public class Addressing10 extends AbstractAddressingVersion {
@Override
protected final QName getMessageAddressingHeaderRequiredFaultSubcode() {
return QNameUtils.createQName(NAMESPACE_URI, "MessageAddressingHeaderRequired", getNamespacePrefix());
return new QName(NAMESPACE_URI, "MessageAddressingHeaderRequired",
getNamespacePrefix());
}
@Override
@@ -98,7 +98,7 @@ public class Addressing10 extends AbstractAddressingVersion {
@Override
protected QName getInvalidAddressingHeaderFaultSubcode() {
return QNameUtils.createQName(NAMESPACE_URI, "InvalidAddressingHeader", getNamespacePrefix());
return new QName(NAMESPACE_URI, "InvalidAddressingHeader", getNamespacePrefix());
}
@Override

View File

@@ -23,7 +23,6 @@ import org.springframework.util.Assert;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.addressing.core.EndpointReference;
import org.springframework.ws.soap.addressing.core.MessageAddressingProperties;
import org.springframework.xml.namespace.QNameUtils;
/**
* Implements the August 2004 edition of the WS-Addressing specification. This version of the specification is used by
@@ -71,7 +70,8 @@ public class Addressing200408 extends AbstractAddressingVersion {
@Override
protected final QName getInvalidAddressingHeaderFaultSubcode() {
return QNameUtils.createQName(NAMESPACE_URI, "InvalidMessageInformationHeader", getNamespacePrefix());
return new QName(NAMESPACE_URI, "InvalidMessageInformationHeader",
getNamespacePrefix());
}
@Override
@@ -81,7 +81,8 @@ public class Addressing200408 extends AbstractAddressingVersion {
@Override
protected final QName getMessageAddressingHeaderRequiredFaultSubcode() {
return QNameUtils.createQName(NAMESPACE_URI, "MessageInformationHeaderRequired", getNamespacePrefix());
return new QName(NAMESPACE_URI, "MessageInformationHeaderRequired",
getNamespacePrefix());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.ws.soap.axiom;
import org.springframework.ws.mime.AttachmentException;
/** @author Arjen Poutsma */
@SuppressWarnings("serial")
public class AxiomAttachmentException extends AttachmentException {
public AxiomAttachmentException(String msg) {

View File

@@ -34,7 +34,6 @@ import org.springframework.util.StringUtils;
import org.springframework.ws.soap.axiom.support.AxiomUtils;
import org.springframework.ws.soap.soap11.Soap11Body;
import org.springframework.ws.soap.soap11.Soap11Fault;
import org.springframework.xml.namespace.QNameUtils;
/**
* Axiom-specific version of {@code org.springframework.ws.soap.Soap11Body}.
@@ -108,7 +107,7 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body {
}
private void setValueText(QName code, SOAPFault fault, SOAPFaultCode faultCode) {
String prefix = QNameUtils.getPrefix(code);
String prefix = code.getPrefix();
if (StringUtils.hasLength(code.getNamespaceURI()) && StringUtils.hasLength(prefix)) {
OMNamespace namespace = fault.findNamespaceURI(prefix);
if (namespace == null) {
@@ -120,7 +119,8 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body {
if (namespace == null) {
namespace = fault.declareNamespace(code.getNamespaceURI(), "");
}
code = QNameUtils.createQName(code.getNamespaceURI(), code.getLocalPart(), namespace.getPrefix());
code = new QName(code.getNamespaceURI(), code.getLocalPart(),
namespace.getPrefix());
}
faultCode.setText(code);
}
@@ -131,8 +131,8 @@ class AxiomSoap11Body extends AxiomSoapBody implements Soap11Body {
AxiomUtils.removeContents(getAxiomBody());
SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody());
SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault);
faultCode.setText(QNameUtils.createQName(fault.getNamespace().getNamespaceURI(), localName,
fault.getNamespace().getPrefix()));
faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName,
fault.getNamespace().getPrefix()));
SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault);
if (locale != null) {
addLangAttribute(locale, faultReason);

View File

@@ -36,7 +36,6 @@ import org.apache.axiom.soap.SOAPProcessingException;
import org.springframework.util.StringUtils;
import org.springframework.ws.soap.axiom.support.AxiomUtils;
import org.springframework.ws.soap.soap12.Soap12Fault;
import org.springframework.xml.namespace.QNameUtils;
/** Axiom-specific version of {@code org.springframework.ws.soap.Soap12Fault}. */
class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault {
@@ -85,7 +84,7 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault {
}
private void setValueText(QName code, SOAPFaultValue faultValue) {
String prefix = QNameUtils.getPrefix(code);
String prefix = code.getPrefix();
if (StringUtils.hasLength(code.getNamespaceURI()) && StringUtils.hasLength(prefix)) {
OMNamespace namespace = getAxiomFault().findNamespaceURI(prefix);
if (namespace == null) {
@@ -97,7 +96,8 @@ class AxiomSoap12Fault extends AxiomSoapFault implements Soap12Fault {
if (namespace == null) {
throw new IllegalArgumentException("Could not resolve namespace of code [" + code + "]");
}
code = QNameUtils.createQName(code.getNamespaceURI(), code.getLocalPart(), namespace.getPrefix());
code = new QName(code.getNamespaceURI(), code.getLocalPart(),
namespace.getPrefix());
}
faultValue.setText(prefix + ":" + code.getLocalPart());
}

View File

@@ -34,7 +34,6 @@ import org.springframework.util.ObjectUtils;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapHeaderException;
import org.springframework.ws.soap.soap12.Soap12Header;
import org.springframework.xml.namespace.QNameUtils;
/**
* Axiom-specific version of {@code org.springframework.ws.soap.Soap12Header}.
@@ -53,8 +52,9 @@ class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header {
try {
SOAPHeaderBlock notUnderstood =
getAxiomHeader().addHeaderBlock("NotUnderstood", getAxiomHeader().getNamespace());
OMNamespace headerNamespace =
notUnderstood.declareNamespace(headerName.getNamespaceURI(), QNameUtils.getPrefix(headerName));
OMNamespace headerNamespace =
notUnderstood.declareNamespace(headerName.getNamespaceURI(),
headerName.getPrefix());
notUnderstood.addAttribute("qname", headerNamespace.getPrefix() + ":" + headerName.getLocalPart(), null);
return new AxiomSoapHeaderElement(notUnderstood, getAxiomFactory());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapBodyException extends SoapEnvelopeException {
public AxiomSoapBodyException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.ws.soap.axiom;
import org.springframework.ws.soap.SoapElementException;
@SuppressWarnings("serial")
public class AxiomSoapElementException extends SoapElementException {
public AxiomSoapElementException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapEnvelopeException extends SoapEnvelopeException {
public AxiomSoapEnvelopeException(String msg) {

View File

@@ -53,6 +53,7 @@ class AxiomSoapFaultDetail extends AxiomSoapElement implements SoapFaultDetail {
}
@Override
@SuppressWarnings("unchecked")
public Iterator<SoapFaultDetailElement> getDetailEntries() {
return new AxiomSoapFaultDetailElementIterator(getAxiomFaultDetail().getChildElements());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapFaultException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapFaultException extends SoapFaultException {
public AxiomSoapFaultException(String msg) {

View File

@@ -30,7 +30,6 @@ import org.apache.axiom.soap.SOAPHeaderBlock;
import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapHeaderException;
import org.springframework.xml.namespace.QNameUtils;
/**
* Axiom-specific version of {@code org.springframework.ws.soap.SoapHeader}.
@@ -52,8 +51,9 @@ abstract class AxiomSoapHeader extends AxiomSoapElement implements SoapHeader {
@Override
public SoapHeaderElement addHeaderElement(QName name) {
try {
OMNamespace namespace =
getAxiomFactory().createOMNamespace(name.getNamespaceURI(), QNameUtils.getPrefix(name));
OMNamespace namespace =
getAxiomFactory().createOMNamespace(name.getNamespaceURI(),
name.getPrefix());
SOAPHeaderBlock axiomHeaderBlock = getAxiomHeader().addHeaderBlock(name.getLocalPart(), namespace);
return new AxiomSoapHeaderElement(axiomHeaderBlock, getAxiomFactory());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapHeaderException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapHeaderException extends SoapHeaderException {
public AxiomSoapHeaderException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageCreationException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapMessageCreationException extends SoapMessageCreationException {
public AxiomSoapMessageCreationException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class AxiomSoapMessageException extends SoapMessageException {
public AxiomSoapMessageException(String msg) {

View File

@@ -44,11 +44,11 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor;
import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping;
import org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping;
import org.springframework.ws.soap.SoapMessageFactory;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionEndpointMapping;
import org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping;
import org.springframework.ws.soap.support.SoapUtils;
import org.springframework.ws.transport.TransportConstants;
import org.springframework.ws.transport.TransportInputStream;
@@ -61,9 +61,9 @@ import org.springframework.ws.transport.TransportInputStream;
* #setPayloadCaching(boolean) payloadCaching} property to {@code false} (default is {@code true}). This this
* will read the contents of the body directly from the stream. However, <strong>when this setting is enabled, the
* payload can only be read once</strong>. This means that any endpoint mappings or interceptors which are based on the
* message payload (such as the {@link PayloadRootQNameEndpointMapping}, the {@link PayloadValidatingInterceptor}, or
* message payload (such as the {@link PayloadRootAnnotationMethodEndpointMapping}, the {@link PayloadValidatingInterceptor}, or
* the {@link PayloadLoggingInterceptor}) cannot be used. Instead, use an endpoint mapping that does not consume the
* payload (i.e. the {@link SoapActionEndpointMapping}).
* payload (i.e. the {@link SoapActionAnnotationMethodEndpointMapping}).
*
* <p>Additionally, this message factory can cache large attachments to disk by setting the {@link
* #setAttachmentCaching(boolean) attachmentCaching} property to {@code true} (default is {@code false}).

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2012 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -26,10 +26,6 @@ import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.stream.XMLInputFactory;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.xml.namespace.QNameUtils;
import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
@@ -44,6 +40,9 @@ import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Collection of generic utility methods to work with Axiom. Includes conversion from {@code OMNamespace}s to
* {@code QName}s.
@@ -68,7 +67,7 @@ public abstract class AxiomUtils {
* @throws IllegalArgumentException if {@code qName} is not fully qualified
*/
public static OMNamespace toNamespace(QName qName, OMElement resolveElement) throws OMException {
String prefix = QNameUtils.getPrefix(qName);
String prefix = qName.getPrefix();
if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(prefix)) {
return resolveElement.declareNamespace(qName.getNamespaceURI(), prefix);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import org.springframework.ws.soap.SoapMessage;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SoapFaultClientException extends WebServiceFaultException {
private final SoapFault soapFault;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj;
import org.springframework.ws.mime.AttachmentException;
/** @author Arjen Poutsma */
@SuppressWarnings("serial")
public class SaajAttachmentException extends AttachmentException {
public SaajAttachmentException(String msg) {

View File

@@ -41,6 +41,7 @@ class SaajSoap11Header extends SaajSoapHeader implements Soap11Header {
}
@Override
@SuppressWarnings("unchecked")
public Iterator<SoapHeaderElement> examineHeaderElementsToProcess(String[] actors) {
List<SOAPHeaderElement> result = new ArrayList<SOAPHeaderElement>();
Iterator<SOAPHeaderElement> iterator = getSaajHeader().examineAllHeaderElements();

View File

@@ -50,6 +50,7 @@ class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault {
}
@Override
@SuppressWarnings("unchecked")
public Iterator<QName> getFaultSubcodes() {
return getSaajFault().getFaultSubcodes();
}

View File

@@ -68,6 +68,7 @@ class SaajSoap12Header extends SaajSoapHeader implements Soap12Header {
}
@Override
@SuppressWarnings("unchecked")
public Iterator<SoapHeaderElement> examineHeaderElementsToProcess(String[] roles, boolean isUltimateDestination)
throws SoapHeaderException {
List<SOAPHeaderElement> result = new ArrayList<SOAPHeaderElement>();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj;
import org.springframework.ws.soap.SoapBodyException;
/** @author Arjen Poutsma */
@SuppressWarnings("serial")
public class SaajSoapBodyException extends SoapBodyException {
public SaajSoapBodyException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ package org.springframework.ws.soap.saaj;
import org.springframework.ws.soap.SoapElementException;
/** @author Arjen Poutsma */
@SuppressWarnings("serial")
public class SaajSoapElementException extends SoapElementException {
public SaajSoapElementException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapEnvelopeException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SaajSoapEnvelopeException extends SoapEnvelopeException {
public SaajSoapEnvelopeException(String msg) {

View File

@@ -59,6 +59,7 @@ class SaajSoapFaultDetail extends SaajSoapElement<SOAPFaultElement> implements S
}
@Override
@SuppressWarnings("unchecked")
public Iterator<SoapFaultDetailElement> getDetailEntries() {
Iterator<DetailEntry> iterator = getSaajDetail().getDetailEntries();
return new SaajSoapFaultDetailElementIterator(iterator);

View File

@@ -52,7 +52,7 @@ class SaajSoapFaultDetailElement extends SaajSoapElement<DetailEntry> implements
}
protected DetailEntry getSaajDetailEntry() {
return (DetailEntry) getSaajElement();
return getSaajElement();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapFaultException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SaajSoapFaultException extends SoapFaultException {
public SaajSoapFaultException(String msg) {

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2011 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -52,7 +52,7 @@ abstract class SaajSoapHeader extends SaajSoapElement<SOAPHeader> implements Soa
@Override
@SuppressWarnings("unchecked")
public Iterator<SoapHeaderElement> examineHeaderElements(QName name) throws SoapHeaderException {
Iterator iterator = getSaajHeader().getChildElements(name);
Iterator<SOAPHeaderElement> iterator = getSaajHeader().getChildElements(name);
return new SaajSoapHeaderElementIterator(iterator);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapHeaderException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SaajSoapHeaderException extends SoapHeaderException {
public SaajSoapHeaderException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageCreationException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SaajSoapMessageCreationException extends SoapMessageCreationException {
public SaajSoapMessageCreationException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.ws.soap.SoapMessageException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SaajSoapMessageException extends SoapMessageException {
public SaajSoapMessageException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@ import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.ws.transport.TransportConstants;
import org.springframework.xml.namespace.QNameUtils;
/**
* Collection of generic utility methods to work with SAAJ. Includes conversion from SAAJ {@link Name} objects to {@link
@@ -128,7 +127,7 @@ public abstract class SaajUtils {
* @throws IllegalArgumentException if {@code qName} is not fully qualified
*/
public static Name toName(QName qName, SOAPElement resolveElement) throws SOAPException {
String qNamePrefix = QNameUtils.getPrefix(qName);
String qNamePrefix = qName.getPrefix();
SOAPEnvelope envelope = getEnvelope(resolveElement);
if (StringUtils.hasLength(qName.getNamespaceURI()) && StringUtils.hasLength(qNamePrefix)) {
return envelope.createName(qName.getLocalPart(), qNamePrefix, qName.getNamespaceURI());
@@ -162,7 +161,7 @@ public abstract class SaajUtils {
*/
public static QName toQName(Name name) {
if (StringUtils.hasLength(name.getURI()) && StringUtils.hasLength(name.getPrefix())) {
return QNameUtils.createQName(name.getURI(), name.getLocalName(), name.getPrefix());
return new QName(name.getURI(), name.getLocalName(), name.getPrefix());
}
else if (StringUtils.hasLength(name.getURI())) {
return new QName(name.getURI(), name.getLocalName());
@@ -217,7 +216,7 @@ public abstract class SaajUtils {
* Returns the first child element of the given body.
*/
public static SOAPElement getFirstBodyElement(SOAPBody body) {
for (Iterator iterator = body.getChildElements(); iterator.hasNext(); ) {
for (Iterator<?> iterator = body.getChildElements(); iterator.hasNext(); ) {
Object child = iterator.next();
if (child instanceof SOAPElement) {
return (SOAPElement) child;

View File

@@ -25,16 +25,14 @@ import org.springframework.validation.Errors;
import org.springframework.validation.ObjectError;
import org.springframework.validation.Validator;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint;
import org.springframework.ws.soap.SoapBody;
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.springframework.xml.namespace.QNameUtils;
/**
* Extension of the {@link AbstractValidatingMarshallingPayloadEndpoint} which validates the request payload with {@link
* Extension of the {@link org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint} which validates the request payload with {@link
* Validator}(s), and creates a SOAP Fault whenever the request message cannot be validated. The desired validators can
* be set using properties, and <strong>must</strong> {@link Validator#supports(Class) support} the request object.
*
@@ -44,9 +42,11 @@ import org.springframework.xml.namespace.QNameUtils;
*
* @author Arjen Poutsma
* @since 1.0.2
* @deprecated as of Spring Web Services 2.0, in favor of annotated endpoints
*/
@Deprecated
public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
extends AbstractValidatingMarshallingPayloadEndpoint implements MessageSourceAware {
extends org.springframework.ws.server.endpoint.AbstractValidatingMarshallingPayloadEndpoint implements MessageSourceAware {
/**
* Default SOAP Fault Detail name used when a global validation error occur on the request.
@@ -54,9 +54,10 @@ public abstract class AbstractFaultCreatingValidatingMarshallingPayloadEndpoint
* @see #setDetailElementName(javax.xml.namespace.QName)
*/
public static final QName DEFAULT_DETAIL_ELEMENT_NAME =
QNameUtils.createQName("http://springframework.org/spring-ws", "ValidationError", "spring-ws");
new QName("http://springframework.org/spring-ws", "ValidationError",
"spring-ws");
/**
/**
* Default SOAP Fault string used when a validation errors occur on the request.
*
* @see #setFaultStringOrReason(String)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -91,9 +91,8 @@ public abstract class AbstractSoapFaultDefinitionExceptionResolver extends Abstr
}
else if (soapBody instanceof Soap12Body) {
Soap12Body soap12Body = (Soap12Body) soapBody;
Soap12Fault soap12Fault =
(Soap12Fault) soap12Body.addServerOrReceiverFault(faultStringOrReason, definition
.getLocale());
Soap12Fault soap12Fault = soap12Body.addServerOrReceiverFault(faultStringOrReason, definition
.getLocale());
soap12Fault.addFaultSubcode(definition.getFaultCode());
fault = soap12Fault;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,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;
@@ -27,9 +29,6 @@ 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.springframework.xml.namespace.QNameUtils;
import org.xml.sax.SAXParseException;
/**
* Subclass of {@code AbstractValidatingInterceptor} that creates a SOAP Fault whenever the request message cannot
@@ -54,9 +53,10 @@ public abstract class AbstractFaultCreatingValidatingInterceptor extends Abstrac
* @see #setDetailElementName(javax.xml.namespace.QName)
*/
public static final QName DEFAULT_DETAIL_ELEMENT_NAME =
QNameUtils.createQName("http://springframework.org/spring-ws", "ValidationError", "spring-ws");
new QName("http://springframework.org/spring-ws", "ValidationError",
"spring-ws");
/**
/**
* Default SOAP Fault string used when a validation errors occur on the request.
*
* @see #setFaultStringOrReason(String)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import java.io.IOException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class TransportException extends IOException {
protected TransportException(String msg) {

View File

@@ -153,6 +153,7 @@ public abstract class AbstractHttpSenderConnection extends AbstractSenderConnect
}
@Override
@Deprecated
public final void setFault(boolean fault) {
}

View File

@@ -106,13 +106,13 @@ public class HttpServletConnection extends AbstractReceiverConnection
@Override
@SuppressWarnings("unchecked")
protected Iterator<String> getRequestHeaderNames() throws IOException {
return new EnumerationIterator(getHttpServletRequest().getHeaderNames());
return new EnumerationIterator<String>(getHttpServletRequest().getHeaderNames());
}
@Override
@SuppressWarnings("unchecked")
protected Iterator<String> getRequestHeaders(String name) throws IOException {
return new EnumerationIterator(getHttpServletRequest().getHeaders(name));
return new EnumerationIterator<String>(getHttpServletRequest().getHeaders(name));
}
@Override
@@ -156,6 +156,7 @@ public class HttpServletConnection extends AbstractReceiverConnection
}
@Override
@Deprecated
public void setFault(boolean fault) throws IOException {
if (fault) {
getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_INTERNAL_SERVER_ERROR);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.transport.TransportException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class HttpTransportException extends TransportException {
public HttpTransportException(String msg) {

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2012 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -62,6 +62,7 @@ import org.springframework.xml.xsd.XsdSchema;
* @see org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class MessageDispatcherServlet extends FrameworkServlet {
/** Well-known name for the {@link WebServiceMessageFactory} bean in the bean factory for this namespace. */

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import org.springframework.ws.WebServiceException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class WsdlDefinitionException extends WebServiceException {
public WsdlDefinitionException(String reason) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.ws.wsdl.WsdlDefinitionException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class Wsdl4jDefinitionException extends WsdlDefinitionException {
public Wsdl4jDefinitionException(WSDLException ex) {

View File

@@ -255,6 +255,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
/** Servlet that returns and error message for a given status code. */
@SuppressWarnings("serial")
private static class ErrorServlet extends HttpServlet {
private int sc;
@@ -270,6 +271,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
/** Abstract SOAP Servlet */
@SuppressWarnings("serial")
private abstract static class AbstractSoapServlet extends HttpServlet {
protected MessageFactory messageFactory = null;
@@ -344,6 +346,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException;
}
@SuppressWarnings("serial")
private static class EchoSoapServlet extends AbstractSoapServlet {
@Override
@@ -352,6 +355,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class NoResponseSoapServlet extends AbstractSoapServlet {
@Override
@@ -360,6 +364,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class SoapFaultServlet extends AbstractSoapServlet {
@Override
@@ -371,6 +376,7 @@ public abstract class AbstractSoap11WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class AttachmentsServlet extends AbstractSoapServlet {
@Override

View File

@@ -264,6 +264,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
/** Servlet that returns and error message for a given status code. */
@SuppressWarnings("serial")
private static class ErrorServlet extends HttpServlet {
private int sc;
@@ -279,12 +280,11 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
/** Abstract SOAP Servlet */
@SuppressWarnings("serial")
private abstract static class AbstractSoapServlet extends HttpServlet {
protected MessageFactory messageFactory = null;
private final int sc = -1;
@Override
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
@@ -358,6 +358,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
protected abstract SOAPMessage onMessage(SOAPMessage message) throws SOAPException;
}
@SuppressWarnings("serial")
private static class EchoSoapServlet extends AbstractSoapServlet {
@Override
@@ -366,6 +367,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class NoResponseSoapServlet extends AbstractSoapServlet {
@Override
@@ -374,6 +376,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class SoapReceiverFaultServlet extends AbstractSoapServlet {
@Override
@@ -385,6 +388,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class SoapSenderFaultServlet extends AbstractSoapServlet {
@Override
@@ -396,6 +400,7 @@ public abstract class AbstractSoap12WebServiceTemplateIntegrationTestCase {
}
}
@SuppressWarnings("serial")
private static class AttachmentsServlet extends AbstractSoapServlet {
@Override

View File

@@ -99,6 +99,7 @@ public class DomPoxWebServiceTemplateIntegrationTest {
}
/** Servlet that returns and error message for a given status code. */
@SuppressWarnings("serial")
private static class ErrorServlet extends HttpServlet {
private int sc;
@@ -114,6 +115,7 @@ public class DomPoxWebServiceTemplateIntegrationTest {
}
/** Simple POX Servlet. */
@SuppressWarnings("serial")
private static class PoxServlet extends HttpServlet {
private DocumentBuilderFactory documentBuilderFactory;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ import org.springframework.util.StringUtils;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public class SimpleSaajServlet extends HttpServlet {
private MessageFactory msgFactory = null;

View File

@@ -42,6 +42,7 @@ import org.springframework.ws.transport.WebServiceMessageSender;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
@SuppressWarnings("unchecked")
public class WebServiceTemplateTest {
private WebServiceTemplate template;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,10 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ws.MockWebServiceMessage;
@@ -38,10 +42,6 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.saaj.support.SaajUtils;
import org.springframework.xml.xsd.SimpleXsdSchema;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class PayloadValidatingInterceptorTest {
private PayloadValidatingInterceptor interceptor;
@@ -81,7 +81,7 @@ public class PayloadValidatingInterceptorTest {
@Test
public void testHandleInvalidRequest() throws Exception {
SoapMessage invalidMessage = (SoapMessage) soap11Factory.createWebServiceMessage();
SoapMessage invalidMessage = soap11Factory.createWebServiceMessage();
InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE);
transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult());
context = new DefaultMessageContext(invalidMessage, soap11Factory);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,16 +19,15 @@ package org.springframework.ws.mime;
import java.io.IOException;
import java.util.Iterator;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;
import org.springframework.ws.AbstractWebServiceMessageTestCase;
import org.springframework.ws.WebServiceMessage;
import org.junit.Test;
import static org.junit.Assert.*;
public abstract class AbstractMimeMessageTestCase extends AbstractWebServiceMessageTestCase {
protected MimeMessage mimeMessage;
@@ -76,7 +75,7 @@ public abstract class AbstractMimeMessageTestCase extends AbstractWebServiceMess
Iterator<Attachment> iterator = mimeMessage.getAttachments();
assertNotNull("Attachment iterator is null", iterator);
assertTrue("Attachment iterator has no elements", iterator.hasNext());
Attachment attachment = (Attachment) iterator.next();
Attachment attachment = iterator.next();
testAttachment(attachment);
assertFalse("Attachment iterator has too many elements", iterator.hasNext());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,12 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ws.MockWebServiceMessage;
@@ -36,13 +42,6 @@ import org.springframework.xml.sax.SaxUtils;
import org.springframework.xml.transform.ResourceSource;
import org.springframework.xml.transform.StringResult;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
public class PayloadTransformingInterceptorTest {
private PayloadTransformingInterceptor interceptor;
@@ -150,7 +149,7 @@ public class PayloadTransformingInterceptorTest {
interceptor.setRequestXslt(xslt);
interceptor.afterPropertiesSet();
DomPoxMessageFactory factory = new DomPoxMessageFactory();
DomPoxMessage message = (DomPoxMessage) factory.createWebServiceMessage();
DomPoxMessage message = factory.createWebServiceMessage();
transformer.transform(new ResourceSource(input), message.getPayloadResult());
MessageContext context = new DefaultMessageContext(message, factory);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,15 +16,15 @@
package org.springframework.ws.soap.axiom;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.soap.SOAPFactory;
import org.junit.Test;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.soap11.AbstractSoap11BodyTestCase;
import org.springframework.xml.transform.StringSource;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.soap.SOAPFactory;
import org.junit.Test;
public class AxiomSoap11BodyTest extends AbstractSoap11BodyTestCase {
@Override
@@ -40,7 +40,7 @@ public class AxiomSoap11BodyTest extends AbstractSoap11BodyTestCase {
messageFactory.setPayloadCaching(false);
messageFactory.setSoapVersion(SoapVersion.SOAP_11);
AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage();
AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage();
soapBody = axiomSoapMessage.getSoapBody();
String payload = "<payload xmlns='http://www.springframework.org' />";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class AxiomSoap11NonCachingBodyTest extends AbstractSoap11BodyTestCase {
messageFactory.setPayloadCaching(false);
messageFactory.setSoapVersion(SoapVersion.SOAP_11);
AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage();
AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage();
return axiomSoapMessage.getSoapBody();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,15 +16,14 @@
package org.springframework.ws.soap.axiom;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import static org.junit.Assert.*;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.soap11.AbstractSoap11MessageTestCase;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import static org.junit.Assert.*;
public class AxiomSoap11NonCachingMessageTest extends AbstractSoap11MessageTestCase {
@Override
@@ -33,7 +32,7 @@ public class AxiomSoap11NonCachingMessageTest extends AbstractSoap11MessageTestC
messageFactory.setPayloadCaching(false);
messageFactory.setSoapVersion(SoapVersion.SOAP_11);
return (SoapMessage) messageFactory.createWebServiceMessage();
return messageFactory.createWebServiceMessage();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,15 +16,15 @@
package org.springframework.ws.soap.axiom;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.soap.SOAPFactory;
import org.junit.Test;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.soap12.AbstractSoap12BodyTestCase;
import org.springframework.xml.transform.StringSource;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.soap.SOAPFactory;
import org.junit.Test;
public class AxiomSoap12BodyTest extends AbstractSoap12BodyTestCase {
@Override
@@ -40,7 +40,7 @@ public class AxiomSoap12BodyTest extends AbstractSoap12BodyTestCase {
messageFactory.setPayloadCaching(false);
messageFactory.setSoapVersion(SoapVersion.SOAP_12);
AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage();
AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage();
soapBody = axiomSoapMessage.getSoapBody();
String payload = "<payload xmlns='http://www.springframework.org' />";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class AxiomSoap12NonCachingBodyTest extends AbstractSoap12BodyTestCase {
messageFactory.setPayloadCaching(false);
messageFactory.setSoapVersion(SoapVersion.SOAP_12);
AxiomSoapMessage axiomSoapMessage = (AxiomSoapMessage) messageFactory.createWebServiceMessage();
AxiomSoapMessage axiomSoapMessage = messageFactory.createWebServiceMessage();
return axiomSoapMessage.getSoapBody();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,10 @@ import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPMessage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapMessage;
@@ -34,10 +38,6 @@ import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
import org.springframework.ws.soap.soap11.Soap11Fault;
import org.springframework.ws.soap.soap12.Soap12Fault;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class SoapFaultAnnotationExceptionResolverTest {
private SoapFaultAnnotationExceptionResolver resolver;
@@ -197,15 +197,18 @@ public class SoapFaultAnnotationExceptionResolverTest {
}
@SoapFault(faultCode = FaultCode.CLIENT, faultStringOrReason = "Client error")
@SuppressWarnings("serial")
public class MyClientException extends Exception {
}
@SuppressWarnings("serial")
public class MySubClientException extends MyClientException {
}
@SoapFault(faultCode = FaultCode.CLIENT)
@SuppressWarnings("serial")
public class NoStringOrReasonException extends Exception {
public NoStringOrReasonException(String message) {
@@ -214,26 +217,31 @@ public class SoapFaultAnnotationExceptionResolverTest {
}
@SoapFault(faultCode = FaultCode.SENDER, faultStringOrReason = "Sender error")
@SuppressWarnings("serial")
public class MySenderException extends Exception {
}
@SoapFault(faultCode = FaultCode.SERVER, faultStringOrReason = "Server error")
@SuppressWarnings("serial")
public class MyServerException extends Exception {
}
@SoapFault(faultCode = FaultCode.RECEIVER, faultStringOrReason = "Receiver error")
@SuppressWarnings("serial")
public class MyReceiverException extends Exception {
}
@SoapFault(faultCode = FaultCode.CUSTOM, customFaultCode = "{http://springframework.org/spring-ws}Fault",
faultStringOrReason = "MyCustomException thrown", locale = "nl")
@SuppressWarnings("serial")
public class MyCustomException extends Exception {
}
@SuppressWarnings("serial")
public class NonAnnotatedException extends Exception {
}

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2011 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -27,6 +27,14 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.LocatorImpl;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ws.MockWebServiceMessage;
@@ -47,15 +55,6 @@ import org.springframework.ws.transport.TransportInputStream;
import org.springframework.xml.validation.ValidationErrorHandler;
import org.springframework.xml.xsd.SimpleXsdSchema;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.LocatorImpl;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
public class PayloadValidatingInterceptorTest {
private PayloadValidatingInterceptor interceptor;
@@ -143,7 +142,7 @@ public class PayloadValidatingInterceptorTest {
interceptor.setFaultStringOrReasonLocale(locale);
interceptor.setAddValidationErrorDetail(false);
SoapMessage invalidMessage = (SoapMessage) soap11Factory.createWebServiceMessage();
SoapMessage invalidMessage = soap11Factory.createWebServiceMessage();
InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE);
transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult());
context = new DefaultMessageContext(invalidMessage, soap11Factory);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,16 +19,15 @@ package org.springframework.ws.soap.soap11;
import java.util.Iterator;
import javax.xml.namespace.QName;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
import org.junit.Test;
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.junit.Test;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTestCase {
private static final String PREFIX = "spring";
@@ -66,9 +65,9 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes
Iterator<SoapHeaderElement> iterator = ((Soap11Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role1"});
assertNotNull("header element iterator is null", iterator);
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertFalse("header element iterator has too many elements", iterator.hasNext());
}
@@ -86,9 +85,9 @@ public abstract class AbstractSoap11HeaderTestCase extends AbstractSoapHeaderTes
Iterator<SoapHeaderElement> iterator = ((Soap11Header) soapHeader).examineHeaderElementsToProcess(new String[0]);
assertNotNull("header element iterator is null", iterator);
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertFalse("header element iterator has too many elements", iterator.hasNext());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,12 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
import junit.framework.Assert;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.InputStreamSource;
@@ -33,13 +39,6 @@ import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.transport.MockTransportOutputStream;
import org.springframework.xml.transform.StringSource;
import junit.framework.Assert;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageTestCase {
@Override
@@ -67,11 +66,11 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT
assertXMLEqual(
"<Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'><Body><payload xmlns='http://www.springframework.org' /></Body></Envelope>",
result);
String contentType = (String) tos.getHeaders().get("Content-Type");
String contentType = tos.getHeaders().get("Content-Type");
assertTrue("Invalid Content-Type set", contentType.indexOf(SoapVersion.SOAP_11.getContentType()) != -1);
String resultSoapAction = (String) tos.getHeaders().get("SOAPAction");
String resultSoapAction = tos.getHeaders().get("SOAPAction");
assertEquals("Invalid soap action", "\"" + soapAction + "\"", resultSoapAction);
String resultAccept = (String) tos.getHeaders().get("Accept");
String resultAccept = tos.getHeaders().get("Accept");
assertNotNull("Invalid accept header", resultAccept);
}
@@ -82,7 +81,7 @@ public abstract class AbstractSoap11MessageTestCase extends AbstractSoapMessageT
ByteArrayOutputStream bos = new ByteArrayOutputStream();
MockTransportOutputStream tos = new MockTransportOutputStream(bos);
soapMessage.writeTo(tos);
String contentType = (String) tos.getHeaders().get("Content-Type");
String contentType = tos.getHeaders().get("Content-Type");
assertTrue("Content-Type for attachment message does not contains multipart/related",
contentType.indexOf("multipart/related") != -1);
assertTrue("Content-Type for attachment message does not contains type=\"text/xml\"",

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,16 +19,15 @@ package org.springframework.ws.soap.soap12;
import java.util.Iterator;
import javax.xml.namespace.QName;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
import org.junit.Test;
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.junit.Test;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.*;
public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTestCase {
@Test
@@ -96,9 +95,9 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
Iterator<SoapHeaderElement> iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role1"}, false);
assertNotNull("header element iterator is null", iterator);
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertFalse("header element iterator has too many elements", iterator.hasNext());
}
@@ -116,9 +115,9 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
Iterator<SoapHeaderElement> iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[0], false);
assertNotNull("header element iterator is null", iterator);
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertTrue("header element iterator has no elements", iterator.hasNext());
checkHeaderElement((SoapHeaderElement) iterator.next());
checkHeaderElement(iterator.next());
assertFalse("header element iterator has too many elements", iterator.hasNext());
}
@@ -129,7 +128,7 @@ public abstract class AbstractSoap12HeaderTestCase extends AbstractSoapHeaderTes
headerElement.setActorOrRole(SoapVersion.SOAP_12.getUltimateReceiverRoleUri());
Iterator<SoapHeaderElement> iterator = ((Soap12Header) soapHeader).examineHeaderElementsToProcess(new String[]{"role"}, true);
assertNotNull("header element iterator is null", iterator);
headerElement = (SoapHeaderElement) iterator.next();
headerElement = iterator.next();
assertEquals("Invalid name on header element", new QName(NAMESPACE, "localName", PREFIX),
headerElement.getName());
assertFalse("header element iterator has too many elements", iterator.hasNext());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,6 +36,17 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.After;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.FileCopyUtils;
import org.springframework.ws.WebServiceMessage;
@@ -48,18 +59,6 @@ import org.springframework.ws.transport.support.FreePortScanner;
import org.springframework.xml.transform.StringResult;
import org.springframework.xml.transform.StringSource;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
import static org.junit.Assert.assertEquals;
public abstract class AbstractHttpWebServiceMessageSenderIntegrationTestCase {
private Server jettyServer;
@@ -241,6 +240,7 @@ public abstract class AbstractHttpWebServiceMessageSenderIntegrationTestCase {
return request;
}
@SuppressWarnings("serial")
private class MyServlet extends HttpServlet {
private int responseStatus = HttpServletResponse.SC_OK;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,22 +27,19 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.soap.MessageFactory;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.util.FileCopyUtils;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.support.FreePortScanner;
import org.apache.commons.httpclient.ConnectTimeoutException;
import org.apache.commons.httpclient.URIException;
import org.junit.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.util.FileCopyUtils;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.support.FreePortScanner;
public class CommonsHttpMessageSenderIntegrationTest extends AbstractHttpWebServiceMessageSenderIntegrationTestCase {
@Override
@@ -101,6 +98,7 @@ public class CommonsHttpMessageSenderIntegrationTest extends AbstractHttpWebServ
}
@SuppressWarnings("serial")
private class EchoServlet extends HttpServlet {
@Override

View File

@@ -1,11 +1,11 @@
/*
* Copyright 2005-2012 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -27,6 +27,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.soap.MessageFactory;
import org.apache.commons.httpclient.URIException;
import org.junit.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.util.FileCopyUtils;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
@@ -34,12 +40,6 @@ import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.transport.WebServiceConnection;
import org.springframework.ws.transport.support.FreePortScanner;
import org.apache.commons.httpclient.URIException;
import org.junit.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
public class HttpComponentsMessageSenderIntegrationTest extends AbstractHttpWebServiceMessageSenderIntegrationTestCase {
@Override
@@ -97,6 +97,7 @@ public class HttpComponentsMessageSenderIntegrationTest extends AbstractHttpWebS
}
@SuppressWarnings("serial")
private class EchoServlet extends HttpServlet {
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import org.springframework.ws.WebServiceException;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WsSecurityException extends WebServiceException {
public WsSecurityException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import javax.xml.namespace.QName;
* @author Arjen Poutsma
* @since 1.0.1
*/
@SuppressWarnings("serial")
public abstract class WsSecurityFaultException extends WsSecurityException {
private QName faultCode;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ package org.springframework.ws.soap.security;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WsSecuritySecurementException extends WsSecurityException {
public WsSecuritySecurementException(String msg) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ package org.springframework.ws.soap.security;
* @author Arjen Poutsma
* @since 1.0.0
*/
@SuppressWarnings("serial")
public abstract class WsSecurityValidationException extends WsSecurityException {
public WsSecurityValidationException(String msg) {

View File

@@ -1,10 +1,11 @@
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
/*
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* 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,
@@ -15,11 +16,11 @@
package org.springframework.ws.soap.security.support;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.authentication.CredentialsExpiredException;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.core.userdetails.UserDetails;
/**
* Generic utility methods for Spring Security
@@ -37,6 +38,7 @@ public abstract class SpringSecurityUtils {
* @throws DisabledException if the account is disabled
* @throws LockedException if the account is locked
*/
@SuppressWarnings("deprecation")
public static void checkUserValidity(UserDetails user)
throws AccountExpiredException, CredentialsExpiredException, DisabledException, LockedException {
if (!user.isAccountNonLocked()) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006 the original author or authors.
* Copyright 2005-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import org.springframework.ws.soap.security.WsSecurityFaultException;
* @author Arjen Poutsma
* @since 1.5.0
*/
@SuppressWarnings("serial")
public class Wss4jSecurityFaultException extends WsSecurityFaultException {
public Wss4jSecurityFaultException(QName faultCode, String faultString, String faultActor) {

Some files were not shown because too many files have changed in this diff Show More