Moved server-side classes to server package.

This commit is contained in:
Arjen Poutsma
2007-01-14 13:33:11 +00:00
parent 55a119b7fc
commit 0e1943c1c5
91 changed files with 254 additions and 193 deletions

View File

@@ -48,12 +48,18 @@ 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 TransportOutputStream}, the corresponding headers will be
* writen as well.
* org.springframework.ws.transport.TransportOutputStream}, the corresponding headers will be writen as well.
*
* @param outputStream the stream to write to
* @throws IOException if an I/O exception occurs
*/
void writeTo(OutputStream outputStream) throws IOException;
/**
* Indicates whether this message contains a fault.
*
* @return <code>true</code> if the message has a fault; <code>false</code> otherwise
*/
boolean hasFault();
}

View File

@@ -69,6 +69,10 @@ public class DomPoxMessage implements PoxMessage {
return new DOMSource(document);
}
public boolean hasFault() {
return false;
}
public void writeTo(OutputStream outputStream) throws IOException {
try {
if (outputStream instanceof TransportOutputStream) {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
@@ -34,8 +34,8 @@ import org.springframework.ws.context.MessageContext;
*
* @author Arjen Poutsma
* @see EndpointInvocationChain#getInterceptors()
* @see org.springframework.ws.endpoint.interceptor.EndpointInterceptorAdapter
* @see org.springframework.ws.endpoint.mapping.AbstractEndpointMapping#setInterceptors(EndpointInterceptor[])
* @see org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter
* @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping#setInterceptors(EndpointInterceptor[])
*/
public interface EndpointInterceptor {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
/**
* Endpoint invocation chain, consisting of an endpoint object and any preprocessing interceptors.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import org.springframework.ws.context.MessageContext;
@@ -31,8 +31,8 @@ import org.springframework.ws.context.MessageContext;
* <code>handlerRequest</code> methods have returned <code>true</code>.
*
* @author Arjen Poutsma
* @see org.springframework.ws.endpoint.mapping.AbstractEndpointMapping
* @see org.springframework.ws.endpoint.mapping.PayloadRootQNameEndpointMapping
* @see org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
* @see org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping
* @see org.springframework.ws.soap.endpoint.mapping.SoapActionEndpointMapping
*/
public interface EndpointMapping {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import java.util.ArrayList;
import java.util.Iterator;
@@ -24,10 +24,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.util.ObjectUtils;
import org.springframework.ws.NoEndpointFoundException;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.endpoint.MessageEndpointAdapter;
import org.springframework.ws.endpoint.PayloadEndpointAdapter;
import org.springframework.ws.server.endpoint.MessageEndpoint;
import org.springframework.ws.server.endpoint.MessageEndpointAdapter;
import org.springframework.ws.server.endpoint.PayloadEndpointAdapter;
/**
* Central dispatcher for use withing Spring-WS. Dispatches Web service messages to registered endoints.
@@ -158,7 +159,8 @@ public class MessageDispatcher implements MessageEndpoint, BeanNameAware {
* Dispatches the request in the given MessageContext according to the configuration.
*
* @param messageContext the message context
* @throws 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;
@@ -266,8 +268,8 @@ public class MessageDispatcher implements MessageEndpoint, BeanNameAware {
* <code>PayloadEndpointAdapter</code>.
*
* @see #setEndpointAdapters(java.util.List)
* @see org.springframework.ws.endpoint.MessageEndpointAdapter
* @see org.springframework.ws.endpoint.PayloadEndpointAdapter
* @see org.springframework.ws.server.endpoint.MessageEndpointAdapter
* @see org.springframework.ws.server.endpoint.PayloadEndpointAdapter
*/
protected void initDefaultStrategies() {
List defaultEndpointAdapters = new ArrayList();

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.ws.EndpointExceptionResolver;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointExceptionResolver;
/**
* Abstract base class for <code>ExceptionResolver</code>s. Provides a set of mapped endpoints that the resolver should

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.StringWriter;
import javax.xml.transform.OutputKeys;
@@ -24,9 +24,9 @@ import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.stream.StreamResult;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.xml.transform.TransformerObjectSupport;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.XMLEventFactory;
import javax.xml.stream.XMLEventReader;
@@ -43,8 +42,8 @@ import org.springframework.xml.transform.StaxSource;
* the request with a <code>XMLEventReader</code>, and to create a response using a <code>XMLEventWriter</code>.
*
* @author Arjen Poutsma
* @see #invokeInternal(javax.xml.stream.XMLEventReader, javax.xml.stream.util.XMLEventConsumer,
* javax.xml.stream.XMLEventFactory)
* @see #invokeInternal(javax.xml.stream.XMLEventReader,javax.xml.stream.util.XMLEventConsumer,
*javax.xml.stream.XMLEventFactory)
* @see XMLEventReader
* @see XMLEventWriter
*/

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -40,7 +40,7 @@ import org.springframework.xml.transform.StaxSource;
* request with a <code>XMLStreamReader</code>, and to create a response using a <code>XMLStreamWriter</code>.
*
* @author Arjen Poutsma
* @see #invokeInternal(javax.xml.stream.XMLStreamReader, javax.xml.stream.XMLStreamWriter)
* @see #invokeInternal(javax.xml.stream.XMLStreamReader,javax.xml.stream.XMLStreamWriter)
* @see XMLStreamReader
* @see XMLStreamWriter
*/

View File

@@ -14,10 +14,9 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.IOException;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.sax.SAXSource;
@@ -28,11 +27,10 @@ import nu.xom.Document;
import nu.xom.Element;
import nu.xom.ParsingException;
import nu.xom.converters.DOMConverter;
import org.springframework.xml.transform.StringSource;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.springframework.xml.transform.StringSource;
/**
* Abstract base class for endpoints that handle the message payload as XOM elements. Offers the message payload as a
* XOM <code>Element</code>, and allows subclasses to create a response by returning an <code>Element</code>.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.springframework.ws.context.MessageContext;

View File

@@ -14,16 +14,16 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.springframework.ws.EndpointAdapter;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointAdapter;
/**
* Adapter to use a <code>MessageEndpoint</code> as the endpoint for a <code>EndpointInvocationChain</code>.
*
* @author Arjen Poutsma
* @see org.springframework.ws.EndpointInvocationChain
* @see org.springframework.ws.server.EndpointInvocationChain
*/
public class MessageEndpointAdapter implements EndpointAdapter {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import org.springframework.ws.EndpointAdapter;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointAdapter;
import org.springframework.xml.transform.TransformerObjectSupport;
/**
@@ -29,7 +29,7 @@ import org.springframework.xml.transform.TransformerObjectSupport;
*
* @author Arjen Poutsma
* @see PayloadEndpoint
* @see org.springframework.ws.EndpointInvocationChain
* @see org.springframework.ws.server.EndpointInvocationChain
*/
public class PayloadEndpointAdapter extends TransformerObjectSupport implements EndpointAdapter {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import java.io.IOException;
import java.util.Locale;
@@ -29,9 +29,9 @@ import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapFaultDetail;

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.w3c.dom.Element;
/**

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import javax.xml.transform.Source;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.endpoint.AbstractLoggingInterceptor;
import org.springframework.ws.server.endpoint.AbstractLoggingInterceptor;
/**
* Simple <code>EndpointInterceptor</code> that logs the payload of request and response messages. By default, both

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
@@ -26,9 +26,9 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.xml.sax.SaxUtils;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import javax.xml.transform.Source;

View File

@@ -14,20 +14,20 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.EndpointMapping;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.EndpointMapping;
/**
* Abstract base class for EndpointMapping implementations. Supports a default endpoint, and endpoint interceptors.
*
* @author Arjen Poutsma
* @see #getEndpointInternal(org.springframework.ws.context.MessageContext)
* @see org.springframework.ws.EndpointInterceptor
* @see org.springframework.ws.server.EndpointInterceptor
*/
public abstract class AbstractEndpointMapping extends ApplicationObjectSupport implements EndpointMapping {
@@ -108,7 +108,7 @@ public abstract class AbstractEndpointMapping extends ApplicationObjectSupport i
* @param endpoint the endpoint
* @param interceptors the endpoint interceptors
* @return the created invocation chain
* @see #setInterceptors(org.springframework.ws.EndpointInterceptor[])
* @see #setInterceptors(org.springframework.ws.server.EndpointInterceptor[])
*/
protected EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,
Object endpoint,

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import java.util.HashMap;
import java.util.Iterator;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import javax.xml.namespace.QName;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import javax.xml.namespace.QName;
import javax.xml.transform.Transformer;

View File

@@ -0,0 +1,5 @@
<html>
<body>
Contains classes for server-side Spring-WS support.
</body>
</html>

View File

@@ -56,6 +56,13 @@ public abstract class AbstractSoapMessage implements SoapMessage {
return getSoapBody().getPayloadResult();
}
/**
* Returns <code>getSoapBody().hasFault()</code>.
*/
public boolean hasFault() {
return getSoapBody().hasFault();
}
public SoapVersion getVersion() {
if (version == null) {
String envelopeNamespace = getEnvelope().getName().getNamespaceURI();

View File

@@ -16,8 +16,8 @@
package org.springframework.ws.soap;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
/**
* SOAP-specific extension of the <code>EndpointInterceptor</code> interface. Allows for handling of SOAP faults, which

View File

@@ -16,7 +16,7 @@
package org.springframework.ws.soap;
import org.springframework.ws.EndpointMapping;
import org.springframework.ws.server.EndpointMapping;
/**
* SOAP-specific sub-interface of the <code>EndpointMapping</code>. Adds associated actors (SOAP 1.1) or roles (SOAP

View File

@@ -5,7 +5,7 @@ import java.util.Locale;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.AbstractEndpointExceptionResolver;
import org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapMessage;

View File

@@ -21,7 +21,7 @@ import java.util.Properties;
import org.springframework.util.Assert;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.AbstractEndpointExceptionResolver;
import org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.soap11.Soap11Body;

View File

@@ -20,7 +20,7 @@ import javax.xml.transform.Source;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.AbstractLoggingInterceptor;
import org.springframework.ws.server.endpoint.AbstractLoggingInterceptor;
import org.springframework.ws.soap.SoapEndpointInterceptor;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapMessage;

View File

@@ -18,11 +18,11 @@ package org.springframework.ws.soap.endpoint.mapping;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.EndpointMapping;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapEndpointInvocationChain;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.EndpointMapping;
import org.springframework.ws.soap.SoapEndpointMapping;
import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
/**
* <code>EndpointMapping</code> implement that adds SOAP actors or roles to a delegate endpoint. Delegates to another
@@ -71,8 +71,7 @@ public class DelegatingSoapEndpointMapping implements InitializingBean, SoapEndp
*/
public EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception {
EndpointInvocationChain delegateChain = delegate.getEndpoint(messageContext);
return new SoapEndpointInvocationChain(delegateChain.getEndpoint(),
delegateChain.getInterceptors(),
return new SoapEndpointInvocationChain(delegateChain.getEndpoint(), delegateChain.getInterceptors(),
actorsOrRoles);
}

View File

@@ -18,13 +18,13 @@ package org.springframework.ws.soap.endpoint.mapping;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.mapping.AbstractMapBasedEndpointMapping;
import org.springframework.ws.soap.SoapEndpointInvocationChain;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping;
import org.springframework.ws.soap.SoapEndpointMapping;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
/**
* Implementation of the <code>EndpointMapping</code> interface to map from <code>SOAPAction</code> headers to endpoint
@@ -69,7 +69,7 @@ public class SoapActionEndpointMapping extends AbstractMapBasedEndpointMapping i
* @param endpoint the endpoint
* @param interceptors the endpoint interceptors
* @return the created invocation chain
* @see #setInterceptors(org.springframework.ws.EndpointInterceptor[])
* @see #setInterceptors(org.springframework.ws.server.EndpointInterceptor[])
* @see #setActorsOrRoles(String[])
*/
protected final EndpointInvocationChain createEndpointInvocationChain(MessageContext messageContext,

View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/
package org.springframework.ws.soap;
package org.springframework.ws.soap.server;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.EndpointInvocationChain;
/**
* SOAP-specific subclass of the <code>EndpointInvocationChain</code>. Adds associated actors (SOAP 1.1) or roles (SOAP

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap;
package org.springframework.ws.soap.server;
import java.util.ArrayList;
import java.util.Collections;
@@ -25,10 +25,17 @@ import javax.xml.namespace.QName;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.MessageDispatcher;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.MessageDispatcher;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapEndpointInterceptor;
import org.springframework.ws.soap.SoapFault;
import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.SoapVersion;
import org.springframework.ws.soap.endpoint.SimpleSoapExceptionResolver;
import org.springframework.ws.soap.soap12.Soap12Header;
@@ -37,8 +44,8 @@ import org.springframework.ws.soap.soap12.Soap12Header;
* invocation chain, and endpoint interception using <code>SoapEndpointInterceptor</code>s.
*
* @author Arjen Poutsma
* @see SoapMessage
* @see SoapEndpointInterceptor
* @see org.springframework.ws.soap.SoapMessage
* @see org.springframework.ws.soap.SoapEndpointInterceptor
*/
public class SoapMessageDispatcher extends MessageDispatcher {
@@ -73,7 +80,7 @@ public class SoapMessageDispatcher extends MessageDispatcher {
* Initialize the default implementations for the dispatcher's strategies, in addition to the strategies defined in
* the base class: a <code>SimpleSoapExceptionResolver</code> as exception resolver.
*
* @see org.springframework.ws.MessageDispatcher#initDefaultStrategies()
* @see org.springframework.ws.server.MessageDispatcher#initDefaultStrategies()
* @see #setEndpointExceptionResolvers(java.util.List)
* @see org.springframework.ws.soap.endpoint.SimpleSoapExceptionResolver
*/
@@ -91,7 +98,7 @@ public class SoapMessageDispatcher extends MessageDispatcher {
* @param messageContext the message context
* @return <code>true</code> if all necessary headers are understood; <code>false</code> otherwise
* @see SoapEndpointInvocationChain#getActorsOrRoles()
* @see SoapHeader#examineMustUnderstandHeaderElements(String)
* @see org.springframework.ws.soap.SoapHeader#examineMustUnderstandHeaderElements(String)
*/
protected boolean handleRequest(EndpointInvocationChain mappedEndpoint, MessageContext messageContext) {
if (messageContext.getRequest() instanceof SoapMessage) {
@@ -118,7 +125,7 @@ public class SoapMessageDispatcher extends MessageDispatcher {
* Determines the roles for a specific SOAP invocation chain. Gets the roles specified on the chain, and adds the
* SOAP-version specific 'next' role to it.
*
* @see SoapVersion#getNextActorOrRoleUri()
* @see org.springframework.ws.soap.SoapVersion#getNextActorOrRoleUri()
*/
protected String[] getRoles(EndpointInvocationChain mappedEndpoint, SoapVersion version) {
String[] mappedRoles = null;
@@ -138,7 +145,7 @@ public class SoapMessageDispatcher extends MessageDispatcher {
* <code>SoapEndpointInterceptor</code>. If they are, returns <code>true</code>. If they are not, a SOAP fault is
* created, and false is returned.
*
* @see SoapEndpointInterceptor#understands(SoapHeaderElement)
* @see org.springframework.ws.soap.SoapEndpointInterceptor#understands(org.springframework.ws.soap.SoapHeaderElement)
*/
private boolean handleRequestForRole(EndpointInvocationChain mappedEndpoint,
MessageContext messageContext,
@@ -197,7 +204,7 @@ public class SoapMessageDispatcher extends MessageDispatcher {
* @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
* @see org.springframework.ws.EndpointInterceptor#handleResponse(org.springframework.ws.context.MessageContext,
* @see org.springframework.ws.server.EndpointInterceptor#handleResponse(org.springframework.ws.context.MessageContext,
*Object)
*/
protected void triggerHandleResponse(EndpointInvocationChain mappedEndpoint,

View File

@@ -0,0 +1,5 @@
<html>
<body>
Contains classes for SOAP-specific server-side Spring-WS support.
</body>
</html>

View File

@@ -25,14 +25,14 @@ import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.server.endpoint.MessageEndpoint;
/**
* Convenience base class for server-side transport objects. Contains a {@link WebServiceMessageFactory}, and has
* methods for handling incoming <code>WebServiceMessage</code> requests.
*
* @author Arjen Poutsma
* @see #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.endpoint.MessageEndpoint)
* @see #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.server.endpoint.MessageEndpoint)
*/
public abstract class MessageReceiverObjectSupport implements InitializingBean {
@@ -87,7 +87,7 @@ public abstract class MessageReceiverObjectSupport implements InitializingBean {
}
/**
* Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.endpoint.MessageEndpoint)}
* Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.server.endpoint.MessageEndpoint)}
* when no response is given. Default implementation does nothing. Can be overriden to set certain
* transport-specific response headers.
*
@@ -98,7 +98,7 @@ public abstract class MessageReceiverObjectSupport implements InitializingBean {
}
/**
* Handles the sending of the response. Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.endpoint.MessageEndpoint)}.
* Handles the sending of the response. Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.server.endpoint.MessageEndpoint)}.
* Default implementation writes the given response to the given <code>TransportOutputStream</code>. Can be
* overriden to set certain transport-specific headers.
*
@@ -113,7 +113,7 @@ public abstract class MessageReceiverObjectSupport implements InitializingBean {
}
/**
* Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.endpoint.MessageEndpoint)}
* Invoked from {@link #handle(TransportInputStream,TransportOutputStream,org.springframework.ws.server.endpoint.MessageEndpoint)}
* when no suitable endpoint is found. Default implementation does nothing. Can be overriden to set certain
* transport-specific response headers.
*

View File

@@ -23,11 +23,11 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.FrameworkServlet;
import org.springframework.web.util.WebUtils;
import org.springframework.ws.EndpointAdapter;
import org.springframework.ws.EndpointExceptionResolver;
import org.springframework.ws.EndpointMapping;
import org.springframework.ws.MessageDispatcher;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.server.EndpointAdapter;
import org.springframework.ws.server.EndpointExceptionResolver;
import org.springframework.ws.server.EndpointMapping;
import org.springframework.ws.server.MessageDispatcher;
import org.springframework.ws.wsdl.WsdlDefinition;
/**
@@ -46,7 +46,7 @@ import org.springframework.ws.wsdl.WsdlDefinition;
*
* @author Arjen Poutsma
* @see org.springframework.web.servlet.DispatcherServlet
* @see org.springframework.ws.MessageDispatcher
* @see org.springframework.ws.server.MessageDispatcher
* @see org.springframework.ws.transport.http.MessageEndpointHandlerAdapter
*/
public class MessageDispatcherServlet extends FrameworkServlet {
@@ -56,7 +56,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* when <code>detectAllEndpointAdapters</code> is turned off.
*
* @see #setDetectAllEndpointAdapters(boolean)
* @see org.springframework.ws.EndpointAdapter
* @see org.springframework.ws.server.EndpointAdapter
*/
public static final String ENDPOINT_ADAPTER_BEAN_NAME = "endpointAdapter";
@@ -76,10 +76,14 @@ public class MessageDispatcherServlet extends FrameworkServlet {
*/
public static final String ENDPOINT_MAPPING_BEAN_NAME = "endpointMapping";
/** Well-known name for the <code>WebServiceMessageFactory</code> object in the bean factory for this namespace. */
/**
* Well-known name for the <code>WebServiceMessageFactory</code> object in the bean factory for this namespace.
*/
public static final String WEB_SERVICE_MESSAGE_FACTORY_BEAN_NAME = "messageFactory";
/** Well-known name for the <code>MessageDispatcher</code> object in the bean factory for this namespace. */
/**
* Well-known name for the <code>MessageDispatcher</code> object in the bean factory for this namespace.
*/
public static final String MESSAGE_DISPATCHER_BEAN_NAME = "messageDispatcher";
/**
@@ -88,33 +92,51 @@ public class MessageDispatcherServlet extends FrameworkServlet {
*/
private static final String DEFAULT_STRATEGIES_PATH = "MessageDispatcherServlet.properties";
/** Suffix of a WSDL request uri. */
/**
* Suffix of a WSDL request uri.
*/
private static final String WSDL_SUFFIX_NAME = ".wsdl";
private static final Properties defaultStrategies = new Properties();
/** Detect all <code>EndpointAdapter</code>s or just expect "endpointAdapter" bean? */
/**
* Detect all <code>EndpointAdapter</code>s or just expect "endpointAdapter" bean?
*/
private boolean detectAllEndpointAdapters = true;
/** Detect all <code>EndpointExceptionResolver</code>s or just expect "endpointExceptionResolver" bean? */
/**
* Detect all <code>EndpointExceptionResolver</code>s or just expect "endpointExceptionResolver" bean?
*/
private boolean detectAllEndpointExceptionResolvers = true;
/** Detect all <code>EndpointMapping</code>s or just expect "endpointMapping" bean? */
/**
* Detect all <code>EndpointMapping</code>s or just expect "endpointMapping" bean?
*/
private boolean detectAllEndpointMappings = true;
/** Detect all <code>WsdlDefinition</code>s? */
/**
* Detect all <code>WsdlDefinition</code>s?
*/
private boolean detectAllWsdlDefinitions = true;
/** The <code>MessageEndpointHandlerAdapter</code> used by this servlet. */
/**
* The <code>MessageEndpointHandlerAdapter</code> used by this servlet.
*/
private MessageEndpointHandlerAdapter messageEndpointHandlerAdapter = new MessageEndpointHandlerAdapter();
/** The <code>WsdlDefinitionHandlerAdapter</code> used by this servlet. */
/**
* The <code>WsdlDefinitionHandlerAdapter</code> used by this servlet.
*/
private WsdlDefinitionHandlerAdapter wsdlDefinitionHandlerAdapter = new WsdlDefinitionHandlerAdapter();
/** The <code>MessageDispatcher</code> used by this servlet. */
/**
* The <code>MessageDispatcher</code> used by this servlet.
*/
private MessageDispatcher messageDispatcher;
/** Keys are beans names, values are <code>WsdlDefinition</code>s. */
/**
* Keys are beans names, values are <code>WsdlDefinition</code>s.
*/
private Map wsdlDefinitions;
static {
@@ -139,7 +161,9 @@ public class MessageDispatcherServlet extends FrameworkServlet {
public MessageDispatcherServlet() {
}
/** Returns the <code>MessageDispatcher</code> used by this servlet. */
/**
* Returns the <code>MessageDispatcher</code> used by this servlet.
*/
protected MessageDispatcher getMessageDispatcher() {
return messageDispatcher;
}
@@ -151,7 +175,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* Default is <code>true</code>. Turn this off if you want this servlet to use a single adapter, despite multiple
* adapter beans being defined in the context.
*
* @see org.springframework.ws.EndpointAdapter
* @see org.springframework.ws.server.EndpointAdapter
*/
public void setDetectAllEndpointAdapters(boolean detectAllEndpointAdapters) {
this.detectAllEndpointAdapters = detectAllEndpointAdapters;
@@ -164,7 +188,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* Default is <code>true</code>. Turn this off if you want this servlet to use a single exception resolver, despite
* multiple resolver beans being defined in the context.
*
* @see org.springframework.ws.EndpointExceptionResolver
* @see org.springframework.ws.server.EndpointExceptionResolver
*/
public void setDetectAllEndpointExceptionResolvers(boolean detectAllEndpointExceptionResolvers) {
this.detectAllEndpointExceptionResolvers = detectAllEndpointExceptionResolvers;
@@ -177,7 +201,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* Default is <code>true</code>. Turn this off if you want this servlet to use a single mapping, despite multiple
* mapping beans being defined in the context.
*
* @see org.springframework.ws.EndpointMapping
* @see org.springframework.ws.server.EndpointMapping
*/
public void setDetectAllEndpointMappings(boolean detectAllEndpointMappings) {
this.detectAllEndpointMappings = detectAllEndpointMappings;
@@ -298,7 +322,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* Initialize the <code>EndpointAdapters</code> used by this class. If no adapter beans are defined in the bean
* factory for this namespace, we default to the strategies in <code>MessageDispatcher</code>.
*
* @see org.springframework.ws.MessageDispatcher#initDefaultStrategies()
* @see org.springframework.ws.server.MessageDispatcher#initDefaultStrategies()
*/
private void initEndpointAdapters() throws BeansException {
if (detectAllEndpointAdapters) {
@@ -356,7 +380,7 @@ public class MessageDispatcherServlet extends FrameworkServlet {
* Initialize the <code>EndpointMappings</code> used by this class. If no mapping beans are defined in the
* BeanFactory for this namespace, we default to the strategies in <code>MessageDispatcher</code>.
*
* @see org.springframework.ws.MessageDispatcher#initDefaultStrategies()
* @see org.springframework.ws.server.MessageDispatcher#initDefaultStrategies()
*/
private void initEndpointMappings() throws BeansException {
if (detectAllEndpointMappings) {

View File

@@ -23,8 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.server.endpoint.MessageEndpoint;
import org.springframework.ws.transport.MessageReceiverObjectSupport;
import org.springframework.ws.transport.TransportInputStream;
import org.springframework.ws.transport.TransportOutputStream;
@@ -41,8 +40,8 @@ import org.springframework.ws.transport.TransportOutputStream;
* @author Arjen Poutsma
* @see #setMessageFactory(org.springframework.ws.WebServiceMessageFactory)
* @see org.springframework.ws.WebServiceMessageFactory
* @see org.springframework.ws.endpoint.MessageEndpoint
* @see org.springframework.ws.MessageDispatcher
* @see org.springframework.ws.server.endpoint.MessageEndpoint
* @see org.springframework.ws.server.MessageDispatcher
*/
public class MessageEndpointHandlerAdapter extends MessageReceiverObjectSupport implements HandlerAdapter {
@@ -83,7 +82,7 @@ public class MessageEndpointHandlerAdapter extends MessageReceiverObjectSupport
protected void handleResponse(TransportInputStream tis, TransportOutputStream tos, WebServiceMessage response)
throws Exception {
HttpServletResponse httpServletResponse = ((HttpServletTransportOutputStream) tos).getHttpServletResponse();
if (response instanceof SoapMessage && ((SoapMessage) response).getSoapBody().hasFault()) {
if (response.hasFault()) {
httpServletResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
else {

View File

@@ -1,5 +1,5 @@
# Default implementation classes for MessageDispatcher's strategy interfaces.
# Used as fallback when no matching beans are found in the MessageDispatcher context.
# Not meant to be customized by application developers
org.springframework.ws.EndpointAdapter=org.springframework.ws.endpoint.MessageEndpointAdapter,\
org.springframework.ws.endpoint.PayloadEndpointAdapter
org.springframework.ws.server.EndpointAdapter=org.springframework.ws.server.endpoint.MessageEndpointAdapter,\
org.springframework.ws.server.endpoint.PayloadEndpointAdapter

View File

@@ -2,6 +2,6 @@
# Used as fallback when no matching beans are found in the DispatcherServlet context.
# Not meant to be customized by application developers.
org.springframework.ws.MessageDispatcher=org.springframework.ws.soap.SoapMessageDispatcher
org.springframework.ws.server.MessageDispatcher=org.springframework.ws.soap.server.SoapMessageDispatcher
org.springframework.ws.WebServiceMessageFactory=org.springframework.ws.soap.saaj.SaajSoapMessageFactory

View File

@@ -75,6 +75,10 @@ public abstract class AbstractWebServiceMessageTestCase extends XMLTestCase {
XMLUnit.setIgnoreWhitespace(true);
}
public void testHasFault() throws Exception {
assertFalse("Mesage has fault", webServiceMessage.hasFault());
}
public void testDomPayload() throws Exception {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);

View File

@@ -46,6 +46,8 @@ public class MockWebServiceMessage implements WebServiceMessage {
private final StringBuffer content;
private boolean fault = false;
public MockWebServiceMessage() {
content = new StringBuffer();
}
@@ -100,6 +102,14 @@ public class MockWebServiceMessage implements WebServiceMessage {
return new StringSource(content.toString());
}
public boolean hasFault() {
return fault;
}
public void setFault(boolean fault) {
this.fault = fault;
}
public void writeTo(OutputStream outputStream) throws IOException {
PrintWriter writer = new PrintWriter(outputStream);
writer.write(content.toString());

View File

@@ -14,12 +14,14 @@
* limitations under the License.
*/
package org.springframework.ws;
package org.springframework.ws.server;
import java.util.Collections;
import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.ws.MockWebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;

View File

@@ -14,13 +14,12 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.stream.XMLEventReader;
@@ -32,24 +31,23 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.custommonkey.xmlunit.XMLTestCase;
import org.springframework.xml.transform.StaxSource;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import org.springframework.xml.transform.StaxSource;
public abstract class AbstractEndpointTestCase extends XMLTestCase {
protected final static String NAMESPACE_URI = "http://springframework.org/ws";
protected static final String NAMESPACE_URI = "http://springframework.org/ws";
protected final static String REQUEST_ELEMENT = "request";
protected static final String REQUEST_ELEMENT = "request";
protected final static String RESPONSE_ELEMENT = "response";
protected static final String RESPONSE_ELEMENT = "response";
protected final static String REQUEST = "<" + REQUEST_ELEMENT + " xmlns=\"" + NAMESPACE_URI + "\"/>";
protected static final String REQUEST = "<" + REQUEST_ELEMENT + " xmlns=\"" + NAMESPACE_URI + "\"/>";
protected final static String RESPONSE = "<" + RESPONSE_ELEMENT + " xmlns=\"" + NAMESPACE_URI + "\"/>";
protected static final String RESPONSE = "<" + RESPONSE_ELEMENT + " xmlns=\"" + NAMESPACE_URI + "\"/>";
public void testDomSource() throws Exception {
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.dom4j.Document;
import org.dom4j.Element;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import org.jdom.Element;
import org.jdom.Namespace;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.StringReader;
import java.io.StringWriter;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import junit.framework.TestCase;
import org.easymock.MockControl;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.io.StringReader;
import java.io.StringWriter;

View File

@@ -14,17 +14,16 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
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.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import org.springframework.xml.transform.StringSource;
public class SaxPayloadEndpointTest extends AbstractPayloadEndpointTestCase {
protected PayloadEndpoint createNoResponseEndpoint() throws Exception {

View File

@@ -14,10 +14,9 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import java.util.Collections;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventFactory;
import javax.xml.stream.XMLEventReader;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamConstants;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint;
package org.springframework.ws.server.endpoint;
import nu.xom.Element;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import junit.framework.TestCase;
import org.apache.log4j.AppenderSkeleton;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.interceptor;
package org.springframework.ws.server.endpoint.interceptor;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

View File

@@ -14,15 +14,15 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.ws.EndpointInterceptor;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.interceptor.EndpointInterceptorAdapter;
import org.springframework.ws.server.EndpointInterceptor;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.endpoint.interceptor.EndpointInterceptorAdapter;
public class EndpointMappingTest extends TestCase {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import java.util.Arrays;
import java.util.Map;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.endpoint.mapping;
package org.springframework.ws.server.endpoint.mapping;
import javax.xml.namespace.QName;

View File

@@ -18,12 +18,12 @@ package org.springframework.ws.soap.endpoint.mapping;
import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.ws.EndpointInvocationChain;
import org.springframework.ws.EndpointMapping;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapEndpointInvocationChain;
import org.springframework.ws.server.EndpointInvocationChain;
import org.springframework.ws.server.EndpointMapping;
import org.springframework.ws.soap.server.SoapEndpointInvocationChain;
public class DelegatingSoapEndpointMappingTest extends TestCase {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.ws.soap;
package org.springframework.ws.soap.server;
import java.util.Iterator;
import java.util.Locale;
@@ -28,6 +28,11 @@ import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.ws.context.DefaultMessageContext;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapEndpointInterceptor;
import org.springframework.ws.soap.SoapHeader;
import org.springframework.ws.soap.SoapHeaderElement;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessage;
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
import org.springframework.ws.soap.soap11.Soap11Fault;

View File

@@ -17,9 +17,9 @@ import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletConfig;
import org.springframework.mock.web.MockServletContext;
import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.ws.MessageDispatcher;
import org.springframework.ws.endpoint.PayloadEndpointAdapter;
import org.springframework.ws.endpoint.mapping.PayloadRootQNameEndpointMapping;
import org.springframework.ws.server.MessageDispatcher;
import org.springframework.ws.server.endpoint.PayloadEndpointAdapter;
import org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping;
import org.springframework.ws.soap.endpoint.SimpleSoapExceptionResolver;
import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
import org.w3c.dom.Document;

View File

@@ -24,11 +24,10 @@ import org.easymock.MockControl;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.ws.NoEndpointFoundException;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.soap.SoapBody;
import org.springframework.ws.soap.SoapMessage;
import org.springframework.ws.server.endpoint.MessageEndpoint;
public class MessageEndpointHandlerAdapterTest extends TestCase {
@@ -50,13 +49,9 @@ public class MessageEndpointHandlerAdapterTest extends TestCase {
private MockControl messageControl;
private SoapMessage responseMock;
private WebServiceMessage responseMock;
private MockControl bodyControl;
private SoapBody bodyMock;
private SoapMessage requestMock;
private WebServiceMessage requestMock;
protected void setUp() throws Exception {
adapter = new MessageEndpointHandlerAdapter();
@@ -65,11 +60,9 @@ public class MessageEndpointHandlerAdapterTest extends TestCase {
factoryControl = MockControl.createControl(WebServiceMessageFactory.class);
factoryMock = (WebServiceMessageFactory) factoryControl.getMock();
adapter.setMessageFactory(factoryMock);
messageControl = MockControl.createControl(SoapMessage.class);
requestMock = (SoapMessage) messageControl.getMock();
responseMock = (SoapMessage) messageControl.getMock();
bodyControl = MockControl.createControl(SoapBody.class);
bodyMock = (SoapBody) bodyControl.getMock();
messageControl = MockControl.createControl(WebServiceMessage.class);
requestMock = (WebServiceMessage) messageControl.getMock();
responseMock = (WebServiceMessage) messageControl.getMock();
}
public void testHandleNonPost() throws Exception {
@@ -122,8 +115,7 @@ public class MessageEndpointHandlerAdapterTest extends TestCase {
factoryControl.setMatcher(MockControl.ALWAYS_MATCHER);
factoryControl.setReturnValue(requestMock);
factoryControl.expectAndReturn(factoryMock.createWebServiceMessage(), responseMock);
messageControl.expectAndReturn(responseMock.getSoapBody(), bodyMock);
bodyControl.expectAndReturn(bodyMock.hasFault(), false);
messageControl.expectAndReturn(responseMock.hasFault(), false);
responseMock.writeTo(new HttpServletTransportOutputStream(httpResponse));
messageControl.setMatcher(MockControl.ALWAYS_MATCHER);
@@ -150,8 +142,7 @@ public class MessageEndpointHandlerAdapterTest extends TestCase {
factoryControl.setMatcher(MockControl.ALWAYS_MATCHER);
factoryControl.setReturnValue(requestMock);
factoryControl.expectAndReturn(factoryMock.createWebServiceMessage(), responseMock);
messageControl.expectAndReturn(responseMock.getSoapBody(), bodyMock);
bodyControl.expectAndReturn(bodyMock.hasFault(), true);
messageControl.expectAndReturn(responseMock.hasFault(), true);
responseMock.writeTo(new HttpServletTransportOutputStream(httpResponse));
messageControl.setMatcher(MockControl.ALWAYS_MATCHER);
@@ -198,13 +189,11 @@ public class MessageEndpointHandlerAdapterTest extends TestCase {
private void replayMockControls() {
factoryControl.replay();
messageControl.replay();
bodyControl.replay();
}
private void verifyMockControls() {
factoryControl.verify();
messageControl.verify();
bodyControl.verify();
}
}

View File

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.jms.support.JmsUtils;
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.server.endpoint.MessageEndpoint;
import org.springframework.ws.transport.MessageReceiverObjectSupport;
import org.springframework.ws.transport.TransportInputStream;
import org.springframework.ws.transport.TransportOutputStream;

View File

@@ -34,7 +34,7 @@ import org.springframework.jms.listener.SessionAwareMessageListener;
*
* @author Arjen Poutsma
* @see #setMessageFactory(org.springframework.ws.WebServiceMessageFactory)
* @see #setMessageEndpoint(org.springframework.ws.endpoint.MessageEndpoint)
* @see #setMessageEndpoint(org.springframework.ws.server.endpoint.MessageEndpoint)
*/
public class MessageEndpointMessageListener extends JmsMessageReceiverObjectSupport
implements SessionAwareMessageListener {

View File

@@ -31,7 +31,7 @@ import org.codehaus.activemq.message.ActiveMQTopic;
import org.easymock.MockControl;
import org.springframework.ws.MockWebServiceMessageFactory;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.endpoint.MessageEndpoint;
import org.springframework.ws.server.endpoint.MessageEndpoint;
public class MessageEndpointMessageListenerTest extends TestCase {