Moved TransportObjectSupport to xml module.
This commit is contained in:
@@ -21,8 +21,8 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.ws.WebServiceMessageFactory;
|
||||
import org.springframework.ws.context.DefaultMessageContext;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.endpoint.TransformerObjectSupport;
|
||||
import org.springframework.ws.transport.WebServiceMessageSender;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Base class for <code>WebServiceTemplate</code> and other WS-accessing helpers. Defines common properties like the
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.io.DocumentResult;
|
||||
import org.dom4j.io.DocumentSource;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Abstract base class for endpoints that handle the message payload as dom4j elements. Offers the message payload as a
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
@@ -36,7 +37,7 @@ import org.w3c.dom.Element;
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Alef Arendsen
|
||||
* @see #invokeInternal(org.w3c.dom.Element, org.w3c.dom.Document)
|
||||
* @see #invokeInternal(org.w3c.dom.Element,org.w3c.dom.Document)
|
||||
*/
|
||||
public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSupport implements PayloadEndpoint {
|
||||
|
||||
@@ -103,8 +104,8 @@ public abstract class AbstractDomPayloadEndpoint extends TransformerObjectSuppor
|
||||
*/
|
||||
protected DocumentBuilderFactory createDocumentBuilderFactory() throws ParserConfigurationException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setValidating(this.validating);
|
||||
factory.setNamespaceAware(this.namespaceAware);
|
||||
factory.setValidating(validating);
|
||||
factory.setNamespaceAware(namespaceAware);
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import javax.xml.transform.Transformer;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.transform.JDOMResult;
|
||||
import org.jdom.transform.JDOMSource;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Abstract base class for endpoints that handle the message payload as JDOM elements. Offers the message payload as a
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.ws.endpoint;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
@@ -28,6 +27,7 @@ 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.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Abstract base class for <code>EndpointInterceptor</code> instances that log a part of a
|
||||
|
||||
@@ -20,6 +20,7 @@ import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
import org.xml.sax.ContentHandler;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,8 @@ package org.springframework.ws.endpoint;
|
||||
import javax.xml.stream.XMLInputFactory;
|
||||
import javax.xml.stream.XMLOutputFactory;
|
||||
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Abstract base class for endpoints use StAX. Provides an <code>XMLInputFactory</code> and an
|
||||
* <code>XMLOutputFactory</code>.
|
||||
|
||||
@@ -22,6 +22,7 @@ import javax.xml.transform.Transformer;
|
||||
import org.springframework.ws.EndpointAdapter;
|
||||
import org.springframework.ws.WebServiceMessage;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
|
||||
/**
|
||||
* Adapter to use a <code>PayloadEndpoint</code> as the endpoint for a <code>EndpointInvocationChain</code>.
|
||||
|
||||
@@ -32,13 +32,13 @@ 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.endpoint.TransformerObjectSupport;
|
||||
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;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
import org.springframework.xml.validation.XmlValidator;
|
||||
import org.springframework.xml.validation.XmlValidatorFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
@@ -34,8 +34,8 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.servlet.HandlerAdapter;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.ws.endpoint.TransformerObjectSupport;
|
||||
import org.springframework.ws.wsdl.WsdlDefinition;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
import org.springframework.xml.xpath.XPathExpression;
|
||||
import org.springframework.xml.xpath.XPathExpressionFactory;
|
||||
import org.w3c.dom.Attr;
|
||||
@@ -69,7 +69,7 @@ import org.w3c.dom.Node;
|
||||
* @see WsdlDefinition
|
||||
* @see #setTransformLocations(boolean)
|
||||
* @see #setLocationExpression(String)
|
||||
* @see #transformLocation(String, javax.servlet.http.HttpServletRequest)
|
||||
* @see #transformLocation(String,javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
public class WsdlDefinitionHandlerAdapter extends TransformerObjectSupport implements HandlerAdapter, InitializingBean {
|
||||
|
||||
@@ -161,18 +161,14 @@ public class WsdlDefinitionHandlerAdapter extends TransformerObjectSupport imple
|
||||
try {
|
||||
if (location.startsWith("/")) {
|
||||
// a relative path, prepend the context path
|
||||
URL newLocation = new URL(request.getScheme(),
|
||||
request.getServerName(),
|
||||
request.getServerPort(),
|
||||
URL newLocation = new URL(request.getScheme(), request.getServerName(), request.getServerPort(),
|
||||
request.getContextPath() + location);
|
||||
return newLocation.toString();
|
||||
}
|
||||
else {
|
||||
// a full url
|
||||
URL oldLocation = new URL(location);
|
||||
URL newLocation = new URL(request.getScheme(),
|
||||
request.getServerName(),
|
||||
request.getServerPort(),
|
||||
URL newLocation = new URL(request.getScheme(), request.getServerName(), request.getServerPort(),
|
||||
oldLocation.getFile());
|
||||
return newLocation.toString();
|
||||
}
|
||||
@@ -192,7 +188,7 @@ public class WsdlDefinitionHandlerAdapter extends TransformerObjectSupport imple
|
||||
*
|
||||
* @see #setLocationExpression(String)
|
||||
* @see #setTransformLocations(boolean)
|
||||
* @see #transformLocation(String, javax.servlet.http.HttpServletRequest)
|
||||
* @see #transformLocation(String,javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
protected void transformLocations(Document definitionDocument, HttpServletRequest request) throws Exception {
|
||||
Node[] locationNodes = locationXPathExpression.evaluateAsNodes(definitionDocument);
|
||||
|
||||
@@ -14,20 +14,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.endpoint;
|
||||
package org.springframework.xml.transform;
|
||||
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerFactoryConfigurationError;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Convenient base class for objects that use a <code>Transformer</code>. Subclasses can call
|
||||
* <code>createTransformer</code> to obtain a transformer. This should be done per incoming request, because
|
||||
* <code>Transformer</code> instances are not thread-safe.
|
||||
* <code>createTransformer</code> to obtain a transformer. This should be done per thread (i.e. per incoming request),
|
||||
* because <code>Transformer</code> instances are not thread-safe.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see Transformer
|
||||
Reference in New Issue
Block a user