JBossWS SVN: r2285 - trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-02-05 21:14:22 -0500 (Mon, 05 Feb 2007)
New Revision: 2285
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java
Log:
Add missing debug attribute
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java 2007-02-05 22:13:19 UTC (rev 2284)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/ant/WSGenerate.java 2007-02-06 02:14:22 UTC (rev 2285)
@@ -89,7 +89,14 @@
private boolean genwsdl = false;
private boolean verbose = false;
private boolean fork = false;
+ private boolean debug = false;
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
public void setClasspath(Path classpath)
{
this.classpath = classpath;
17 years, 3 months
JBossWS SVN: r2284 - in branches/hbraun/1.2.0: jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-05 17:13:19 -0500 (Mon, 05 Feb 2007)
New Revision: 2284
Added:
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/DOMContent.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContent.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java
branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java
Modified:
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderPayload.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
Log:
Source and Result are used towards the binding layer. Cleaned up SOAPContentElement transitions
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -23,47 +23,31 @@
// $Id$
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.JAXRPCException;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.rpc.soap.SOAPFaultException;
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.jaxrpc.binding.*;
+import org.jboss.ws.core.soap.*;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.JAXRPCException;
+import javax.xml.rpc.encoding.TypeMapping;
+import javax.xml.rpc.soap.SOAPFaultException;
+import javax.xml.soap.*;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
/**
* A Helper that translates between SOAPFaultException and SOAPFault.
*
@@ -139,7 +123,7 @@
deElement.addNamespaceDeclaration(prefix, nsURI);
}
- String xmlFragment = DOMWriter.printNode(deElement, false);
+ Source xmlFragment = new DOMSource(deElement);
DeserializerSupport des = (DeserializerSupport)desFactory.getDeserializer();
Object userEx = des.deserialize(xmlName, xmlType, xmlFragment, serContext);
if (userEx == null || (userEx instanceof Exception) == false)
@@ -260,10 +244,11 @@
try
{
SerializerSupport ser = (SerializerSupport)serFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, faultCause, serContext, null);
+ Result result = ser.serialize(xmlName, xmlType, faultCause, serContext, null);
+ XMLFragment xmlFragment = new XMLFragment(result);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- Element domElement = DOMUtils.parse(xmlFragment);
+ Element domElement = DOMUtils.parse(xmlFragment.toStringFragment());
SOAPElement soapElement = soapFactory.createElement(domElement);
detail = soapFault.addDetail();
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Deserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,7 @@
import java.io.IOException;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -45,13 +46,17 @@
{
// provide logging
private static final Logger log = Logger.getLogger(Base64Deserializer.class);
-
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
-
+
byte[] value = null;
-
+
String valueStr = unwrapValueStr(xmlFragment);
if(XOPContext.isXOPMessage())
{
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/Base64Serializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,8 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.JavaUtils;
@@ -46,7 +48,7 @@
// provide logging
private static final Logger log = Logger.getLogger(Base64Serializer.class);
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -68,6 +70,6 @@
String valueStr = SimpleTypeBindings.marshalBase64((byte[])value);
xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes, true);
}
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,7 @@
import java.util.Calendar;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.SimpleTypeBindings;
@@ -40,7 +41,11 @@
// provide logging
private static final Logger log = Logger.getLogger(CalendarDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/CalendarSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,8 @@
import java.util.Calendar;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -42,7 +44,7 @@
// provide logging
private static final Logger log = Logger.getLogger(CalendarSerializer.class);
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -50,6 +52,7 @@
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
+
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -27,6 +27,7 @@
import java.util.Date;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.SimpleTypeBindings;
@@ -40,7 +41,11 @@
// provide logging
private static final Logger log = Logger.getLogger(DateDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DateSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -28,6 +28,8 @@
import java.util.GregorianCalendar;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -46,7 +48,7 @@
// provide logging
private static final Logger log = Logger.getLogger(DateSerializer.class);
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
if (value != null)
@@ -60,6 +62,6 @@
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/DeserializerSupport.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -25,10 +25,17 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.Deserializer;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.stream.StreamResult;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.utils.XMLPredefinedEntityReferenceResolver;
+import org.jboss.ws.WSException;
+import java.io.ByteArrayOutputStream;
+
/** The base class for all Deserializers.
*
* @author Thomas.Diesler(a)jboss.org
@@ -44,8 +51,30 @@
* @param xmlFragment The XML fragment to deserialize
* @param serContext The serialization context
*/
- public abstract Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException;
+ public abstract Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException;
+ protected static String sourceToString(Source source)
+ {
+ String xmlFragment = null;
+
+ try {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ StreamResult streamResult = new StreamResult(baos);
+ tf.newTransformer().transform(source, streamResult);
+ xmlFragment = new String(baos.toByteArray());
+ if (xmlFragment.startsWith("<?xml"))
+ {
+ int index = xmlFragment.indexOf(">");
+ xmlFragment = xmlFragment.substring(index + 1);
+ }
+ } catch (TransformerException e) {
+ WSException.rethrow(e);
+ }
+
+ return xmlFragment;
+ }
+
/** Unwrap the value string from the XML fragment
*
* @return The value string or null if the startTag contains a xsi:nil='true' attribute
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,7 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.DOMUtils;
@@ -39,14 +40,19 @@
{
// provide logging
private static final Logger log = Logger.getLogger(ElementDeserializer.class);
-
+
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
/** Deserialize the given simple xmlString
*/
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
try
{
+ // TODO: Better way for DOM to source conversion
Element domElement = DOMUtils.parse(xmlFragment);
return domElement;
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/ElementSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,8 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.DOMWriter;
@@ -47,7 +49,7 @@
* @param serContext
* @return the string representation od the value
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes)
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes)
throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -57,6 +59,6 @@
throw new IllegalArgumentException("Value is not a Element: " + value.getClass().getName());
String xmlFragment = DOMWriter.printNode((Element)value, false);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,7 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.SimpleTypeBindings;
@@ -40,7 +41,11 @@
// provide logging
private static final Logger log = Logger.getLogger(HexDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/HexSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,8 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.JavaUtils;
@@ -43,7 +45,7 @@
// provide logging
private static final Logger log = Logger.getLogger(HexSerializer.class);
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -52,6 +54,6 @@
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,7 @@
import java.io.ByteArrayInputStream;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
@@ -33,6 +34,7 @@
import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBConstants;
import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshaller;
import org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl;
+import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
/**
@@ -54,6 +56,10 @@
unmarshaller = new JBossXBUnmarshallerImpl();
}
+ public Object deserialize(QName xmlName, QName xmlType, Source source, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(source), serContext);
+ }
+
/**
* For unmarshalling the WS layer passes to the JAXB layer
*
@@ -68,7 +74,7 @@
* The result is an object instance or null.
* In case of an unmarshalling problem a descriptive exception is thrown.
*/
- public Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext) throws BindingException
+ private Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/JBossXBSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,8 @@
import java.io.StringWriter;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
@@ -71,7 +73,7 @@
* The result is a self contained (i.e. contains all namespace definitions) XML document without the XML declaration.
* In case of an marshalling problem a descriptive exception is thrown.
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -101,7 +103,7 @@
String xmlFragment = strwr.toString();
log.debug("serialized: " + xmlFragment);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
catch (RuntimeException rte)
{
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/NullValueSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,8 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
@@ -53,13 +55,13 @@
* it is possible that the element definition does not allow
* null values. In that case an error should be generated.
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
nsRegistry.registerURI(Constants.NS_SCHEMA_XSI, Constants.PREFIX_XSI);
String xmlFragment = wrapValueStr(xmlName, null, nsRegistry, null, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,6 +26,7 @@
import java.io.IOException;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.DOMUtils;
@@ -44,7 +45,11 @@
// provide logging
private static final Logger log = Logger.getLogger(QNameDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/QNameSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -27,6 +27,8 @@
import java.util.Set;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.NamespaceRegistry;
@@ -44,7 +46,7 @@
// provide logging
private static final Logger log = Logger.getLogger(QNameSerializer.class);
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -66,6 +68,6 @@
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, additionalNamespaces, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArrayDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -29,6 +29,8 @@
import java.util.StringTokenizer;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
@@ -57,9 +59,13 @@
{
}
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
/**
*/
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
try
@@ -137,7 +143,7 @@
if (it.hasNext())
{
Element childElement = (Element)it.next();
- String compXMLFragment = DOMWriter.printNode(childElement, false);
+ Source compXMLFragment = new DOMSource(childElement);
compValue = compDeserializer.deserialize(compXmlName, compXmlType, compXMLFragment, serContext);
compValue = JavaUtils.getWrapperValueArray(compValue);
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -23,16 +23,18 @@
// $Id$
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.core.utils.JavaUtils;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.w3c.dom.NamedNodeMap;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+
/**
* A Serializer that can handle SOAP encoded arrays.
*
@@ -48,7 +50,7 @@
private NullValueSerializer nullSerializer;
private boolean isArrayComponentType;
private boolean xsiNamespaceInserted;
- private StringBuilder xmlFragment;
+ private StringBuilder buffer;
public SOAPArraySerializer() throws BindingException
{
@@ -57,7 +59,7 @@
/**
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + ",valueType=" + value.getClass().getName() + "]");
try
@@ -103,7 +105,7 @@
if (JavaUtils.isPrimitive(value.getClass()))
value = JavaUtils.getWrapperValueArray(value);
- xmlFragment = new StringBuilder("<" + Constants.PREFIX_SOAP11_ENC + ":Array ");
+ buffer = new StringBuilder("<" + Constants.PREFIX_SOAP11_ENC + ":Array ");
if (value instanceof Object[])
{
Object[] objArr = (Object[])value;
@@ -120,7 +122,7 @@
compXmlType = serContext.getNamespaceRegistry().registerQName(compXmlType);
String arrayType = Constants.PREFIX_SOAP11_ENC + ":arrayType='" + compXmlType.getPrefix() + ":" + compXmlType.getLocalPart() + "[" + arrayDim + "]'";
String compns = " xmlns:" + compXmlType.getPrefix() + "='" + compXmlType.getNamespaceURI() + "'";
- xmlFragment.append(arrayType + compns + ">");
+ buffer.append(arrayType + compns + ">");
serializeArrayComponents(compXmlName, compXmlType, serContext, objArr);
}
@@ -128,10 +130,10 @@
{
throw new WSException("Unsupported array type: " + javaType);
}
- xmlFragment.append("</" + Constants.PREFIX_SOAP11_ENC + ":Array>");
+ buffer.append("</" + Constants.PREFIX_SOAP11_ENC + ":Array>");
- log.debug("serialized: " + xmlFragment);
- return xmlFragment.toString();
+ log.debug("serialized: " + buffer);
+ return stringToResult(buffer.toString());
}
catch (RuntimeException e)
{
@@ -163,12 +165,13 @@
{
xsiNamespaceInserted = true;
int insIndex = ("<" + Constants.PREFIX_SOAP11_ENC + ":Array ").length();
- xmlFragment.insert(insIndex, "xmlns:" + Constants.PREFIX_XSI + "='" + Constants.NS_SCHEMA_XSI + "' ");
+ buffer.insert(insIndex, "xmlns:" + Constants.PREFIX_XSI + "='" + Constants.NS_SCHEMA_XSI + "' ");
}
}
- String compFragment = ser.serialize(compXmlName, compXmlType, compValue, serContext, null);
- xmlFragment.append(compFragment);
+ Result result = ser.serialize(compXmlName, compXmlType, compValue, serContext, null);
+ XMLFragment fragment = new XMLFragment(result);
+ buffer.append(fragment.toStringFragment());
}
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
@@ -42,11 +43,16 @@
// provide logging
private static final Logger log = Logger.getLogger(SOAPElementDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
try
{
+ // TODO: Better way for DOM to source conversion
Element domElement = DOMUtils.parse(xmlFragment);
SOAPElement soapElement = new SOAPFactoryImpl().createElement(domElement);
return soapElement;
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.ws.core.utils.DOMWriter;
@@ -47,7 +48,7 @@
* @param serContext
* @return the string representation od the value
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
if (value == null)
@@ -56,6 +57,6 @@
throw new IllegalArgumentException("Value is not a SOAPElement: " + value.getClass().getName());
String xmlFragment = DOMWriter.printNode((SOAPElement)value, false);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SerializerSupport.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,12 +24,23 @@
// $Id$
import java.util.Set;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.Serializer;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamResult;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -52,8 +63,19 @@
* @param attributes TODO
* @param attributes The attributes on this element
*/
- public abstract String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException;
+ public abstract Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException;
+ protected Result stringToResult(String xmlFragment) {
+ Result result = null;
+ try {
+ result = new DOMResult( DOMUtils.parse(xmlFragment));
+ } catch (IOException e) {
+ WSException.rethrow(e);
+ }
+
+ return result;
+ }
+
/** Wrap the value string in a XML fragment with the given name
*/
protected String wrapValueStr(QName xmlName, String valueStr, NamespaceRegistry nsRegistry, Set<String> additionalNamespaces, NamedNodeMap attributes, boolean normalize)
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,7 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.SimpleTypeBindings;
@@ -39,7 +40,11 @@
// provide logging
private static final Logger log = Logger.getLogger(SimpleDeserializer.class);
- public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException {
+ return deserialize(xmlName, xmlType, sourceToString(xmlFragment), serContext);
+ }
+
+ private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -24,6 +24,8 @@
// $Id$
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
@@ -48,7 +50,7 @@
* @param serContext
* @return the string representation od the value
*/
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -66,6 +68,6 @@
}
String xmlFragment = wrapValueStr(xmlName, valueStr, nsRegistry, null, attributes, true);
- return xmlFragment;
+ return stringToResult(xmlFragment);
}
}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -23,23 +23,21 @@
// $Id$
-import java.io.ByteArrayInputStream;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.jaxrpc.binding.ComplexTypeDeserializer;
+import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
+import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.Source;
import javax.xml.ws.WebServiceException;
-import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.ComplexTypeDeserializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
-
/**
* A Deserializer that can handle complex types by delegating to JAXB.
*
@@ -55,8 +53,7 @@
{
}
- @Override
- public Object deserialize(QName xmlName, QName xmlType, String val, SerializationContext serContext)
+ public Object deserialize(QName xmlName, QName xmlType, Source xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
@@ -73,9 +70,8 @@
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
unmarshaller.setAttachmentUnmarshaller( new AttachmentUnmarshallerImpl());
-
- ByteArrayInputStream ins = new ByteArrayInputStream(val.getBytes("UTF-8"));
- JAXBElement jbe = unmarshaller.unmarshal(new StreamSource(ins), javaType);
+
+ JAXBElement jbe = unmarshaller.unmarshal(xmlFragment, javaType);
value = jbe.getValue();
log.debug("deserialized: " + (value != null ? value.getClass().getName() : null));
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -31,6 +31,9 @@
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceException;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMResult;
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
@@ -57,11 +60,11 @@
}
@Override
- public String serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
+ public Result serialize(QName xmlName, QName xmlType, Object value, SerializationContext serContext, NamedNodeMap attributes) throws BindingException
{
log.debug("serialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
- String xmlFragment = null;
+ DOMResult result = null;
try
{
// It needs to be a valid JAXB type
@@ -76,17 +79,17 @@
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
marshaller.setAttachmentMarshaller(new AttachmentMarshallerImpl());
- StringWriter strwr = new StringWriter();
- marshaller.marshal(new JAXBElement(xmlName, javaType, value), strwr);
- xmlFragment = strwr.toString();
+ result = new DOMResult();
+ marshaller.marshal(new JAXBElement(xmlName, javaType, value), result);
- log.debug("serialized: " + xmlFragment);
+ log.debug("serialized: " + result);
}
catch (Exception ex)
{
handleMarshallException(ex);
}
- return xmlFragment;
+
+ return result;
}
// 4.21 Conformance (Marshalling failure): If an error occurs when using the supplied JAXBContext to marshall
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -14,42 +14,31 @@
*/
package org.jboss.ws.core.jaxws;
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.encoding.TypeMapping;
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.soap.SOAPFaultException;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
+import org.jboss.ws.core.jaxrpc.binding.*;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.w3c.dom.Element;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.encoding.TypeMapping;
+import javax.xml.soap.*;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.io.IOException;
+import java.util.Iterator;
+
/**
* Helper methods to translate between SOAPFault and SOAPFaultException
* as well as between Exception and SOAPMessage containing a fault.
@@ -118,9 +107,9 @@
Class[] types = opMetaData.getEndpointMetaData().getRegisteredTypes().toArray(new Class[0]);
serContext.setProperty(SerializationContext.CONTEXT_TYPES, types);
- String xmlFragment = DOMWriter.printNode(deElement, false);
+ Source source = new DOMSource(deElement);
DeserializerSupport des = (DeserializerSupport)desFactory.getDeserializer();
- Object faultBean = des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Object faultBean = des.deserialize(xmlName, xmlType, source, serContext);
Exception serviceEx = faultMetaData.toServiceException(faultBean, soapFault.getFaultString());
faultEx.initCause(serviceEx);
@@ -315,10 +304,11 @@
try
{
SerializerSupport ser = serFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, faultObject, serContext, null);
+ Result result = ser.serialize(xmlName, xmlType, faultObject, serContext, null);
+ XMLFragment fragment = new XMLFragment(result);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- Element domElement = DOMUtils.parse(xmlFragment);
+ Element domElement = DOMUtils.parse(fragment.toStringFragment());
return soapFactory.createElement(domElement);
}
catch (BindingException e)
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/DOMContent.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/DOMContent.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/DOMContent.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.logging.Logger;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public class DOMContent extends SOAPContent {
+
+ private static Logger log = Logger.getLogger(ObjectContent.class);
+
+ private Source payload;
+
+ protected DOMContent(SOAPContentElement container) {
+ super(container);
+ }
+
+ State getState() {
+ return State.DOM_VALID;
+ }
+
+ SOAPContent transitionTo(State nextState) {
+
+ SOAPContent next = null;
+
+ if(State.XML_VALID == nextState)
+ {
+ log.debug("getXMLFragment from DOM");
+ DOMSource domSource = new DOMSource(container);
+ XMLFragment fragment = new XMLFragment(domSource);
+ log.debug("xmlFragment: " + fragment);
+
+ SOAPContent xmlValid = new XMLContent(container);
+ xmlValid.setXMLFragment(fragment);
+ next = xmlValid;
+ }
+ else if(State.OBJECT_VALID == nextState)
+ {
+ // transition to xml valid first
+ XMLFragment fragment = new XMLFragment(new DOMSource(container));
+ XMLContent tmpState = new XMLContent(container);
+ tmpState.setXMLFragment(fragment);
+
+ // and from XML valid to Object valid
+ next = tmpState.transitionTo(State.OBJECT_VALID);
+
+ }
+ else if(State.DOM_VALID == nextState)
+ {
+ next = this;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Illegal state requested: " + nextState);
+ }
+
+ return next;
+ }
+
+ public Source getPayload() {
+ return new DOMSource(container);
+ }
+
+ public void setPayload(Source source) {
+ this.payload = source;
+ }
+
+ public XMLFragment getXMLFragment() {
+ throw new IllegalStateException("XMLFragment not available");
+ }
+
+ public void setXMLFragment(XMLFragment xmlFragment) {
+ throw new IllegalStateException("XMLFragment not available");
+ }
+
+ public Object getObjectValue() {
+ throw new IllegalStateException("Object value not available");
+ }
+
+ public void setObjectValue(Object objValue) {
+ throw new IllegalStateException("Object value not available");
+ }
+}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -22,27 +22,19 @@
package org.jboss.ws.core.soap;
//$Id$
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Detail;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.*;
+import javax.xml.transform.dom.DOMSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
/**
* A SOAPEnvelope builder for JAXRPC based on DOM
*
@@ -108,7 +100,7 @@
{
Element srcElement = (Element)it.next();
//registerNamespacesLocally(srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false);
+ XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
@@ -202,7 +194,7 @@
DOMUtils.copyAttributes(destElement, srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false);
+ XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
destElement.setXMLFragment(xmlFragment);
}
}
@@ -215,7 +207,7 @@
DOMUtils.copyAttributes(destElement, srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false);
+ XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
destElement.setXMLFragment(xmlFragment);
}
else if (style == null)
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderPayload.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderPayload.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderPayload.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -85,7 +85,7 @@
while (it.hasNext())
{
Element srcElement = (Element)it.next();
- String xmlFragment = DOMWriter.printNode(srcElement, false);
+ XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.ByteArrayInputStream;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
@@ -37,6 +38,7 @@
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Element;
@@ -216,25 +218,30 @@
{
SOAPHeader soapHeader = soapEnv.getHeader();
SOAPContentElement lastHeaderElement = (SOAPContentElement)soapHeader.getChildNodes().item(soapHeader.getChildNodes().getLength() - 1);
-
- lastHeaderElement.setXMLFragment(fragmentBuffer.toString());
+ lastHeaderElement.setXMLFragment(bufferToFragment(fragmentBuffer));
}
else if (Part.BODY == currentPart)
{
SOAPBody soapBody = soapEnv.getBody();
SOAPContentElement lastBodyElement = (SOAPContentElement)soapBody.getChildNodes().item(soapBody.getChildNodes().getLength() - 1);
- lastBodyElement.setXMLFragment(fragmentBuffer.toString());
+ lastBodyElement.setXMLFragment(bufferToFragment(fragmentBuffer));
}
else if (Part.FAULT == currentPart)
{
SOAPBody soapBody = soapEnv.getBody();
SOAPContentElement faultElement = (SOAPContentElement)soapBody.getFault();
- faultElement.setXMLFragment(fragmentBuffer.toString());
+ faultElement.setXMLFragment(bufferToFragment(fragmentBuffer));
}
resetFragmentBuffer();
}
+ // TODO: this is rubbish. Use Source internally instead...
+ private XMLFragment bufferToFragment(StringBuffer fragmentBuffer) {
+ StreamSource source = new StreamSource(new ByteArrayInputStream(fragmentBuffer.toString().getBytes()));
+ return new XMLFragment(source);
+ }
+
private void processStartElement() throws SOAPException
{
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.jaxrpc.binding.*;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.logging.Logger;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
+import javax.xml.namespace.QName;
+import java.lang.reflect.Method;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public class ObjectContent extends SOAPContent {
+
+ private static Logger log = Logger.getLogger(ObjectContent.class);
+
+ // The java object content of this element.
+ private Object objectValue;
+
+ protected ObjectContent(SOAPContentElement container) {
+ super(container);
+ }
+
+ State getState() {
+ return State.OBJECT_VALID;
+ }
+
+ SOAPContent transitionTo(State nextState) {
+
+ SOAPContent next = null;
+
+ if(State.XML_VALID == nextState)
+ {
+ XMLFragment fragment = marshallObjectContents();
+ XMLContent xmlValid = new XMLContent(container);
+ xmlValid.setXMLFragment(fragment);
+ next = xmlValid;
+ }
+ else if(State.OBJECT_VALID == nextState)
+ {
+ next = this;
+ }
+ else if(State.DOM_VALID == nextState)
+ {
+ // first transition to XML valid
+ XMLFragment fragment = marshallObjectContents();
+ XMLContent tmp = new XMLContent(container);
+ tmp.setXMLFragment(fragment);
+
+ // finally from XML valid to DOM valid
+ next = tmp.transitionTo(State.DOM_VALID);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Illegal state requested: " + nextState);
+ }
+
+ return next;
+ }
+
+ public Source getPayload() {
+ throw new IllegalStateException("Payload not available");
+ }
+
+ public void setPayload(Source source) {
+ throw new IllegalStateException("Payload not available");
+ }
+
+ public XMLFragment getXMLFragment() {
+
+ throw new IllegalStateException("XMLFragment not available");
+ }
+
+ public void setXMLFragment(XMLFragment xmlFragment) {
+ throw new IllegalStateException("XMLFragment not available");
+ }
+
+ public Object getObjectValue() {
+ return objectValue;
+ }
+
+ public void setObjectValue(Object objValue) {
+ this.objectValue = objValue;
+ }
+
+ private XMLFragment marshallObjectContents()
+ {
+ QName xmlType = container.getXmlType();
+ Class javaType = container.getJavaType();
+ QName xmlName = container.getElementQName();
+
+ log.debug("getXMLFragment from Object [xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ SerializationContext serContext = msgContext.getSerializationContext();
+ serContext.setProperty(ParameterMetaData.class.getName(), container.getParamMetaData());
+
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ XMLFragment xmlFragment = null;
+ try
+ {
+ SerializerSupport ser;
+ if (objectValue != null)
+ {
+ SerializerFactoryBase serializerFactory = getSerializerFactory(typeMapping, javaType, xmlType);
+ ser = (SerializerSupport)serializerFactory.getSerializer();
+ }
+ else
+ {
+ ser = new NullValueSerializer();
+ }
+
+ Result result = ser.serialize(xmlName, xmlType, getObjectValue(), serContext, null);
+ xmlFragment = new XMLFragment(result);
+ log.debug("xmlFragment: " + xmlFragment);
+ }
+ catch (BindingException e)
+ {
+ throw new WSException(e);
+ }
+
+ return xmlFragment;
+ }
+
+ /**
+ * Get the serializer factory for a given javaType and xmlType
+ */
+ private SerializerFactoryBase getSerializerFactory(TypeMappingImpl typeMapping, Class javaType, QName xmlType)
+ {
+ SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
+
+ // The type mapping might contain a mapping for the array wrapper bean
+ if (serializerFactory == null && javaType.isArray())
+ {
+ Class arrayWrapperType = typeMapping.getJavaType(xmlType);
+ if (arrayWrapperType != null)
+ {
+ try
+ {
+ Method toArrayMethod = arrayWrapperType.getMethod("toArray", new Class[] {});
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(arrayWrapperType, xmlType);
+ }
+ }
+ catch (NoSuchMethodException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (serializerFactory == null)
+ throw new WSException("Cannot obtain serializer factory for: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ return serializerFactory;
+ }
+
+}
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContent.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContent.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContent.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public abstract class SOAPContent implements SOAPContentAccess {
+
+ public enum State {OBJECT_VALID, XML_VALID, DOM_VALID}
+
+ abstract SOAPContent transitionTo(State nextState);
+
+ abstract State getState();
+
+ protected SOAPContentElement container;
+
+ protected SOAPContent(SOAPContentElement container) {
+ this.container = container;
+ }
+
+}
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,23 @@
+package org.jboss.ws.core.soap;
+
+import javax.xml.transform.Source;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public interface SOAPContentAccess {
+
+ Source getPayload();
+
+ void setPayload(Source source);
+
+ XMLFragment getXMLFragment();
+
+ void setXMLFragment(XMLFragment xmlFragment);
+
+ Object getObjectValue();
+
+ void setObjectValue(Object objValue);
+}
Modified: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -23,112 +23,79 @@
// $Id$
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.w3c.dom.*;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.NullValueSerializer;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
-import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
-import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
-import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.utils.MimeUtils;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
-
/**
- * A SOAPElement that gives access to its content as XML fragment or Java object.
+ * A SOAPElement that gives access to its content as XML fragment or Java object.<p>
*
- * The SOAPContentElement has three content representations, which may exist in parallel.
+ * The SOAPContentElement has three content representations, which may not exist in parallel.
* The getter and setter of the content properties perform the conversions.
- * It is the responsibility of this objects to keep the representations in sync.
- *
+ * <pre>
* +---------+ +-------------+ +-------------+
* | Object | <-----> | XMLFragment | <-----> | DOMTree |
* +---------+ +-------------+ +-------------+
+ * </pre>
+ * The idea is, that handlers can work with both the object and the dom view of this SOAPElement.
+ * Note that transitions may be expensive.
*
- * The idea is, that jaxrpc handlers can work with both the object and the dom view of this SOAPElement.
- * Note, that state transitions may be expensive.
+ * @see ObjectContent
+ * @see XMLContent
+ * @see DOMContent
*
* @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.org
* @since 13-Dec-2004
+ *
*/
-public class SOAPContentElement extends SOAPElementImpl
-{
+public class SOAPContentElement extends SOAPElementImpl implements SOAPContentAccess {
+
// provide logging
private static Logger log = Logger.getLogger(SOAPContentElement.class);
- // The well formed XML content of this element.
- private String xmlFragment;
- // The java object content of this element.
- private Object objectValue;
- // True if the current DOM tree is valid
- private boolean isDOMValid;
- // True if the current content object is valid
- private boolean isObjectValid;
- // True while expanding to DOM
- private boolean expandingToDOM;
-
// The associated parameter
private ParameterMetaData paramMetaData;
+ // content soapContent
+ private SOAPContent soapContent;
+
+ // while transitioning DOM expansion needs to be locked
+ private boolean lockDOMExpansion = false;
+
/** Construct a SOAPContentElement
*/
public SOAPContentElement(Name name)
{
super(name);
- isDOMValid = true;
+ this.soapContent = new DOMContent(this);
}
public SOAPContentElement(QName qname)
{
super(qname);
- isDOMValid = true;
+ this.soapContent = new DOMContent(this);
}
public SOAPContentElement(SOAPElementImpl element)
{
super(element);
- isDOMValid = true;
+ this.soapContent = new DOMContent(this);
}
- public ParameterMetaData getParamMetaData()
+ ParameterMetaData getParamMetaData()
{
if (paramMetaData == null)
throw new IllegalStateException("Parameter meta data not available");
@@ -151,400 +118,102 @@
return getParamMetaData().getJavaType();
}
- public boolean isDOMValid()
+ private void transitionTo(SOAPContent.State nextState)
{
- return isDOMValid;
- }
+ if(nextState!=soapContent.getState())
+ {
+ log.debug("Transitioning from " + soapContent.getState() + " to " + nextState);
+ lockDOMExpansion = true;
- public boolean isObjectValid()
- {
- return isObjectValid;
- }
+ soapContent = soapContent.transitionTo(nextState);
- public boolean isFragmentValid()
- {
- return xmlFragment != null;
+ lockDOMExpansion = false;
+ }
}
-
+
/** Get the payload as source.
*/
public Source getPayload()
{
// expand to DOM, so the source is repeatedly readable
- expandToDOM();
- return new DOMSource(this);
+ transitionTo(SOAPContent.State.DOM_VALID);
+ return soapContent.getPayload();
}
/** Set the payload as source
*/
public void setPayload(Source source)
{
- try
- {
- TransformerFactory tf = TransformerFactory.newInstance();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- tf.newTransformer().transform(source, new StreamResult(baos));
- String xmlFragment = new String(baos.toByteArray());
- if (xmlFragment.startsWith("<?xml"))
- {
- int index = xmlFragment.indexOf(">");
- xmlFragment = xmlFragment.substring(index + 1);
- }
- setXMLFragment(xmlFragment);
- }
- catch (TransformerException ex)
- {
- WSException.rethrow(ex);
- }
+ soapContent = new DOMContent(this);
+ soapContent.setPayload(source);
}
- public String getXMLFragment()
+ public XMLFragment getXMLFragment()
{
- // Serialize the valueContent
- if (xmlFragment == null && isObjectValid)
- {
- assertContentMapping();
-
- QName xmlType = getXmlType();
- Class javaType = getJavaType();
- QName xmlName = getElementQName();
-
- log.debug("getXMLFragment from Object [xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- SerializationContext serContext = msgContext.getSerializationContext();
- serContext.setProperty(ParameterMetaData.class.getName(), getParamMetaData());
-
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
-
- try
- {
- SerializerSupport ser;
- if (objectValue != null)
- {
- SerializerFactoryBase serializerFactory = getSerializerFactory(typeMapping, javaType, xmlType);
- ser = (SerializerSupport)serializerFactory.getSerializer();
- }
- else
- {
- ser = new NullValueSerializer();
- }
-
- String tmpFragment = ser.serialize(xmlName, xmlType, getObjectValue(), serContext, null);
- log.debug("xmlFragment: " + tmpFragment);
-
- setXMLFragment(tmpFragment);
- }
- catch (BindingException e)
- {
- throw new WSException(e);
- }
- }
-
- // Generate the xmlFragment from the DOM tree
- else if (xmlFragment == null && isDOMValid)
- {
- log.debug("getXMLFragment from DOM");
- xmlFragment = DOMWriter.printNode(this, false);
- log.debug("xmlFragment: " + xmlFragment);
- invalidateDOMContent();
- }
-
- if (xmlFragment == null || xmlFragment.startsWith("<") == false)
- throw new WSException("Invalid XMLFragment: " + xmlFragment);
-
- return xmlFragment;
+ transitionTo(SOAPContent.State.XML_VALID);
+ return soapContent.getXMLFragment();
}
- public void setXMLFragment(String xmlFragment)
+ public void setXMLFragment(XMLFragment xmlFragment)
{
- log.debug("setXMLFragment: " + xmlFragment);
-
- if (xmlFragment == null || xmlFragment.startsWith("<") == false)
- throw new WSException("Invalid XMLFragment: " + xmlFragment);
-
- removeContentsAsIs();
- resetElementContent();
-
- this.xmlFragment = xmlFragment;
- invalidateDOMContent();
- invalidateObjectContent();
+ soapContent = new XMLContent(this);
+ soapContent.setXMLFragment(xmlFragment);
}
public Object getObjectValue()
{
- if (isObjectValid == false)
- {
- QName xmlType = getXmlType();
- Class javaType = getJavaType();
-
- log.debug("getObjectValue [xmlType=" + xmlType + ",javaType=" + javaType + "]");
- assertContentMapping();
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext == null)
- throw new WSException("MessageContext not available");
-
- SerializationContext serContext = msgContext.getSerializationContext();
- ParameterMetaData pmd = getParamMetaData();
- serContext.setProperty(ParameterMetaData.class.getName(), pmd);
- List<Class> registeredTypes = pmd.getOperationMetaData().getEndpointMetaData().getRegisteredTypes();
- serContext.setProperty(SerializationContext.CONTEXT_TYPES, registeredTypes.toArray(new Class[0]));
-
- try
- {
- // Get the deserializer from the type mapping
- TypeMappingImpl typeMapping = serContext.getTypeMapping();
- DeserializerFactoryBase deserializerFactory = getDeserializerFactory(typeMapping, javaType, xmlType);
- DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
-
- String strContent = getXMLFragment();
-
- Object obj = des.deserialize(getElementQName(), xmlType, strContent, serContext);
- if (obj != null)
- {
- Class objType = obj.getClass();
- boolean isAssignable = JavaUtils.isAssignableFrom(javaType, objType);
- if (isAssignable == false && javaType.isArray())
- {
- try
- {
- Method toArrayMethod = objType.getMethod("toArray", new Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- Method getValueMethod = objType.getMethod("getValue", new Class[] {});
- Object value = getValueMethod.invoke(obj, new Object[] {});
- if (value != null)
- {
- // Do not invoke toArray if getValue returns null
- obj = toArrayMethod.invoke(obj, new Object[] {});
- }
- else
- {
- // if the fragment did not indicate a null return
- // by an xsi:nil we return an empty array
- Class componentType = javaType.getComponentType();
- obj = Array.newInstance(componentType, 0);
- }
- isAssignable = true;
- }
- }
- catch (Exception e)
- {
- // ignore
- }
- }
-
- if (isAssignable == false)
- {
- // handle XOP simple types, i.e. in RPC/LIT
- try
- {
- String contentType = MimeUtils.resolveMimeType(javaType);
- log.debug("Adopt DataHandler to " + javaType +", contentType "+ contentType);
-
- DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
- DataHandler dh = new DataHandler(ds);
- obj = dh.getContent();
-
- // 'application/octet-stream' will return a byte[] instead fo the stream
- if(obj instanceof InputStream)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- dh.writeTo(bout);
- obj = bout.toByteArray();
- }
- }
- catch (IOException e)
- {
- throw new WSException("Failed to adopt XOP content type", e);
- }
-
- if(!JavaUtils.isAssignableFrom(javaType, obj.getClass()))
- {
- throw new WSException("Java type '" + javaType + "' is not assignable from: " + objType.getName());
- }
- }
- }
-
- this.objectValue = obj;
- this.isObjectValid = true;
- }
- catch (BindingException e)
- {
- throw new WSException(e);
- }
-
- log.debug("objectValue: " + (objectValue != null ? objectValue.getClass().getName() : null));
- }
-
- return objectValue;
+ transitionTo(SOAPContent.State.OBJECT_VALID);
+ return soapContent.getObjectValue();
}
public void setObjectValue(Object objValue)
{
- log.debug("setObjectValue: " + objValue);
- removeContentsAsIs();
- resetElementContent();
- this.objectValue = objValue;
- this.isObjectValid = true;
+ soapContent = new ObjectContent(this);
+ soapContent.setObjectValue(objValue);
}
- private void removeContentsAsIs()
- {
- log.trace("removeContentsAsIs");
- boolean cachedFlag = isDOMValid;
- try
- {
- this.isDOMValid = true;
- super.removeContents();
- }
- finally
- {
- this.isDOMValid = cachedFlag;
- }
- }
-
- // Get the serializer factory for a given javaType and xmlType
- private SerializerFactoryBase getSerializerFactory(TypeMappingImpl typeMapping, Class javaType, QName xmlType)
- {
- SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
-
- // The type mapping might contain a mapping for the array wrapper bean
- if (serializerFactory == null && javaType.isArray())
- {
- Class arrayWrapperType = typeMapping.getJavaType(xmlType);
- if (arrayWrapperType != null)
- {
- try
- {
- Method toArrayMethod = arrayWrapperType.getMethod("toArray", new Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(arrayWrapperType, xmlType);
- }
- }
- catch (NoSuchMethodException e)
- {
- // ignore
- }
- }
- }
-
- if (serializerFactory == null)
- throw new WSException("Cannot obtain serializer factory for: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- return serializerFactory;
- }
-
- // Get the deserializer factory for a given javaType and xmlType
- private DeserializerFactoryBase getDeserializerFactory(TypeMappingImpl typeMapping, Class javaType, QName xmlType)
- {
- DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
-
- // The type mapping might contain a mapping for the array wrapper bean
- if (deserializerFactory == null && javaType.isArray())
- {
- Class arrayWrapperType = typeMapping.getJavaType(xmlType);
- if (arrayWrapperType != null)
- {
- try
- {
- Method toArrayMethod = arrayWrapperType.getMethod("toArray", new Class[] {});
- Class returnType = toArrayMethod.getReturnType();
- if (JavaUtils.isAssignableFrom(javaType, returnType))
- {
- deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(arrayWrapperType, xmlType);
- }
- }
- catch (NoSuchMethodException e)
- {
- // ignore
- }
- }
- }
-
- if (deserializerFactory == null)
- throw new WSException("Cannot obtain deserializer factory for: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
-
- return deserializerFactory;
- }
-
- /** Assert the notNull state of the xmlType and javaType
- */
- private void assertContentMapping()
- {
- if (getJavaType() == null)
- throw new WSException("javaType cannot be null");
- if (getXmlType() == null)
- throw new WSException("xmlType cannot be null");
- }
-
// SOAPElement interface ********************************************************************************************
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child);
expandToDOM();
- SOAPElement soapElement = super.addChildElement(child);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addChildElement(child);
}
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
{
log.trace("addChildElement: [localName=" + localName + ",prefix=" + prefix + "]");
expandToDOM();
- SOAPElement soapElement = super.addChildElement(localName, prefix);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addChildElement(localName, prefix);
}
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
{
log.trace("addChildElement: [localName=" + localName + ",prefix=" + prefix + ",uri=" + uri + "]");
expandToDOM();
- SOAPElement soapElement = super.addChildElement(localName, prefix, uri);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addChildElement(localName, prefix, uri);
}
public SOAPElement addChildElement(Name name) throws SOAPException
{
log.trace("addChildElement: [name=" + name + "]");
expandToDOM();
- SOAPElement soapElement = super.addChildElement(name);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addChildElement(name);
}
public SOAPElement addChildElement(String name) throws SOAPException
{
log.trace("addChildElement: [name=" + name + "]");
expandToDOM();
- SOAPElement soapElement = super.addChildElement(name);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addChildElement(name);
}
public SOAPElement addTextNode(String value) throws SOAPException
{
log.trace("addTextNode: [value=" + value + "]");
expandToDOM();
- SOAPElement soapElement = super.addTextNode(value);
- invalidateObjectContent();
- invalidateXMLContent();
- return soapElement;
+ return super.addTextNode(value);
}
public Iterator getChildElements()
@@ -566,8 +235,6 @@
log.trace("removeContents");
expandToDOM();
super.removeContents();
- invalidateObjectContent();
- invalidateXMLContent();
}
public Iterator getAllAttributes()
@@ -768,10 +435,7 @@
{
log.trace("appendChild: " + newChild);
expandToDOM();
- Node node = super.appendChild(newChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
+ return super.appendChild(newChild);
}
public Node cloneNode(boolean deep)
@@ -820,29 +484,26 @@
{
log.trace("removeChild: " + oldChild);
expandToDOM();
- Node node = super.removeChild(oldChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
+ return super.removeChild(oldChild);
}
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
{
log.trace("replaceChild: [new=" + newChild + ",old=" + oldChild + "]");
expandToDOM();
- Node node = super.replaceChild(newChild, oldChild);
- invalidateObjectContent();
- invalidateXMLContent();
- return node;
+ return super.replaceChild(newChild, oldChild);
}
+ private void expandToDOM() {
+ if(!lockDOMExpansion)
+ transitionTo(SOAPContent.State.DOM_VALID);
+ }
+
public void setValue(String value)
{
log.trace("setValue: " + value);
expandToDOM();
super.setValue(value);
- invalidateObjectContent();
- invalidateXMLContent();
}
public NamedNodeMap getAttributes()
@@ -857,190 +518,19 @@
// END Node interface ***********************************************************************************************
- /** Expand the content, generating appropriate child nodes
- */
- private void expandToDOM()
- {
- // SOAPContentElements should only be expanded when handlers do require it.
- if (isDOMValid == false && expandingToDOM == false)
- {
- log.trace("BEGIN: expandToDOM " + getElementName());
- expandingToDOM = true;
-
- // DOM expansion should only happen when a handler accesses the DOM API.
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext != null && !UnifiedMetaData.isFinalRelease())
- {
- Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (Boolean.TRUE.equals(allowExpand) == false)
- throw new WSException("Expanding content element to DOM");
- }
-
- try
- {
- if (xmlFragment == null && isObjectValid)
- xmlFragment = getXMLFragment();
-
- if (xmlFragment == null && isObjectValid == false)
- throw new IllegalStateException("Neither DOM, nor XML, nor Object valid");
-
- if (xmlFragment != null)
- {
- String wrappedXMLFragment = insertNamespaceDeclarations("<wrapper>" + xmlFragment + "</wrapper>");
- Element contentRoot = DOMUtils.parse(wrappedXMLFragment);
- contentRoot = DOMUtils.getFirstChildElement(contentRoot);
-
- String rootLocalName = contentRoot.getLocalName();
- String rootPrefix = contentRoot.getPrefix();
- String rootNS = contentRoot.getNamespaceURI();
- Name contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
-
- // Make sure the content root element name matches this element name
- Name name = getElementName();
- if (contentRootName.equals(name) == false)
- throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
-
- // Copy attributes
- DOMUtils.copyAttributes(this, contentRoot);
-
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
-
- NodeList nlist = contentRoot.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == Node.ELEMENT_NODE)
- {
- SOAPElement soapElement = soapFactory.createElement((Element)child);
- super.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || isXOPParameter())
- XOPContext.inlineXOPData(soapElement);
- }
- else if (childType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- super.addTextNode(nodeValue);
- }
- else if (childType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- super.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + childType);
- }
- }
- }
-
- isDOMValid = true;
- }
- catch (RuntimeException e)
- {
- invalidateDOMContent();
- throw e;
- }
- catch (Exception e)
- {
- invalidateDOMContent();
- throw new WSException(e);
- }
- finally
- {
- expandingToDOM = false;
- log.trace("END: expandToDOM " + getElementName());
- }
-
- invalidateXMLContent();
- invalidateObjectContent();
- }
- }
-
- public String insertNamespaceDeclarations(String xmlfragment)
- {
- StringBuilder xmlBuffer = new StringBuilder(xmlfragment);
-
- int endIndex = xmlfragment.indexOf(">");
- int insIndex = endIndex;
- if (xmlfragment.charAt(insIndex - 1) == '/')
- insIndex = insIndex - 1;
-
- SOAPElement soapElement = this;
- while (soapElement != null)
- {
- Iterator it = soapElement.getNamespacePrefixes();
- while (it.hasNext())
- {
- String prefix = (String)it.next();
- String nsURI = soapElement.getNamespaceURI(prefix);
- String nsDecl = " xmlns:" + prefix + "='" + nsURI + "'";
-
- // Make sure there is not a duplicate on just the wrapper tag
- int nsIndex = xmlBuffer.indexOf("xmlns:" + prefix);
- if (nsIndex < 0 || nsIndex > endIndex)
- {
- xmlBuffer.insert(insIndex, nsDecl);
- endIndex += nsDecl.length();
- }
- }
- soapElement = soapElement.getParentElement();
- }
-
- log.trace("insertNamespaceDeclarations: " + xmlBuffer);
- return xmlBuffer.toString();
- }
-
- private void invalidateDOMContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateDOMContent");
- this.isDOMValid = false;
- }
- }
-
- private void invalidateObjectContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateObjectContent");
- this.isObjectValid = false;
- this.objectValue = null;
- }
- }
-
- private void invalidateXMLContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("invalidateXMLContent");
- this.xmlFragment = null;
- }
- }
-
- private void resetElementContent()
- {
- if (expandingToDOM == false)
- {
- log.trace("resetElementContent");
- invalidateDOMContent();
- invalidateObjectContent();
- invalidateXMLContent();
- }
- }
-
public void writeElement(Writer writer) throws IOException
{
handleMTOMTransitions();
- if (isDOMValid)
+ if (soapContent instanceof DOMContent)
{
new DOMWriter(writer).print(this);
}
else
{
- writer.write(getXMLFragment());
+ transitionTo(SOAPContent.State.XML_VALID);
+ soapContent.getXMLFragment().writeTo(writer);
+
}
}
@@ -1059,9 +549,10 @@
public void handleMTOMTransitions()
{
// MTOM processing is only required on XOP parameters
- if( isXOPParameter() == false)
- return;
+ if(!isXOPParameter()) return;
+ boolean domContentState = (soapContent instanceof DOMContent);
+
if ( !XOPContext.isMTOMEnabled() )
{
// If MTOM is disabled, we force dom expansion on XOP parameters.
@@ -1073,7 +564,7 @@
msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
expandToDOM();
}
- else if ( isDOMValid && XOPContext.isMTOMEnabled() )
+ else if ( domContentState && XOPContext.isMTOMEnabled() )
{
// When the DOM representation is valid,
// but MTOM is enabled we need to convert the inlined
@@ -1084,7 +575,7 @@
}
}
- private boolean isXOPParameter()
+ boolean isXOPParameter()
{
return paramMetaData != null && paramMetaData.isXOP();
}
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLContent.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLContent.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.TypeMappingImpl;
+import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.jaxrpc.binding.DeserializerFactoryBase;
+import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
+import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
+import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.core.utils.MimeUtils;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.transform.Source;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+class XMLContent extends SOAPContent {
+
+ private static final Logger log = Logger.getLogger(XMLContent.class);
+
+ // The well formed XML content of this element.
+ private XMLFragment xmlFragment;
+
+ protected XMLContent(SOAPContentElement container) {
+ super(container);
+ }
+
+ State getState() {
+ return State.XML_VALID;
+ }
+
+ SOAPContent transitionTo(State nextState) {
+
+ SOAPContent next;
+
+ if(State.XML_VALID == nextState)
+ {
+ next = this;
+ }
+ else if(State.OBJECT_VALID == nextState)
+ {
+ Object obj = unmarshallObjectContents();
+ SOAPContent objectValid = new ObjectContent(container);
+ objectValid.setObjectValue(obj);
+ next = objectValid;
+ }
+ else if(State.DOM_VALID == nextState)
+ {
+ expandContainerChildren();
+ next = new DOMContent(container);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Illegal state requested: " + nextState);
+ }
+
+ return next;
+ }
+
+ private Object unmarshallObjectContents() {
+
+ Object obj;
+ QName xmlType = container.getXmlType();
+ Class javaType = container.getJavaType();
+
+ log.debug("getObjectValue [xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext == null)
+ throw new WSException("MessageContext not available");
+
+ SerializationContext serContext = msgContext.getSerializationContext();
+ ParameterMetaData pmd = container.getParamMetaData();
+ serContext.setProperty(ParameterMetaData.class.getName(), pmd);
+ List<Class> registeredTypes = pmd.getOperationMetaData().getEndpointMetaData().getRegisteredTypes();
+ serContext.setProperty(SerializationContext.CONTEXT_TYPES, registeredTypes.toArray(new Class[0]));
+
+ try
+ {
+ // Get the deserializer from the type mapping
+ TypeMappingImpl typeMapping = serContext.getTypeMapping();
+ DeserializerFactoryBase deserializerFactory = getDeserializerFactory(typeMapping, javaType, xmlType);
+ DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
+
+ obj = des.deserialize(container.getElementQName(), xmlType, xmlFragment.getSource(), serContext);
+ if (obj != null)
+ {
+ Class objType = obj.getClass();
+ boolean isAssignable = JavaUtils.isAssignableFrom(javaType, objType);
+ if (!isAssignable && javaType.isArray())
+ {
+ try
+ {
+ Method toArrayMethod = objType.getMethod("toArray");
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ Method getValueMethod = objType.getMethod("getValue");
+ Object value = getValueMethod.invoke(obj);
+ if (value != null)
+ {
+ // Do not invoke toArray if getValue returns null
+ obj = toArrayMethod.invoke(obj);
+ }
+ else
+ {
+ // if the fragment did not indicate a null return
+ // by an xsi:nil we return an empty array
+ Class componentType = javaType.getComponentType();
+ obj = Array.newInstance(componentType, 0);
+ }
+ isAssignable = true;
+ }
+ }
+ catch (Exception e)
+ {
+ // ignore
+ }
+ }
+
+ if (!isAssignable)
+ {
+ // handle XOP simple types, i.e. in RPC/LIT
+ try
+ {
+ String contentType = MimeUtils.resolveMimeType(javaType);
+ log.debug("Adopt DataHandler to " + javaType +", contentType "+ contentType);
+
+ DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
+ DataHandler dh = new DataHandler(ds);
+ obj = dh.getContent();
+
+ // 'application/octet-stream' will return a byte[] instead fo the stream
+ if(obj instanceof InputStream)
+ {
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
+ obj = bout.toByteArray();
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to adopt XOP content type", e);
+ }
+
+ if(!JavaUtils.isAssignableFrom(javaType, obj.getClass()))
+ {
+ throw new WSException("Java type '" + javaType + "' is not assignable from: " + objType.getName());
+ }
+ }
+ }
+ }
+ catch (BindingException e)
+ {
+ throw new WSException(e);
+ }
+
+ log.debug("objectValue: " + (obj != null ? obj.getClass().getName() : null));
+
+ return obj;
+ }
+
+// Get the deserializer factory for a given javaType and xmlType
+ private static DeserializerFactoryBase getDeserializerFactory(TypeMappingImpl typeMapping, Class javaType, QName xmlType)
+ {
+ DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
+
+ // The type mapping might contain a mapping for the array wrapper bean
+ if (deserializerFactory == null && javaType.isArray())
+ {
+ Class arrayWrapperType = typeMapping.getJavaType(xmlType);
+ if (arrayWrapperType != null)
+ {
+ try
+ {
+ Method toArrayMethod = arrayWrapperType.getMethod("toArray");
+ Class returnType = toArrayMethod.getReturnType();
+ if (JavaUtils.isAssignableFrom(javaType, returnType))
+ {
+ deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(arrayWrapperType, xmlType);
+ }
+ }
+ catch (NoSuchMethodException e)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (deserializerFactory == null)
+ throw new WSException("Cannot obtain deserializer factory for: [xmlType=" + xmlType + ",javaType=" + javaType + "]");
+
+ return deserializerFactory;
+ }
+
+ /**
+ * Turn the xml fragment into a DOM repersentation and append
+ * all children to the container.
+ */
+ private void expandContainerChildren() {
+
+ Element contentRoot = xmlFragment.toElement();
+
+ String rootLocalName = contentRoot.getLocalName();
+ String rootPrefix = contentRoot.getPrefix();
+ String rootNS = contentRoot.getNamespaceURI();
+ Name contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
+
+ // Make sure the content root element name matches this element name
+ Name name = container.getElementName();
+ if (!contentRootName.equals(name))
+ throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
+
+ // Copy attributes
+ DOMUtils.copyAttributes(container, contentRoot);
+
+ SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+
+ try {
+ NodeList nlist = contentRoot.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
+ container.addChildElement(soapElement);
+ if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
+ XOPContext.inlineXOPData(soapElement);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ container.addTextNode(nodeValue);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ container.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + childType);
+ }
+ }
+ } catch (SOAPException e) {
+ throw new WSException("Failed to transition to DOM", e);
+ }
+ }
+
+ public Source getPayload() {
+ throw new IllegalStateException("Payload not available");
+ }
+
+ public void setPayload(Source source) {
+ throw new IllegalStateException("Payload not available");
+ }
+
+ public XMLFragment getXMLFragment() {
+ return this.xmlFragment;
+ }
+
+ public void setXMLFragment(XMLFragment xmlFragment) {
+
+ this.xmlFragment = xmlFragment;
+ }
+
+ public Object getObjectValue() {
+ throw new IllegalStateException("Object value not available");
+ }
+
+ public void setObjectValue(Object objValue) {
+ throw new IllegalStateException("Object value not available");
+ }
+
+}
Added: branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,194 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
+import org.w3c.dom.Element;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.*;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public class XMLFragment {
+
+ private Source source;
+ private Result result;
+
+ public XMLFragment(Source source) {
+ this.source = source;
+ }
+
+ public XMLFragment(Result result) {
+ this.result = result;
+ }
+
+ public Source getSource() {
+ if(null == source)
+ throw new IllegalStateException("Source not available");
+ return source;
+ }
+
+ public Result getResult() {
+ if(null == source)
+ throw new IllegalStateException("Result not available");
+ return result;
+ }
+
+ // TODO: replace with less invasive conversion
+ public String toStringFragment()
+ {
+ if(this.source != null)
+ return sourceToStringFragement(this.source);
+ else
+ return resultToStringFragment(this.result);
+ }
+
+ public Element toElement()
+ {
+ Element n = null;
+ try {
+ n = DOMUtils.parse( toStringFragment() );
+ } catch (IOException e) {
+ WSException.rethrow(e);
+ }
+
+ return n;
+ }
+
+ /**
+ * Factory method to create XMLFragment from strings.
+ * @param fragment
+ * @return new XMLFragment
+ */
+ public static XMLFragment fromStringFragment(String fragment)
+ {
+ Source source = new StreamSource(new ByteArrayInputStream(fragment.getBytes()));
+ return new XMLFragment(source);
+ }
+
+ private static String resultToStringFragment(Result result) {
+
+ if(result instanceof DOMResult)
+ {
+ return DOMWriter.printNode( ((DOMResult)result).getNode(), false);
+ }
+
+ throw new IllegalArgumentException("Unable to process javax.xml.transform.Result implementation :" + result);
+
+ }
+
+ private static String sourceToStringFragement(Source source) {
+ String xmlFragment = null;
+
+ try {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ tf.newTransformer().transform(source, new StreamResult(baos));
+ xmlFragment = new String(baos.toByteArray());
+ if (xmlFragment.startsWith("<?xml"))
+ {
+ int index = xmlFragment.indexOf(">");
+ xmlFragment = xmlFragment.substring(index + 1);
+ }
+ } catch (TransformerException e) {
+ WSException.rethrow(e);
+ }
+
+ return xmlFragment;
+ }
+
+ public void writeTo(Writer writer) throws IOException
+ {
+ if(result != null )
+ {
+ writeResult(writer);
+ }
+ else
+ {
+ writeSource(writer);
+ }
+ }
+
+ private void writeSource(Writer writer) throws IOException{
+ if(source instanceof DOMSource)
+ {
+ DOMSource domSource = (DOMSource)source;
+ DOMWriter dw = new DOMWriter(writer).setPrettyprint(false);
+ dw.print(domSource.getNode());
+ }
+ else if(source instanceof StreamSource)
+ {
+ StreamSource streamSource = (StreamSource)source;
+ copyStream(streamSource.getInputStream(), writer);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unable to process javax.xml.transform.Source implementation :" + result);
+ }
+ }
+
+ private static void copyStream(InputStream ins, Writer writer) throws IOException
+ {
+ byte[] bytes = new byte[1024];
+ int r = ins.read(bytes);
+ while (r > 0)
+ {
+ writer.write(new String(bytes), 0, r);
+ r = ins.read(bytes);
+ }
+ }
+
+ private void writeResult(Writer writer) {
+ if(result instanceof DOMResult)
+ {
+ DOMResult domResult = (DOMResult)result;
+ DOMWriter dw = new DOMWriter(writer).setPrettyprint(false);
+ dw.print(domResult.getNode());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unable to process javax.xml.transform.Result implementation :" + result);
+ }
+ }
+
+ public void writeTo(OutputStream out) throws IOException
+ {
+ writeTo( new PrintWriter(out) );
+ }
+
+ public String toString() {
+ return toStringFragment();
+ }
+}
Modified: branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/jbossxb/SerializerDeserializerTestCase.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -26,9 +26,13 @@
import java.net.URI;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import java.io.ByteArrayInputStream;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMappingRegistry;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
@@ -40,6 +44,7 @@
import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
import org.jboss.ws.core.jaxrpc.binding.SerializerFactoryBase;
import org.jboss.ws.core.jaxrpc.binding.SerializerSupport;
+import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.xb.binding.NamespaceRegistry;
/**
@@ -73,12 +78,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(String.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(String.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- String out = (String)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ String out = (String)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value, out);
}
@@ -90,12 +96,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(Calendar.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(Calendar.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- Calendar out = (Calendar)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ Calendar out = (Calendar)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value.getTime(), out.getTime());
assertEquals(value.getTimeZone().getRawOffset(), out.getTimeZone().getRawOffset());
@@ -108,12 +115,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(BigInteger.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(BigInteger.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- BigInteger out = (BigInteger)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ BigInteger out = (BigInteger)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value, out);
}
@@ -125,12 +133,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(BigDecimal.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(BigDecimal.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- BigDecimal out = (BigDecimal)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ BigDecimal out = (BigDecimal)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value, out);
}
@@ -142,8 +151,8 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(QName.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
// serialization registers the prefix
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
@@ -152,7 +161,8 @@
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(QName.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- QName out = (QName)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ QName out = (QName)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value, out);
}
@@ -164,12 +174,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(URI.class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(URI.class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- URI out = (URI)des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ URI out = (URI)des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(value, out);
}
@@ -181,12 +192,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(byte[].class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(byte[].class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- byte[] out = (byte[])des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ byte[] out = (byte[])des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(new String(value), new String(out));
}
@@ -198,12 +210,13 @@
SerializerFactoryBase serializerFactory = (SerializerFactoryBase)typeMapping.getSerializer(byte[].class, xmlType);
SerializerSupport ser = (SerializerSupport)serializerFactory.getSerializer();
- String xmlFragment = ser.serialize(xmlName, xmlType, value, serContext, null);
- assertNotNull(xmlFragment);
+ Result result = ser.serialize(xmlName, xmlType, value, serContext, null);
+ assertNotNull(result);
DeserializerFactoryBase deserializerFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(byte[].class, xmlType);
DeserializerSupport des = (DeserializerSupport)deserializerFactory.getDeserializer();
- byte[] out = (byte[])des.deserialize(xmlName, xmlType, xmlFragment, serContext);
+ Source source = new StreamSource(new ByteArrayInputStream( new XMLFragment(result).toStringFragment().getBytes()));
+ byte[] out = (byte[])des.deserialize(xmlName, xmlType, source, serContext);
assertEquals(new String(value), new String(out));
}
Modified: branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2007-02-05 21:03:29 UTC (rev 2283)
+++ branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -35,6 +35,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
+import org.jboss.ws.core.soap.XMLFragment;
/**
* Test the SOAPContentElement
@@ -44,25 +45,25 @@
*/
public class SOAPContentElementTestCase extends JBossWSTest
{
-
+
/** Test that we can lazily create the SOAP tree
*/
public void testChildNodeAccess() throws Exception
{
Name name = new NameImpl("Order", "tns", "http://someURI");
- String xmlFragment =
- "<tns:Order xmlns:tns='http://someURI'>" +
- "<OrderItem>Ferarri</OrderItem>" +
- "<OrderItem>Lamborgini</OrderItem>" +
- "<OrderItem>JBoss Support</OrderItem>" +
- "<Customer>" +
- "<Name>Thomas</Name>" +
- "</Customer>" +
+ String xmlFragment =
+ "<tns:Order xmlns:tns='http://someURI'>" +
+ "<OrderItem>Ferarri</OrderItem>" +
+ "<OrderItem>Lamborgini</OrderItem>" +
+ "<OrderItem>JBoss Support</OrderItem>" +
+ "<Customer>" +
+ "<Name>Thomas</Name>" +
+ "</Customer>" +
"</tns:Order>";
SOAPContentElement soapEl = new SOAPContentElement(name);
- soapEl.setXMLFragment(xmlFragment);
+ soapEl.setXMLFragment( XMLFragment.fromStringFragment(xmlFragment) );
assertEquals(name, soapEl.getElementName());
@@ -94,7 +95,7 @@
String xmlFragment = "<tns:Order xmlns:tns='http://someURI'>No child element</tns:Order>";
SOAPContentElement soapEl = new SOAPContentElement(name);
- soapEl.setXMLFragment(xmlFragment);
+ soapEl.setXMLFragment( XMLFragment.fromStringFragment(xmlFragment) );
assertEquals(name, soapEl.getElementName());
assertEquals("No child element", soapEl.getValue());
@@ -108,7 +109,7 @@
String xmlFragment = "<tns:Order xmlns:tns='http://someURI'/>";
SOAPContentElement soapEl = new SOAPContentElement(name);
- soapEl.setXMLFragment(xmlFragment);
+ soapEl.setXMLFragment( XMLFragment.fromStringFragment(xmlFragment) );
assertEquals(name, soapEl.getElementName());
assertFalse(soapEl.hasChildNodes());
@@ -123,7 +124,7 @@
String xmlFragment = "<tns:BadName xmlns:tns='http://someURI'>No child element</tns:BadName>";
SOAPContentElement soapEl = new SOAPContentElement(name);
- soapEl.setXMLFragment(xmlFragment);
+ soapEl.setXMLFragment( XMLFragment.fromStringFragment(xmlFragment) );
try
{
@@ -146,7 +147,7 @@
SOAPContentElement soapEl = new SOAPContentElement(name);
soapEl.setAttribute("foo", "Kermit");
- soapEl.setXMLFragment(xmlFragment);
+ soapEl.setXMLFragment( XMLFragment.fromStringFragment(xmlFragment) );
assertEquals(name, soapEl.getElementName());
assertEquals("Kermit", soapEl.getAttributeValue(new NameImpl("foo")));
@@ -163,9 +164,9 @@
"<ns1:hello xmlns:ns1='http://handlerservice1.org/wsdl'>" +
"<String_1>world</String_1>" +
"</ns1:hello>" +
- "</env:Body>" +
+ "</env:Body>" +
"</env:Envelope>";
-
+
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(envStr.getBytes()));
SOAPBody soapBody = soapMessage.getSOAPBody();
@@ -182,7 +183,7 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
soapMessage.writeTo(baos);
-
+
String expEnv = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:hello xmlns:ns1='http://handlerservice1.org/wsdl'><String_1>world::SOAP header was added</String_1></ns1:hello></env:Body></env:Envelope>";
assertEquals(expEnv, baos.toString());
}
Added: branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java
===================================================================
--- branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java (rev 0)
+++ branches/hbraun/1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java 2007-02-05 22:13:19 UTC (rev 2284)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.common.soap;
+
+import junit.framework.TestCase;
+import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+import javax.xml.transform.dom.DOMSource;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintWriter;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id:$
+ * @since 05.02.2007
+ */
+public class XMLFragmentTestCase extends TestCase {
+
+ public static String XML_STRING = "<parent><child/></parent>";
+
+ public void testDOMSourceFragment() throws Exception
+ {
+ Element srcElement = DOMUtils.parse(XML_STRING);
+ XMLFragment xmlFragment = new XMLFragment( new DOMSource(srcElement) );
+ testSourceAPI(xmlFragment);
+ }
+
+ private void testSourceAPI(XMLFragment xmlFragment) throws Exception
+ {
+ assertEquals(xmlFragment.toStringFragment(), XML_STRING);
+
+ Element reparsed = xmlFragment.toElement();
+ assertEquals("parent", reparsed.getNodeName());
+ assertEquals("child", reparsed.getFirstChild().getNodeName());
+
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ PrintWriter writer = new PrintWriter( bout);
+ xmlFragment.writeTo(writer);
+ assertEquals(XML_STRING, new String(bout.toByteArray()));
+ }
+}
17 years, 3 months
JBossWS SVN: r2282 - in trunk: build/ant-import and 41 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-05 15:41:17 -0500 (Mon, 05 Feb 2007)
New Revision: 2282
Added:
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
trunk/integration-tomcat/src/main/resources/tomcat-users.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java
trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.keystore
trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.truststore
Removed:
trunk/build/hudson/hudson-home/jobs/TC-5.5/workspace/tomcat-users.xml
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/keystore.password
trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.keystore
trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.truststore
trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF01/jboss-web.xml
trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF02/jboss-web.xml
trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF03/jboss-web.xml
Modified:
trunk/build/ant-import/build-release.xml
trunk/build/ant-import/build-samples.xml
trunk/build/ant-import/build-setup.xml
trunk/build/ant-import/build-thirdparty.xml
trunk/build/ant.properties.example
trunk/build/etc/default.mf
trunk/build/etc/jbossws-component-info.xml
trunk/build/hudson/apache-tomcat/conf/server.xml
trunk/build/hudson/hudson-home/config.xml
trunk/build/hudson/hudson-home/jobs/JBWS-Tests-TC-5.5/config.xml
trunk/build/hudson/hudson-home/jobs/TC-5.5/config.xml
trunk/build/version.properties
trunk/integration-jboss40/build.xml
trunk/integration-jboss42/build.xml
trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
trunk/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration-jboss50/build.xml
trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
trunk/integration-tomcat/build.xml
trunk/integration-tomcat/src/main/resources/log4j.xml
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java
trunk/jbossws-core/src/main/java/javax/xml/ws/handler/MessageContext.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextJSE.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/JavaToXSD.java
trunk/jbossws-core/src/main/resources/samples/ant-import/build-thirdparty.xml
trunk/jbossws-core/src/main/resources/samples/ant.properties.example
trunk/jbossws-core/src/main/resources/samples/build.xml
trunk/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml
trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
trunk/jbossws-tests/ant-import/build-samples-jaxws.xml
trunk/jbossws-tests/build.xml
trunk/jbossws-tests/src/main/README_XERCES
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean02.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean02.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceBase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceEJB3TestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceJSETestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt
Log:
Resolve dependencies on snapshots
Hudson management port 8105
WebServiceContextJSE delegates to HTTPServletREquest instead of JBossSX
Remove dependency on jboss-web.xml for jaxws samples
WSSecurityConfigFactory silently ignores required resources
Fix round trip set/getNodeValue for exscaped XML
Fix package for naming Util
Rollback XML escape optimization
Move tomcat-users.xml to integration-tomcat
Don't remove temp when setting up TC
Add jnpserver.jar to jboss50 classpath
Include server stuff in client jar, the ServiceObjectFactory needs it
[JBWS-1438] - Implement @WebServiceRef injection for JBossAS-4.2
Modified: trunk/build/ant-import/build-release.xml
===================================================================
--- trunk/build/ant-import/build-release.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/ant-import/build-release.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -79,7 +79,6 @@
<fileset dir="${jboss40.output.lib.dir}">
<include name="jbossws40-jdk14.sar"/>
<include name="jbossws14-client.jar"/>
- <include name="jboss-jaxws14.jar"/>
</fileset>
</copy>
<copy tofile="${jbossws14.repository.dir}/component-info.xml" file="${etc.dir}/jbossws-component-info.xml" filtering="true" overwrite="true">
@@ -193,7 +192,6 @@
</fileset>
<fileset dir="${jboss40.output.lib.dir}">
<include name="jbossws14-client.jar"/>
- <include name="jboss-jaxws14.jar"/>
</fileset>
</copy>
<mkdir dir="${build.bin.dist}/lib/jboss-jdk14/jbossws40-jdk14.sar"/>
Modified: trunk/build/ant-import/build-samples.xml
===================================================================
--- trunk/build/ant-import/build-samples.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/ant-import/build-samples.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -28,7 +28,7 @@
<include name="build.xml"/>
</fileset>
</copy>
- <copy file="${build.src.samples.dir}/ant.properties.example" tofile="${build.src.samples.dir}/ant.properties"/>
+ <!--copy file="${build.src.samples.dir}/ant.properties.example" tofile="${build.src.samples.dir}/ant.properties"/-->
<copy todir="${build.src.samples.dir}">
<fileset dir="${core.samples.dir}">
@@ -63,10 +63,11 @@
<mkdir dir="${build.src.samples.dir}/lib"/>
<copy todir="${build.src.samples.dir}/lib">
<fileset dir="${core.output.lib.dir}">
+ <include name="jbossws-core.jar"/>
+ <include name="jbossws-client.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
- <include name="jbossws-client.jar"/>
</fileset>
<fileset dir="${jboss50.output.lib.dir}">
<include name="jbossws-jboss50-integration.jar"/>
Modified: trunk/build/ant-import/build-setup.xml
===================================================================
--- trunk/build/ant-import/build-setup.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/ant-import/build-setup.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -57,16 +57,22 @@
<property name="jboss40.server.deploy" value="${jboss40.server}/deploy"/>
<property name="jboss40.thirdparty" value="${jboss40.home}/../../../thirdparty"/>
- <property name="tomcat.webapps.dir" value="${tomcat.home}/webapps"/>
+ <property name="tomcat.conf.dir" value="${tomcat.home}/conf"/>
<property name="tomcat.common.dir" value="${tomcat.home}/common"/>
<property name="tomcat.common.classes" value="${tomcat.home}/common/classes"/>
<property name="tomcat.common.lib" value="${tomcat.home}/common/lib"/>
+ <property name="tomcat.webapps.dir" value="${tomcat.home}/webapps"/>
- <available property="jboss50.available" file="${jboss50.client}/jboss-client.jar"/>
- <available property="jboss42.available" file="${jboss42.client}/jboss-client.jar"/>
- <available property="jboss40.available" file="${jboss40.client}/jboss-client.jar"/>
- <available property="tomcat.available" file="${tomcat.home}/server/lib/catalina.jar"/>
+ <property name="jboss50.available.file" value="${jboss50.client}/jboss-ejb3-client.jar"/>
+ <property name="jboss42.available.file" value="${jboss42.client}/jboss-ejb3-client.jar"/>
+ <property name="jboss40.available.file" value="${jboss40.client}/jboss-client.jar"/>
+ <property name="tomcat.available.file" value="${tomcat.home}/server/lib/catalina.jar"/>
+ <available property="jboss50.available" file="${jboss50.available.file}"/>
+ <available property="jboss42.available" file="${jboss42.available.file}"/>
+ <available property="jboss40.available" file="${jboss40.available.file}"/>
+ <available property="tomcat.available" file="${tomcat.available.file}"/>
+
<!-- JDK Detection -->
<available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
<available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
Modified: trunk/build/ant-import/build-thirdparty.xml
===================================================================
--- trunk/build/ant-import/build-thirdparty.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/ant-import/build-thirdparty.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -114,6 +114,7 @@
<pathelement location="${jboss50.lib}/jboss-j2se.jar"/>
<pathelement location="${jboss50.lib}/jboss-vfs.jar"/>
<pathelement location="${jboss50.server.lib}/jboss.jar"/>
+ <pathelement location="${jboss50.server.lib}/jnpserver.jar"/>
<pathelement location="${jboss50.server.deployers}/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
<pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<pathelement location="${jboss50.server.deployers}/ejb3.deployer/jboss-ejb3.jar"/>
Modified: trunk/build/ant.properties.example
===================================================================
--- trunk/build/ant.properties.example 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/ant.properties.example 2007-02-05 20:41:17 UTC (rev 2282)
@@ -9,7 +9,7 @@
#jboss40.home=/home/tdiesler/svn/jbossas/branches/Branch_4_0/build/output/jboss-4.0.5.SP1-ejb3
# The JBoss server under test. This can be [jboss50|jboss42|jboss40|tomcat]
-jbossws.integration.target=jboss50
+jbossws.integration.target=jboss42
# The JBoss server instance
jboss.server.instance=default
Modified: trunk/build/etc/default.mf
===================================================================
--- trunk/build/etc/default.mf 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/etc/default.mf 2007-02-05 20:41:17 UTC (rev 2282)
@@ -5,6 +5,6 @@
Specification-Vendor: @specification.vendor@
Implementation-Title: @implementation.title@
Implementation-URL: @implementation.url@
-Implementation-Version: @implementation.version@ (date=(a)build.id@)
+Implementation-Version: @implementation.version@ (build=(a)build.id@)
Implementation-Vendor: @implementation.vendor@
Implementation-Vendor-Id: @implementation.vendor.id@
Modified: trunk/build/etc/jbossws-component-info.xml
===================================================================
--- trunk/build/etc/jbossws-component-info.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/etc/jbossws-component-info.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,50 +1,59 @@
<project name="jboss/jbossws-component-info">
-
- <component id="jboss/jbossws"
- licenseType="lgpl"
- version="@repository.id@"
- description="JBossWS an implementation of J2EE Web Services">
-
- <artifact id="jbossws-core.jar"/>
- <artifact id="jboss-jaxrpc.jar"/>
- <artifact id="jboss-jaxws.jar"/>
- <artifact id="jboss-saaj.jar"/>
- <artifact id="jbossws40.sar"/>
- <artifact id="jbossws42.sar"/>
- <artifact id="jbossws50.sar"/>
- <artifact id="jbossws50-deployer.zip"/>
-
- <import componentref="apache-xmlsec">
- <compatible version="@apache-xmlsec@"/>
- </import>
- <import componentref="ibm-wsdl4j">
- <compatible version="@ibm-wsdl4j@"/>
- </import>
- <import componentref="javassist">
- <compatible version="@javassist@"/>
- </import>
- <import componentref="jboss/jbossxb">
- <compatible version="@jboss-jbossxb@"/>
- </import>
- <import componentref="jboss/microcontainer">
- <compatible version="snapshot"/>
- <compatible version="@jboss-microcontainer@"/>
- </import>
- <import componentref="jboss/remoting">
- <compatible version="2.2.0.Alpha2"/>
- <compatible version="@jboss-remoting@"/>
- </import>
- <import componentref="sun-jaxb">
- <compatible version="@sun-jaxb@"/>
- </import>
-
- <export>
- <include input="jbossws-core.jar"/>
- <include input="jboss-jaxrpc.jar"/>
- <include input="jboss-jaxws.jar"/>
- <include input="jboss-saaj.jar"/>
- </export>
-
- </component>
-
-</project>
+
+ <component id="jboss/jbossws" licenseType="lgpl" version="@repository.id@" description="JBossWS an implementation of J2EE Web Services">
+
+ <artifact id="jbossws-client.jar"/>
+ <artifact id="jbossws-core.jar"/>
+ <artifact id="jboss-jaxrpc.jar"/>
+ <artifact id="jboss-jaxws.jar"/>
+ <artifact id="jboss-saaj.jar"/>
+
+ <artifact id="jbossws40.sar"/>
+ <artifact id="jbossws-jboss40-integration.jar"/>
+
+ <artifact id="jbossws42.sar"/>
+ <artifact id="jbossws-jboss42-integration.jar"/>
+
+ <artifact id="jbossws50.sar"/>
+ <artifact id="jbossws-jboss50-integration.jar"/>
+ <artifact id="jbossws50-deployer.zip"/>
+
+ <import componentref="apache-xmlsec">
+ <compatible version="@apache-xmlsec@"/>
+ </import>
+ <import componentref="ibm-wsdl4j">
+ <compatible version="@ibm-wsdl4j@"/>
+ </import>
+ <import componentref="javassist">
+ <compatible version="@javassist@"/>
+ </import>
+ <import componentref="jboss/jbossxb">
+ <compatible version="@jboss-jbossxb@"/>
+ </import>
+ <import componentref="jboss/microcontainer">
+ <compatible version="snapshot"/>
+ <compatible version="@jboss-microcontainer@"/>
+ </import>
+ <import componentref="jboss/remoting">
+ <compatible version="2.2.0.Alpha2"/>
+ <compatible version="@jboss-remoting@"/>
+ </import>
+ <import componentref="sun-jaxb">
+ <compatible version="@sun-jaxb@"/>
+ </import>
+
+ <!--
+ There should be no dependency on core or client jars except for
+ jbossws propriatary annotations. Do not expose these jars here.
+
+ Instead include jbossws-core.jar and jbossws-jboss??-integration.jar in the test classpath
+ -->
+ <export>
+ <include input="jboss-jaxrpc.jar"/>
+ <include input="jboss-jaxws.jar"/>
+ <include input="jboss-saaj.jar"/>
+ </export>
+
+ </component>
+
+</project>
\ No newline at end of file
Modified: trunk/build/hudson/apache-tomcat/conf/server.xml
===================================================================
--- trunk/build/hudson/apache-tomcat/conf/server.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/hudson/apache-tomcat/conf/server.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,5 +1,5 @@
-<Server port="8005" shutdown="SHUTDOWN">
+<Server port="8105" shutdown="SHUTDOWN">
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
Modified: trunk/build/hudson/hudson-home/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/config.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/hudson/hudson-home/config.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -127,7 +127,7 @@
<tr align=center><th align=left>AS-4.2</th><td>ok</td><td>ok</td><td>ok</td></tr>
<tr align=center><th align=left>AS-4.0</th><td>ok</td><td>ok</td><td>ok</td></tr>
<tr align=center><th align=left>AS-4.0-jdk14</th><td>ok</td><td>ok</td><td>N/A</td></tr>
-<tr align=center><th align=left>TC-5.5</th><td>ok</td><td>ok</td><td>ok</td></tr>
+<tr align=center><th align=left>TC-5.5</th><td>ok</td><td>N/A</td><td>ok</td></tr>
</table>
]]>
</description>
Modified: trunk/build/hudson/hudson-home/jobs/JBWS-Tests-TC-5.5/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/JBWS-Tests-TC-5.5/config.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/hudson/hudson-home/jobs/JBWS-Tests-TC-5.5/config.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -33,7 +33,6 @@
# start jbossas
#
$TOMCAT_INSTANCE/bin/catalina.sh start
-sleep 10
#
# execute tests
Modified: trunk/build/hudson/hudson-home/jobs/TC-5.5/config.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/TC-5.5/config.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/hudson/hudson-home/jobs/TC-5.5/config.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -15,14 +15,14 @@
rm -rf $WORKSPACE/apache-tomcat
cp -r @hudson.home@/../apache-tomcat $WORKSPACE
rm -rf $WORKSPACE/apache-tomcat/webapps/hudson*
-rm -rf $WORKSPACE/apache-tomcat/work
-rm -rf $WORKSPACE/apache-tomcat/temp
+rm -rf $WORKSPACE/apache-tomcat/temp/*
+rm -rf $WORKSPACE/apache-tomcat/work/*
+rm -rf $WORKSPACE/apache-tomcat/logs/*
#
# copy tomcat config
#
cp $WORKSPACE/server.xml $WORKSPACE/apache-tomcat/conf
-cp $WORKSPACE/tomcat-users.xml $WORKSPACE/apache-tomcat/conf
</command>
</hudson.tasks.Shell>
</builders>
Deleted: trunk/build/hudson/hudson-home/jobs/TC-5.5/workspace/tomcat-users.xml
===================================================================
--- trunk/build/hudson/hudson-home/jobs/TC-5.5/workspace/tomcat-users.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/hudson/hudson-home/jobs/TC-5.5/workspace/tomcat-users.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<tomcat-users>
- <role rolename="manager"/>
- <user username="manager" password="manager" roles="manager"/>
-</tomcat-users>
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/build/version.properties 2007-02-05 20:41:17 UTC (rev 2282)
@@ -3,7 +3,7 @@
specification.title=JBossWS
specification.vendor=JBoss (http://www.jboss.org)
-specification.version=jbossws-2.0
+specification.version=jbossws-1.2
version.id=2.0.0.CR3
repository.id=snapshot
@@ -38,9 +38,9 @@
jboss-common-logging-log4j=2.0.2.GA
jboss-common-logging-spi=2.0.2.GA
jboss-ejb3=1.0.0.CR9-jboss4.0.5
-jboss-jbossretro=snapshot
+jboss-jbossretro=1.0.4.GA
jboss-security=4.0.5.GA
-jboss-vfs=2.0.0.snapshot
+jboss-vfs=2.0.0.Beta2
jbossas-core-libs=4.0.5.GA
jbossws-sun-wsimport=2.0.0
jbpm-bpel=1.1.Beta3
Modified: trunk/integration-jboss40/build.xml
===================================================================
--- trunk/integration-jboss40/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss40/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -11,7 +11,8 @@
<!-- $Id$ -->
-<project default="main" basedir="../integration-jboss40" name="JBossWS-jboss40">
+<project default="main" basedir="../integration-jboss40" name="JBossWS-jboss40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="schema.xsd">
<import file="${basedir}/../build/ant-import/build-thirdparty.xml"/>
<import file="${basedir}/../build/ant-import/build-setup.xml"/>
@@ -25,7 +26,7 @@
<property name="jboss40.output.classes.dir" value="${jboss40.output.dir}/classes"/>
<property name="jboss40.output.classes14.dir" value="${jboss40.output.dir}/classes14"/>
<property name="jboss40.output.lib.dir" value="${jboss40.output.dir}/lib"/>
-
+
<property name="jboss42.src.dir" value="${integration.jboss42.dir}/src/main"/>
<property name="jboss42.java.dir" value="${jboss42.src.dir}/java"/>
<property name="jboss42.resources.dir" value="${jboss42.src.dir}/resources"/>
@@ -33,9 +34,9 @@
<property name="jboss42.output.classes.dir" value="${jboss42.output.dir}/classes"/>
<property name="jboss42.output.classes14.dir" value="${jboss42.output.dir}/classes14"/>
<property name="jboss42.output.lib.dir" value="${jboss42.output.dir}/lib"/>
-
+
<target name="jboss40-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss40.client}/jboss-client.jar" unless="jboss40.available"/>
+ <fail message="Not available: ${jboss40.available.file}" unless="jboss40.available"/>
<available file="${jboss40.client}/jboss-ejb3-client.jar" property="jboss40.ejb3.available"/>
</target>
@@ -51,14 +52,12 @@
| documentation compiles.
-->
- <target name="jboss40-compile" depends="jboss40-compile-classes,jboss40-compile-ejb3-classes,jboss40-compile-etc"
- description="Compile all source files."/>
+ <target name="jboss40-compile" depends="jboss40-compile-classes,jboss40-check-ejb3-classes,jboss40-compile-ejb3-classes,jboss40-compile-etc" description="Compile all source files."/>
<!-- Compile integration java sources -->
<target name="jboss40-compile-classes" depends="jboss40-init,core-compile">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}"
- encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<include name="org/jboss/ws/integration/jboss42/**"/>
<exclude name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
@@ -71,8 +70,7 @@
</target>
<target name="jboss40-compile-ejb3-classes" depends="jboss40-init,core-compile" if="jboss40.ejb3.available">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}"
- encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<include name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
<include name="org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java"/>
@@ -82,6 +80,13 @@
<classpath path="${core.output.classes.dir}"/>
</javac>
</target>
+ <target name="jboss40-check-ejb3-classes" depends="jboss40-init" unless="jboss40.ejb3.available">
+ <echo message="****************************************"/>
+ <echo message="* EJB3 not available *"/>
+ <echo message="* jboss40 integartion layer will be *"/>
+ <echo message="* build without EJB3 support! *"/>
+ <echo message="****************************************"/>
+ </target>
<!-- Compile etc files (manifests and such) -->
<target name="jboss40-compile-etc" depends="jboss40-init">
@@ -92,7 +97,7 @@
<!-- ================================================================== -->
<target name="jboss40-retro" depends="jboss40-compile,core-compile">
-
+
<!-- Weave the build.classes to build.classes14 -->
<taskdef name="retro" classname="org.jboss.ant.tasks.retro.Retro">
<classpath>
@@ -100,7 +105,7 @@
<pathelement location="${thirdparty.dir}/jbossretro.jar"/>
</classpath>
</taskdef>
-
+
<mkdir dir="${jboss40.output.classes14.dir}"/>
<retro destdir="${jboss40.output.classes14.dir}">
<classpath>
@@ -120,7 +125,7 @@
<src path="${core.dir}/output/classes"/>
</retro>
</target>
-
+
<!-- ================================================================== -->
<!-- Archives -->
<!-- ================================================================== -->
@@ -128,7 +133,7 @@
<!--
| Build all jar files.
-->
- <target name="jboss40-jars" depends="jboss40-compile,jboss40-module-jars" description="Builds all jar files.">
+ <target name="jboss40-jars" depends="jboss40-compile,jboss40-module-jars" description="Builds all jar files.">
</target>
<!--
@@ -195,29 +200,21 @@
| Build retrotranslated jar files.
-->
<target name="jboss40-jars14" depends="jboss40-jars,jboss40-retro">
-
- <!-- Build jboss-jaxws14.jar -->
- <mkdir dir="${jboss40.output.lib.dir}"/>
- <jar jarfile="${jboss40.output.lib.dir}/jboss-jaxws14.jar" manifest="${etc.dir}/default.mf">
- <fileset dir="${jboss40.output.classes14.dir}">
- <include name="javax/jws/**"/>
- <include name="javax/xml/ws/**"/>
- </fileset>
- </jar>
-
+
<!-- Build jbossws14-core.jar -->
<mkdir dir="${jboss40.output.lib.dir}"/>
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-core.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${jboss40.output.classes14.dir}">
<include name="org/jboss/ws/**"/>
- <exclude name="org/jboss/ws/integration/**"/>
+ <include name="javax/jws/**"/>
+ <include name="javax/xml/ws/**"/>
</fileset>
<fileset dir="${core.dir}/src/main/resources">
<include name="schema/**"/>
<include name="dtd/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws14-jboss40-integration.jar -->
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-jboss40-integration.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${jboss40.output.classes14.dir}">
@@ -233,9 +230,9 @@
<include name="javax/xml/soap/**"/>
</fileset>
<fileset dir="${jboss40.output.classes14.dir}">
+ <include name="org/jboss/ws/**"/>
<include name="javax/xml/ws/**"/>
<include name="javax/jws/**"/>
- <include name="org/jboss/ws/**"/>
</fileset>
<fileset dir="${core.resources.dir}/jbossws.sar">
<include name="META-INF/standard-jaxrpc-client-config.xml"/>
@@ -252,9 +249,10 @@
</fileset>
<metainf dir="${core.resources.dir}/jboss-saaj.jar/META-INF"/>
</jar>
-
+
<mkdir dir="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF"/>
- <copy tofile="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF/jboss-service.xml" file="${jboss42.resources.dir}/jbossws.sar/META-INF/jboss-service-no-ejb3.xml"/>
+ <copy tofile="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF/jboss-service.xml"
+ file="${jboss42.resources.dir}/jbossws.sar/META-INF/jboss-service-no-ejb3.xml"/>
<!-- Build jbossws40-jdk14.sar -->
<jar jarfile="${jboss40.output.lib.dir}/jbossws40-jdk14.sar" manifest="${etc.dir}/default.mf">
@@ -262,7 +260,6 @@
<include name="jbossws14-jboss40-integration.jar"/>
<include name="jbossws-context.war"/>
<include name="jbossws14-core.jar"/>
- <include name="jboss-jaxws14.jar"/>
</fileset>
<fileset dir="${thirdparty.dir}">
<include name="jaxb-api.jar"/>
@@ -286,7 +283,7 @@
<include name="jboss-service.xml"/>
</metainf>
</jar>
-
+
</target>
<!-- ================================================================== -->
@@ -319,14 +316,18 @@
<delete dir="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<mkdir dir="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<unjar dest="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="${jboss40.output.lib.dir}/jbossws40.sar"/>
- <!-- The JBossAS testsuite references jbosswsfrom thirdparty -->
+ <!-- The JBossAS testsuite references jbossws from thirdparty -->
<copy todir="${jboss40.home}/../../../thirdparty/jboss/jbossws/lib" overwrite="true">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-client.jar"/>
+ <include name="jbossws-core.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${jboss40.output.lib.dir}">
+ <include name="jbossws-jboss40-integration.jar"/>
+ </fileset>
</copy>
<!-- Copy jboss-xml-binding.jar -->
<copy todir="${jboss40.home}//../../../thirdparty/jboss/jbossxb/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
@@ -361,14 +362,16 @@
<mkdir dir="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws14.sar"/>
<unjar dest="${jboss40.home}/server/${jboss.server.instance}/deploy/jbossws14.sar" src="${jboss40.output.lib.dir}/jbossws40-jdk14.sar"/>
<!-- The JBossAS testsuite references jbosswsfrom thirdparty -->
- <copy todir="${jboss40.home}/../../../thirdparty/jboss/jbossws/lib" overwrite="true">
- <fileset dir="${jboss40.output.lib.dir}">
- <include name="jbossws14-client.jar"/>
- </fileset>
+ <copy todir="${jboss40.home}/../../../thirdparty/jboss/jbossws14/lib" overwrite="true">
<fileset dir="${core.output.lib.dir}">
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${jboss40.output.lib.dir}">
+ <include name="jbossws14-client.jar"/>
+ <include name="jbossws14-core.jar"/>
+ <include name="jbossws14-jboss40-integration.jar"/>
+ </fileset>
</copy>
<!-- Copy jboss-xml-binding.jar -->
<copy todir="${jboss40.home}//../../../thirdparty/jboss/jbossxb/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
Modified: trunk/integration-jboss42/build.xml
===================================================================
--- trunk/integration-jboss42/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss42/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -26,7 +26,7 @@
<property name="jboss42.output.lib.dir" value="${jboss42.output.dir}/lib"/>
<target name="jboss42-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss42.client}/jboss-client.jar" unless="jboss42.available"/>
+ <fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
</target>
<!-- ================================================================== -->
@@ -153,14 +153,18 @@
<delete dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<mkdir dir="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<unjar dest="${jboss42.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="${jboss42.output.lib.dir}/jbossws42.sar"/>
- <!-- The JBossAS testsuite references jbosswsfrom thirdparty -->
+ <!-- The JBossAS testsuite references jbossws from thirdparty -->
<copy todir="${jboss42.home}/../../../thirdparty/jboss/jbossws/lib" overwrite="true">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-client.jar"/>
+ <include name="jbossws-core.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${jboss42.output.lib.dir}">
+ <include name="jbossws-jboss42-integration.jar"/>
+ </fileset>
</copy>
</target>
Copied: trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java (from rev 2280, branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java)
===================================================================
--- trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java (rev 0)
+++ trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.ws.core.UnifiedVirtualFile;
+
+/**
+ * The default file adapter loads resources through an associated classloader.
+ * If no classload is set, the the thread context classloader will be used.
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @since 25.01.2007
+ */
+public class URLLoaderAdapter implements UnifiedVirtualFile
+{
+ private URL rootURL;
+ private URL resourceURL;
+ private transient URLClassLoader loader;
+
+ public URLLoaderAdapter(URL rootURL)
+ {
+ this.rootURL = rootURL;
+ }
+
+ private URLLoaderAdapter(URL rootURL, URLClassLoader loader, URL resourceURL)
+ {
+ this.rootURL = rootURL;
+ this.resourceURL = resourceURL;
+ this.loader = loader;
+ }
+
+ public UnifiedVirtualFile findChild(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null)
+ {
+ // Try the child as URL
+ try
+ {
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (resourceURL == null)
+ {
+ try
+ {
+ File file = new File(resourcePath);
+ if (file.exists())
+ resourceURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (resourceURL == null)
+ {
+ try
+ {
+ resourceURL = getResourceLoader().getResource(resourcePath);
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (resourceURL == null)
+ throw new IOException("Cannot get URL for: " + resourcePath);
+
+ return new URLLoaderAdapter(rootURL, loader, resourceURL);
+ }
+
+ public URL toURL()
+ {
+ if (null == this.resourceURL)
+ throw new IllegalStateException("UnifiedVirtualFile not initialized");
+ return resourceURL;
+ }
+
+ private URLClassLoader getResourceLoader()
+ {
+ if (loader == null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ loader = new URLClassLoader(new URL[]{rootURL}, ctxLoader);
+ }
+ return loader;
+ }
+}
Modified: trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java
===================================================================
--- trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceClientDeployer.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -33,8 +33,8 @@
import org.jboss.deployment.DeploymentException;
import org.jboss.deployment.DeploymentInfo;
-import org.jboss.naming.Util;
import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.util.naming.Util;
import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.client.ServiceReferenceable;
Copied: trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java (from rev 2280, branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java)
===================================================================
--- trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java (rev 0)
+++ trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+
+import javax.management.MBeanServer;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.jaxws.UnifiedWebServiceRefHandler;
+
+/**
+ * Binds a JAXWS @WebServiceRef object in the client's ENC
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class WebServiceRefHandler extends UnifiedWebServiceRefHandler implements WebServiceRefHandlerMBean
+{
+ public void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, URL rootURL, Source metadata) throws NamingException
+ {
+ setupWebServiceRef(encCtx, encName, anElement, new URLLoaderAdapter(rootURL), metadata);
+ }
+
+ public void create() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ server.registerMBean(this, OBJECT_NAME);
+ }
+
+ public void destroy() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ server.unregisterMBean(OBJECT_NAME);
+ }
+}
Copied: trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java (from rev 2280, branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java)
===================================================================
--- trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java (rev 0)
+++ trunk/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ */
+public interface WebServiceRefHandlerMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceRefHandler");
+
+ /** Binds a JAXWS WebServiceRef into the callers ENC
+ */
+ void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement enElement, URL rootURL, Source metadata) throws NamingException;
+}
Modified: trunk/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- trunk/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -36,6 +36,9 @@
<property name="serviceEndpointServlet">org.jboss.ws.integration.jboss42.JBossServiceEndpointServlet</property>
</bean>
+ <!-- Bind JAXWS Service objects in client environment context -->
+ <bean name="WebServiceRefHandler" class="org.jboss.ws.integration.jboss42.WebServiceRefHandler"/>
+
<!-- A subscription manager for WS-Eventing -->
<bean name="SubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss50/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -26,7 +26,7 @@
<property name="jboss50.output.lib.dir" value="${jboss50.output.dir}/lib"/>
<target name="jboss50-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss50.client}/jboss-client.jar" unless="jboss50.available"/>
+ <fail message="Not available: ${jboss50.available.file}" unless="jboss50.available"/>
</target>
<!-- ================================================================== -->
@@ -162,14 +162,18 @@
<delete dir="${jboss50.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<mkdir dir="${jboss50.home}/server/${jboss.server.instance}/deploy/jbossws.sar"/>
<unjar dest="${jboss50.home}/server/${jboss.server.instance}/deploy/jbossws.sar" src="${jboss50.output.lib.dir}/jbossws50.sar"/>
- <!-- The JBossAS testsuite references jbosswsfrom thirdparty -->
+ <!-- The JBossAS testsuite references jbossws from thirdparty -->
<copy todir="${jboss50.home}/../../../thirdparty/jboss/jbossws/lib" overwrite="true">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-client.jar"/>
+ <include name="jbossws-core.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
</fileset>
+ <fileset dir="${jboss50.output.lib.dir}">
+ <include name="jbossws-jboss50-integration.jar"/>
+ </fileset>
</copy>
</target>
Deleted: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.client.NameValuePair;
-import org.jboss.ws.core.jaxws.client.PortInfo;
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * An ObjectModelFactory for UnifiedServiceRef
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2007
- */
-public class UnifiedServiceRefObjectFactory implements ObjectModelFactory
-{
- // Hide constructor
- private UnifiedServiceRefObjectFactory()
- {
- }
-
- public static UnifiedServiceRefObjectFactory newInstance()
- {
- return new UnifiedServiceRefObjectFactory();
- }
-
- public UnifiedServiceRef parse(Source source)
- {
- // setup the XML binding Unmarshaller
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamResult result = new StreamResult(baos);
- TransformerFactory tf = TransformerFactory.newInstance();
- tf.newTransformer().transform(source, result);
-
- InputStream is = new ByteArrayInputStream(baos.toByteArray());
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- return (UnifiedServiceRef)unmarshaller.unmarshal(is, this, null);
- }
- catch (Exception ex)
- {
- WSException.rethrow(ex);
- return null;
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return new UnifiedServiceRef();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
- {
- return root;
- }
-
- public void setValue(UnifiedServiceRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("service-ref-name"))
- {
- ref.setServiceRefName(value);
- }
- else if (localName.equals("service-class-name"))
- {
- ref.setServiceClassName(value);
- }
- else if (localName.equals("service-qname"))
- {
- ref.setServiceQName(QName.valueOf(value));
- }
- else if (localName.equals("config-name"))
- {
- ref.setConfigName(value);
- }
- else if (localName.equals("config-file"))
- {
- ref.setConfigFile(value);
- }
- else if (localName.equals("handler-chain"))
- {
- ref.setHandlerChain(value);
- }
- else if (localName.equals("wsdl-override"))
- {
- ref.setWsdlLocation(value);
- }
- }
-
- public Object newChild(UnifiedServiceRef parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- Object child = null;
-
- if (localName.equals("port-info"))
- child = new PortInfo(parent);
-
- return child;
- }
-
- public void addChild(UnifiedServiceRef parent, PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- parent.getPortInfos().add(portInfo);
- }
-
- public void setValue(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("service-endpoint-interface"))
- {
- portInfo.setServiceEndpointInterface(value);
- }
- else if (localName.equals("port-qname"))
- {
- portInfo.setPortQName(QName.valueOf(value));
- }
- else if (localName.equals("config-name"))
- {
- portInfo.setConfigName(value);
- }
- else if (localName.equals("config-file"))
- {
- portInfo.setConfigFile(value);
- }
- }
-
- public Object newChild(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- Object child = null;
- if (localName.equals("stub-property"))
- child = new NameValuePair();
- return child;
- }
-
- public void addChild(PortInfo parent, NameValuePair stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- parent.getStubProperties().add(stubProp);
- }
-
- public void setValue(NameValuePair nvPair, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("name"))
- {
- nvPair.setName(value);
- }
- else if (localName.equals("value"))
- {
- nvPair.setValue(value);
- }
- }
-}
Modified: trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
===================================================================
--- trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -23,171 +23,30 @@
// $Id$
-import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import javax.jws.HandlerChain;
import javax.management.MBeanServer;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.xml.transform.Source;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceRef;
-import javax.xml.ws.WebServiceRefs;
-import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.util.naming.Util;
import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.client.ServiceReferenceable;
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.ws.core.jaxws.UnifiedWebServiceRefHandler;
/**
- * Binds a JAXWS Service object in the client's ENC
+ * Binds a JAXWS @WebServiceRef object in the client's ENC
*
* @author Thomas.Diesler(a)jboss.org
* @since 17-Jan-2007
*/
-public class WebServiceRefHandler implements WebServiceRefHandlerMBean
+public class WebServiceRefHandler extends UnifiedWebServiceRefHandler implements WebServiceRefHandlerMBean
{
- // logging support
- private static Logger log = Logger.getLogger(WebServiceRefHandler.class);
-
public void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, VirtualFile vfsRoot, Source metadata) throws NamingException
{
- WebServiceRef wsref = null;
-
- // Build the list of @WebServiceRef relevant annotations
- List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
- for (Annotation an : anElement.getAnnotations())
- {
- if (an instanceof WebServiceRef)
- wsrefList.add((WebServiceRef)an);
-
- if (an instanceof WebServiceRefs)
- {
- WebServiceRefs wsrefs = (WebServiceRefs)an;
- for (WebServiceRef aux : wsrefs.value())
- wsrefList.add(aux);
- }
- }
-
- // Use the single @WebServiceRef
- if (wsrefList.size() == 1)
- {
- wsref = wsrefList.get(0);
- }
- else
- {
- for (WebServiceRef aux : wsrefList)
- {
- if (encName.endsWith("/" + aux.name()))
- {
- wsref = aux;
- break;
- }
- }
- }
-
- if (wsref == null)
- throw new IllegalArgumentException("@WebServiceRef must be present on: " + anElement);
-
- Class targetClass = null;
- if (anElement instanceof Field)
- targetClass = ((Field)anElement).getType();
- else if (anElement instanceof Method)
- targetClass = ((Method)anElement).getParameterTypes()[0];
-
- String externalName = encCtx.getNameInNamespace() + "/" + encName;
- String targetClassName = (targetClass != null ? targetClass.getName() : null);
- log.debug("setupWebServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
-
- String serviceClassName = null;
-
- // #1 Use the explicit @WebServiceRef.value
- if (wsref.value() != Object.class)
- serviceClassName = wsref.value().getName();
-
- // #2 Use the target ref type
- if (serviceClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
- serviceClassName = targetClass.getName();
-
- // #3 Use javax.xml.ws.Service
- if (serviceClassName == null)
- serviceClassName = Service.class.getName();
-
- // #1 Use the explicit @WebServiceRef.type
- if (wsref.type() != Object.class)
- targetClassName = wsref.type().getName();
-
- // #2 Use the target ref type
- if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
- targetClassName = targetClass.getName();
-
- try
- {
- UnifiedServiceRefObjectFactory factory = UnifiedServiceRefObjectFactory.newInstance();
- UnifiedServiceRef usRef = factory.parse(metadata);
- usRef.setRootFile(new VirtualFileAdaptor(vfsRoot));
-
- // Set the wsdlLocation if there is no override already
- if (usRef.getWsdlLocation() == null && wsref.wsdlLocation().length() > 0)
- usRef.setWsdlLocation(wsref.wsdlLocation());
-
- // Set the handlerChain from @HandlerChain on the annotated element
- String handlerChain = usRef.getHandlerChain();
- HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
- if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
- handlerChain = anHandlerChain.file();
-
- // Resolve path to handler chain
- if (handlerChain != null)
- {
- try
- {
- new URL(handlerChain);
- }
- catch (MalformedURLException ex)
- {
- Class declaringClass = null;
- if (anElement instanceof Field)
- declaringClass = ((Field)anElement).getDeclaringClass();
- else if (anElement instanceof Method)
- declaringClass = ((Method)anElement).getDeclaringClass();
- else if (anElement instanceof Class)
- declaringClass = (Class)anElement;
-
- handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
- VirtualFile vfHandlerChain = vfsRoot.findChild(handlerChain);
- if (vfHandlerChain == null)
- throw new IllegalStateException("Cannot find handler chain: " + handlerChain);
- }
- usRef.setHandlerChain(handlerChain);
- }
-
- // Do not use rebind, the binding should be unique
- // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
- Util.rebind(encCtx, encName, new ServiceReferenceable(serviceClassName, targetClassName, usRef));
-
- log.debug("<service-ref> bound to: java:comp/env/" + encName);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot bind web service ref: " + encName, ex);
- }
+ setupWebServiceRef(encCtx, encName, anElement, new VirtualFileAdaptor(vfsRoot), metadata);
}
-
+
public void create() throws Exception
{
MBeanServer server = MBeanServerLocator.locateJBoss();
Modified: trunk/integration-tomcat/build.xml
===================================================================
--- trunk/integration-tomcat/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-tomcat/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -25,10 +25,9 @@
<property name="tomcat.output.classes14.dir" value="${tomcat.output.dir}/classes14"/>
<property name="tomcat.output.lib.dir" value="${tomcat.output.dir}/lib"/>
- <available property="jbossws.thirdparty.available" file="${tomcat.output.lib.dir}/jbossws-thirdparty.jar"/>
-
<target name="tomcat-init" depends="prepare, thirdparty">
<fail message="Not available: ${tomcat.home}/server/lib/catalina.jar" unless="tomcat.available"/>
+ <available property="jbossws.thirdparty.available" file="${tomcat.output.lib.dir}/jbossws-thirdparty.jar"/>
</target>
<!-- ================================================================== -->
@@ -99,7 +98,7 @@
<include name="META-INF/standard-jaxws-client-config.xml"/>
<include name="META-INF/standard-jaxws-endpoint-config.xml"/>
</fileset>
- <webinf dir="${tomcat.resources.dir}/jbossws.war/WEB-INF">
+ <webinf dir="${tomcat.resources.dir}">
<include name="log4j.xml"/>
</webinf>
</war>
@@ -110,6 +109,7 @@
<!-- Build jbossws-thirdparty.jar -->
<mkdir dir="${tomcat.output.lib.dir}/build"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/ejb3.deployer/jboss-ejb3x.jar"/>
+ <unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/commons-logging.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/concurrent.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jaxb-api.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jaxb-impl.jar"/>
@@ -124,6 +124,7 @@
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-xml-binding.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/javassist.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/log4j.jar"/>
+ <unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/stax-api.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/wsdl4j.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/xmlsec.jar"/>
<jar jarfile="${tomcat.output.lib.dir}/jbossws-thirdparty.jar" manifest="${etc.dir}/default.mf">
@@ -145,6 +146,11 @@
<include name="xercesImpl.jar"/>
</fileset>
</copy>
+ <copy todir="${tomcat.conf.dir}" overwrite="true">
+ <fileset dir="${tomcat.resources.dir}">
+ <include name="tomcat-users.xml"/>
+ </fileset>
+ </copy>
<copy todir="${tomcat.common.classes}" overwrite="true">
<fileset dir="${tomcat.resources.dir}">
<include name="log4j.xml"/>
Modified: trunk/integration-tomcat/src/main/resources/log4j.xml
===================================================================
--- trunk/integration-tomcat/src/main/resources/log4j.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/integration-tomcat/src/main/resources/log4j.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -56,14 +56,27 @@
<priority value="DEBUG"/>
</category>
- <category name="org.jboss.remoting">
+ <category name="org.apache.catalina">
<priority value="INFO"/>
</category>
- <!-- Enable SOAP message tracing -->
+ <category name="org.apache.commons">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.apache.jasper">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.jboss.remoting">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Enable SOAP message tracing
<category name="jbossws.SOAPMessage">
<priority value="TRACE" class="org.jboss.logging.XLevel"/>
</category>
+ -->
<!-- ======================= -->
<!-- Setup the Root category -->
Copied: trunk/integration-tomcat/src/main/resources/tomcat-users.xml (from rev 2255, branches/jbossws-1.2.0/integration-tomcat/src/main/resources/tomcat-users.xml)
===================================================================
--- trunk/integration-tomcat/src/main/resources/tomcat-users.xml (rev 0)
+++ trunk/integration-tomcat/src/main/resources/tomcat-users.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='utf-8'?>
+<tomcat-users>
+ <!-- Security realm for jbossws sample tests -->
+ <role rolename="friend"/>
+ <user username="kermit" password="thefrog" roles="friend"/>
+
+ <!-- Security realm for jbossws sample deployment -->
+ <role rolename="manager"/>
+ <user username="manager" password="manager" roles="manager"/>
+</tomcat-users>
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -146,7 +146,6 @@
<jar jarfile="${core.output.lib.dir}/jbossws-client.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/ws/**"/>
- <exclude name="org/jboss/ws/core/server/**"/>
</fileset>
<fileset dir="${core.resources.dir}/jbossws.sar">
<include name="META-INF/standard-jaxrpc-client-config.xml"/>
Modified: trunk/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/javax/xml/rpc/soap/SOAPFaultException.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -21,17 +21,13 @@
*/
package javax.xml.rpc.soap;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamField;
+// $Id$
import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
import org.jboss.logging.Logger;
-import org.jboss.util.id.SerialVersion;
/** The SOAPFaultException exception represents a SOAP fault.
*
@@ -49,36 +45,12 @@
* @author Scott.Stark(a)jboss.org
* @author Thomas.Diesler(a)jboss.org
* @author Rahul Sharma (javadoc)
- * @version $Revision$
*/
public class SOAPFaultException extends RuntimeException
{
// provide logging
private static Logger log = Logger.getLogger(SOAPFaultException.class);
- /** @since 4.0.2 */
- static final long serialVersionUID;
- private static final int CODE_IDX = 0;
- private static final int STRING_IDX = 1;
- private static final int ACTOR_IDX = 2;
- private static final int DETAIL_IDX = 3;
- private static final ObjectStreamField[] serialPersistentFields;
- static
- {
- if (SerialVersion.version == SerialVersion.LEGACY)
- {
- serialVersionUID = -290987278985292477L;
- serialPersistentFields = new ObjectStreamField[] { new ObjectStreamField("faultCode", QName.class), new ObjectStreamField("faultString", String.class),
- new ObjectStreamField("faultActor", String.class), new ObjectStreamField("faultDetail", Detail.class), };
- }
- else
- {
- serialVersionUID = -7224636940495025621L;
- serialPersistentFields = new ObjectStreamField[] { new ObjectStreamField("faultcode", QName.class), new ObjectStreamField("faultstring", String.class),
- new ObjectStreamField("faultactor", String.class), new ObjectStreamField("faultdetail", Detail.class), };
- }
- }
-
private QName faultCode;
private String faultString;
private String faultActor;
@@ -116,33 +88,4 @@
{
return faultDetail;
}
-
- // Private -------------------------------------------------------
- private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
- {
- ObjectInputStream.GetField fields = ois.readFields();
- String name = serialPersistentFields[CODE_IDX].getName();
- this.faultCode = (QName)fields.get(name, null);
- name = serialPersistentFields[STRING_IDX].getName();
- this.faultString = (String)fields.get(name, null);
- name = serialPersistentFields[ACTOR_IDX].getName();
- this.faultActor = (String)fields.get(name, null);
- name = serialPersistentFields[DETAIL_IDX].getName();
- this.faultDetail = (Detail)fields.get(name, null);
- }
-
- private void writeObject(ObjectOutputStream oos) throws IOException
- {
- // Write j2ee 1.4.1 RI field names
- ObjectOutputStream.PutField fields = oos.putFields();
- String name = serialPersistentFields[CODE_IDX].getName();
- fields.put(name, faultCode);
- name = serialPersistentFields[STRING_IDX].getName();
- fields.put(name, faultString);
- name = serialPersistentFields[ACTOR_IDX].getName();
- fields.put(name, faultActor);
- name = serialPersistentFields[DETAIL_IDX].getName();
- fields.put(name, faultDetail);
- oos.writeFields();
- }
}
Modified: trunk/jbossws-core/src/main/java/javax/xml/ws/handler/MessageContext.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/ws/handler/MessageContext.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/javax/xml/ws/handler/MessageContext.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -37,168 +37,154 @@
*
* @since JAX-WS 2.0
*/
-public interface MessageContext extends Map<String, Object> {
-
- /**
- * Standard property: message direction, <code>true</code> for
- * outbound messages, <code>false</code> for inbound.
- * <p>Type: boolean
- */
- public static final String MESSAGE_OUTBOUND_PROPERTY =
- "javax.xml.ws.handler.message.outbound";
-
- /**
- * Standard property: Map of attachments to a message for the inbound
- * message, key is the MIME Content-ID, value is a DataHandler.
- * <p>Type: java.util.Map<String,DataHandler>
- */
- public static final String INBOUND_MESSAGE_ATTACHMENTS =
- "javax.xml.ws.binding.attachments.inbound";
-
- /**
- * Standard property: Map of attachments to a message for the outbound
- * message, key is the MIME Content-ID, value is a DataHandler.
- * <p>Type: java.util.Map<String,DataHandler>
- */
- public static final String OUTBOUND_MESSAGE_ATTACHMENTS =
- "javax.xml.ws.binding.attachments.outbound";
-
- /**
- * Standard property: input source for WSDL document.
- * <p>Type: org.xml.sax.InputSource
- */
- public static final String WSDL_DESCRIPTION =
- "javax.xml.ws.wsdl.description";
-
- /**
- * Standard property: name of WSDL service.
- * <p>Type: javax.xml.namespace.QName
- */
- public static final String WSDL_SERVICE =
- "javax.xml.ws.wsdl.service";
-
- /**
- * Standard property: name of WSDL port.
- * <p>Type: javax.xml.namespace.QName
- */
- public static final String WSDL_PORT =
- "javax.xml.ws.wsdl.port";
-
- /**
- * Standard property: name of wsdl interface (2.0) or port type (1.1).
- * <p>Type: javax.xml.namespace.QName
- */
- public static final String WSDL_INTERFACE =
- "javax.xml.ws.wsdl.interface";
-
- /**
- * Standard property: name of WSDL operation.
- * <p>Type: javax.xml.namespace.QName
- */
- public static final String WSDL_OPERATION =
- "javax.xml.ws.wsdl.operation";
-
- /**
- * Standard property: HTTP response status code.
- * <p>Type: java.lang.Integer
- */
- public static final String HTTP_RESPONSE_CODE =
- "javax.xml.ws.http.response.code";
-
- /**
- * Standard property: HTTP request headers.
- * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
- */
- public static final String HTTP_REQUEST_HEADERS =
- "javax.xml.ws.http.request.headers";
-
- /**
- * Standard property: HTTP response headers.
- * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
- */
- public static final String HTTP_RESPONSE_HEADERS =
- "javax.xml.ws.http.response.headers";
-
- /**
- * Standard property: HTTP request method.
- * <p>Type: java.lang.String
- */
- public static final String HTTP_REQUEST_METHOD =
- "javax.xml.ws.http.request.method";
-
- /**
- * Standard property: servlet request object.
- * <p>Type: javax.servlet.http.HttpServletRequest
- */
- public static final String SERVLET_REQUEST =
- "javax.xml.ws.servlet.request";
-
- /**
- * Standard property: servlet response object.
- * <p>Type: javax.servlet.http.HttpServletResponse
- */
- public static final String SERVLET_RESPONSE =
- "javax.xml.ws.servlet.response";
-
- /**
- * Standard property: servlet context object.
- * <p>Type: javax.servlet.ServletContext
- */
- public static final String SERVLET_CONTEXT =
- "javax.xml.ws.servlet.context";
-
- /**
- * Standard property: Query string for request.
- * <p>Type: String
- **/
- public static final String QUERY_STRING =
- "javax.xml.ws.http.request.querystring";
-
- /**
- * Standard property: Request Path Info
- * <p>Type: String
- */
- public static final String PATH_INFO =
- "javax.xml.ws.http.request.pathinfo";
-
- /**
- * Standard property: WS Addressing Reference Parameters.
- * The list MUST include all SOAP headers marked with the
- * wsa:IsReferenceParameter="true" attribute.
- * <p>Type: List<Element>
- *
- * @since JAX-WS 2.1
- */
- public static final String REFERENCE_PARAMETERS =
- "javax.xml.ws.reference.parameters";
-
- /**
- * Property scope. Properties scoped as <code>APPLICATION</code> are
- * visible to handlers,
- * client applications and service endpoints; properties scoped as
- * <code>HANDLER</code>
- * are only normally visible to handlers.
- */
- public enum Scope {APPLICATION, HANDLER};
-
- /**
- * Sets the scope of a property.
- *
- * @param name Name of the property associated with the
- * <code>MessageContext</code>
- * @param scope Desired scope of the property
- * @throws java.lang.IllegalArgumentException if an illegal
- * property name is specified
- */
- public void setScope(String name, Scope scope);
-
- /**
- * Gets the scope of a property.
- *
- * @param name Name of the property
- * @return Scope of the property
- * @throws java.lang.IllegalArgumentException if a non-existant
- * property name is specified
- */
- public Scope getScope(String name);
+public interface MessageContext extends Map<String, Object>
+{
+
+ /**
+ * Standard property: message direction, <code>true</code> for
+ * outbound messages, <code>false</code> for inbound.
+ * <p>Type: boolean
+ */
+ public static final String MESSAGE_OUTBOUND_PROPERTY = "javax.xml.ws.handler.message.outbound";
+
+ /**
+ * Standard property: Map of attachments to a message for the inbound
+ * message, key is the MIME Content-ID, value is a DataHandler.
+ * <p>Type: java.util.Map<String,DataHandler>
+ */
+ public static final String INBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.inbound";
+
+ /**
+ * Standard property: Map of attachments to a message for the outbound
+ * message, key is the MIME Content-ID, value is a DataHandler.
+ * <p>Type: java.util.Map<String,DataHandler>
+ */
+ public static final String OUTBOUND_MESSAGE_ATTACHMENTS = "javax.xml.ws.binding.attachments.outbound";
+
+ /**
+ * Standard property: input source for WSDL document.
+ * <p>Type: org.xml.sax.InputSource
+ */
+ public static final String WSDL_DESCRIPTION = "javax.xml.ws.wsdl.description";
+
+ /**
+ * Standard property: name of WSDL service.
+ * <p>Type: javax.xml.namespace.QName
+ */
+ public static final String WSDL_SERVICE = "javax.xml.ws.wsdl.service";
+
+ /**
+ * Standard property: name of WSDL port.
+ * <p>Type: javax.xml.namespace.QName
+ */
+ public static final String WSDL_PORT = "javax.xml.ws.wsdl.port";
+
+ /**
+ * Standard property: name of wsdl interface (2.0) or port type (1.1).
+ * <p>Type: javax.xml.namespace.QName
+ */
+ public static final String WSDL_INTERFACE = "javax.xml.ws.wsdl.interface";
+
+ /**
+ * Standard property: name of WSDL operation.
+ * <p>Type: javax.xml.namespace.QName
+ */
+ public static final String WSDL_OPERATION = "javax.xml.ws.wsdl.operation";
+
+ /**
+ * Standard property: HTTP response status code.
+ * <p>Type: java.lang.Integer
+ */
+ public static final String HTTP_RESPONSE_CODE = "javax.xml.ws.http.response.code";
+
+ /**
+ * Standard property: HTTP request headers.
+ * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
+ */
+ public static final String HTTP_REQUEST_HEADERS = "javax.xml.ws.http.request.headers";
+
+ /**
+ * Standard property: HTTP response headers.
+ * <p>Type: java.util.Map<java.lang.String, java.util.List<java.lang.String>>
+ */
+ public static final String HTTP_RESPONSE_HEADERS = "javax.xml.ws.http.response.headers";
+
+ /**
+ * Standard property: HTTP request method.
+ * <p>Type: java.lang.String
+ */
+ public static final String HTTP_REQUEST_METHOD = "javax.xml.ws.http.request.method";
+
+ /**
+ * Standard property: servlet request object.
+ * <p>Type: javax.servlet.http.HttpServletRequest
+ */
+ public static final String SERVLET_REQUEST = "javax.xml.ws.servlet.request";
+
+ /**
+ * Standard property: servlet response object.
+ * <p>Type: javax.servlet.http.HttpServletResponse
+ */
+ public static final String SERVLET_RESPONSE = "javax.xml.ws.servlet.response";
+
+ /**
+ * Standard property: servlet context object.
+ * <p>Type: javax.servlet.ServletContext
+ */
+ public static final String SERVLET_CONTEXT = "javax.xml.ws.servlet.context";
+
+ /**
+ * Standard property: Query string for request.
+ * <p>Type: String
+ **/
+ public static final String QUERY_STRING = "javax.xml.ws.http.request.querystring";
+
+ /**
+ * Standard property: Request Path Info
+ * <p>Type: String
+ */
+ public static final String PATH_INFO = "javax.xml.ws.http.request.pathinfo";
+
+ /**
+ * Standard property: WS Addressing Reference Parameters.
+ * The list MUST include all SOAP headers marked with the
+ * wsa:IsReferenceParameter="true" attribute.
+ * <p>Type: List<Element>
+ *
+ * @since JAX-WS 2.1
+ */
+ public static final String REFERENCE_PARAMETERS = "javax.xml.ws.reference.parameters";
+
+ /**
+ * Property scope. Properties scoped as <code>APPLICATION</code> are
+ * visible to handlers,
+ * client applications and service endpoints; properties scoped as
+ * <code>HANDLER</code>
+ * are only normally visible to handlers.
+ */
+ public enum Scope
+ {
+ APPLICATION, HANDLER
+ };
+
+ /**
+ * Sets the scope of a property.
+ *
+ * @param name Name of the property associated with the
+ * <code>MessageContext</code>
+ * @param scope Desired scope of the property
+ * @throws java.lang.IllegalArgumentException if an illegal
+ * property name is specified
+ */
+ public void setScope(String name, Scope scope);
+
+ /**
+ * Gets the scope of a property.
+ *
+ * @param name Name of the property
+ * @return Scope of the property
+ * @throws java.lang.IllegalArgumentException if a non-existant
+ * property name is specified
+ */
+ public Scope getScope(String name);
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingImpl.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -122,7 +122,8 @@
*/
public void register(Class javaType, QName xmlType, SerializerFactory sf, DeserializerFactory df)
{
- if(log.isDebugEnabled()) log.debug("register: TypeMappingImpl@" + hashCode() + " [xmlType=" + xmlType + ",javaType=" + javaType.getName() + ",sf=" + sf + ",df=" + df + "]");
+ if (log.isTraceEnabled())
+ log.trace("register: TypeMappingImpl@" + hashCode() + " [xmlType=" + xmlType + ",javaType=" + javaType.getName() + ",sf=" + sf + ",df=" + df + "]");
registerInternal(javaType, new IQName(xmlType), sf, df);
keyPairCache.clear();
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceObjectFactory.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -177,7 +177,7 @@
endpointAddress = serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
}
- catch (Exception ex)
+ catch (Throwable ex)
{
// ignore, we are probably a remote client
}
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java (from rev 2280, branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.client.NameValuePair;
+import org.jboss.ws.core.jaxws.client.PortInfo;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * An ObjectModelFactory for UnifiedServiceRef
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class UnifiedServiceRefObjectFactory implements ObjectModelFactory
+{
+ // Hide constructor
+ private UnifiedServiceRefObjectFactory()
+ {
+ }
+
+ public static UnifiedServiceRefObjectFactory newInstance()
+ {
+ return new UnifiedServiceRefObjectFactory();
+ }
+
+ public UnifiedServiceRef parse(Source source)
+ {
+ // setup the XML binding Unmarshaller
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(baos);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ tf.newTransformer().transform(source, result);
+
+ InputStream is = new ByteArrayInputStream(baos.toByteArray());
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ return (UnifiedServiceRef)unmarshaller.unmarshal(is, this, null);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow(ex);
+ return null;
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new UnifiedServiceRef();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ public void setValue(UnifiedServiceRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-ref-name"))
+ {
+ ref.setServiceRefName(value);
+ }
+ else if (localName.equals("service-class-name"))
+ {
+ ref.setServiceClassName(value);
+ }
+ else if (localName.equals("service-qname"))
+ {
+ ref.setServiceQName(QName.valueOf(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ ref.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ ref.setConfigFile(value);
+ }
+ else if (localName.equals("handler-chain"))
+ {
+ ref.setHandlerChain(value);
+ }
+ else if (localName.equals("wsdl-override"))
+ {
+ ref.setWsdlLocation(value);
+ }
+ }
+
+ public Object newChild(UnifiedServiceRef parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+
+ if (localName.equals("port-info"))
+ child = new PortInfo(parent);
+
+ return child;
+ }
+
+ public void addChild(UnifiedServiceRef parent, PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getPortInfos().add(portInfo);
+ }
+
+ public void setValue(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-endpoint-interface"))
+ {
+ portInfo.setServiceEndpointInterface(value);
+ }
+ else if (localName.equals("port-qname"))
+ {
+ portInfo.setPortQName(QName.valueOf(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ portInfo.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ portInfo.setConfigFile(value);
+ }
+ }
+
+ public Object newChild(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("stub-property"))
+ child = new NameValuePair();
+ return child;
+ }
+
+ public void addChild(PortInfo parent, NameValuePair stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getStubProperties().add(stubProp);
+ }
+
+ public void setValue(NameValuePair nvPair, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("name"))
+ {
+ nvPair.setName(value);
+ }
+ else if (localName.equals("value"))
+ {
+ nvPair.setValue(value);
+ }
+ }
+}
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java (from rev 2280, branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java (rev 0)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws;
+
+// $Id$
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.naming.Util;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.UnifiedVirtualFile;
+import org.jboss.ws.core.jaxws.client.ServiceReferenceable;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+
+/**
+ * Binds a JAXWS Service object in the client's ENC
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class UnifiedWebServiceRefHandler
+{
+ // logging support
+ private static Logger log = Logger.getLogger(UnifiedWebServiceRefHandler.class);
+
+ protected void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedVirtualFile vfsRoot, Source metadata) throws NamingException
+ {
+ WebServiceRef wsref = null;
+
+ // Build the list of @WebServiceRef relevant annotations
+ List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
+ for (Annotation an : anElement.getAnnotations())
+ {
+ if (an instanceof WebServiceRef)
+ wsrefList.add((WebServiceRef)an);
+
+ if (an instanceof WebServiceRefs)
+ {
+ WebServiceRefs wsrefs = (WebServiceRefs)an;
+ for (WebServiceRef aux : wsrefs.value())
+ wsrefList.add(aux);
+ }
+ }
+
+ // Use the single @WebServiceRef
+ if (wsrefList.size() == 1)
+ {
+ wsref = wsrefList.get(0);
+ }
+ else
+ {
+ for (WebServiceRef aux : wsrefList)
+ {
+ if (encName.endsWith("/" + aux.name()))
+ {
+ wsref = aux;
+ break;
+ }
+ }
+ }
+
+ if (wsref == null)
+ throw new IllegalArgumentException("@WebServiceRef must be present on: " + anElement);
+
+ Class targetClass = null;
+ if (anElement instanceof Field)
+ targetClass = ((Field)anElement).getType();
+ else if (anElement instanceof Method)
+ targetClass = ((Method)anElement).getParameterTypes()[0];
+
+ String externalName = encCtx.getNameInNamespace() + "/" + encName;
+ String targetClassName = (targetClass != null ? targetClass.getName() : null);
+ log.debug("setupWebServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
+
+ String serviceClassName = null;
+
+ // #1 Use the explicit @WebServiceRef.value
+ if (wsref.value() != Object.class)
+ serviceClassName = wsref.value().getName();
+
+ // #2 Use the target ref type
+ if (serviceClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
+ serviceClassName = targetClass.getName();
+
+ // #3 Use javax.xml.ws.Service
+ if (serviceClassName == null)
+ serviceClassName = Service.class.getName();
+
+ // #1 Use the explicit @WebServiceRef.type
+ if (wsref.type() != Object.class)
+ targetClassName = wsref.type().getName();
+
+ // #2 Use the target ref type
+ if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
+ targetClassName = targetClass.getName();
+
+ try
+ {
+ UnifiedServiceRefObjectFactory factory = UnifiedServiceRefObjectFactory.newInstance();
+ UnifiedServiceRef usRef = factory.parse(metadata);
+ usRef.setRootFile(vfsRoot);
+
+ // Set the wsdlLocation if there is no override already
+ if (usRef.getWsdlLocation() == null && wsref.wsdlLocation().length() > 0)
+ usRef.setWsdlLocation(wsref.wsdlLocation());
+
+ // Set the handlerChain from @HandlerChain on the annotated element
+ String handlerChain = usRef.getHandlerChain();
+ HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
+ if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
+ handlerChain = anHandlerChain.file();
+
+ // Resolve path to handler chain
+ if (handlerChain != null)
+ {
+ try
+ {
+ new URL(handlerChain);
+ }
+ catch (MalformedURLException ex)
+ {
+ Class declaringClass = null;
+ if (anElement instanceof Field)
+ declaringClass = ((Field)anElement).getDeclaringClass();
+ else if (anElement instanceof Method)
+ declaringClass = ((Method)anElement).getDeclaringClass();
+ else if (anElement instanceof Class)
+ declaringClass = (Class)anElement;
+
+ handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
+ UnifiedVirtualFile vfHandlerChain = vfsRoot.findChild(handlerChain);
+ if (vfHandlerChain == null)
+ throw new IllegalStateException("Cannot find handler chain: " + handlerChain);
+ }
+ usRef.setHandlerChain(handlerChain);
+ }
+
+ // Do not use rebind, the binding should be unique
+ // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
+ Util.rebind(encCtx, encName, new ServiceReferenceable(serviceClassName, targetClassName, usRef));
+
+ log.debug("<service-ref> bound to: java:comp/env/" + encName);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot bind web service ref: " + encName, ex);
+ }
+ }
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextJSE.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextJSE.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/WebServiceContextJSE.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -24,73 +24,41 @@
// $Id$
import java.security.Principal;
-import java.util.HashSet;
-import java.util.Set;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
+import javax.servlet.http.HttpServletRequest;
import javax.xml.ws.handler.MessageContext;
-import org.jboss.logging.Logger;
-import org.jboss.security.RealmMapping;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
/**
- * A WebServiceContext implementation that delegates to jbosssx.
+ * A WebServiceContext implementation that delegates to the HttpServletRequest.
*
* @author Thomas.Diesler(a)jboss.org
* @since 23-Jan-2007
*/
public class WebServiceContextJSE extends AbstractWebServiceContext
{
- // provide logging
- private Logger log = Logger.getLogger(WebServiceContextJSE.class);
+ private HttpServletRequest httpRequest;
- private RealmMapping realmMapping;
-
public WebServiceContextJSE(MessageContext messageContext)
{
super(messageContext);
+ httpRequest = (HttpServletRequest)messageContext.get(MessageContextJAXWS.SERVLET_REQUEST);
+ if (httpRequest == null)
+ throw new IllegalStateException("Cannot obtain HTTPServletRequest from message context");
}
@Override
public Principal getUserPrincipal()
{
- Principal principal = SecurityAssociation.getCallerPrincipal();
+ Principal principal = httpRequest.getUserPrincipal();
return principal;
}
@Override
public boolean isUserInRole(String role)
{
- boolean isUserInRole = false;
- Principal principal = SecurityAssociation.getCallerPrincipal();
- RealmMapping realmMapping = getRealmMapping();
- if (realmMapping != null && principal != null)
- {
- Set<Principal> roles = new HashSet<Principal>();
- roles.add(new SimplePrincipal(role));
- isUserInRole = realmMapping.doesUserHaveRole(principal, roles);
- }
+ boolean isUserInRole = httpRequest.isUserInRole(role);
return isUserInRole;
}
-
- private RealmMapping getRealmMapping()
- {
- if (realmMapping == null)
- {
- String lookupName = "java:comp/env/security/realmMapping";
- try
- {
- InitialContext iniCtx = new InitialContext();
- realmMapping = (RealmMapping)iniCtx.lookup(lookupName);
- }
- catch (NamingException e)
- {
- if(log.isDebugEnabled()) log.debug("Cannot obtain realm mapping from: " + lookupName);
- }
- }
- return realmMapping;
- }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMUtils.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMUtils.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -37,7 +37,6 @@
import javax.xml.parsers.ParserConfigurationException;
import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -68,7 +67,7 @@
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setEntityResolver(new JBossEntityResolver());
+ builder.setEntityResolver(new JBossWSEntityResolver());
return builder;
}
catch (ParserConfigurationException e)
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -143,7 +143,9 @@
SecurityDecoder decoder = new SecurityDecoder(securityStore);
decoder.decode(soapMessage.getSOAPPart(), secHeaderElement);
- if(log.isDebugEnabled()) log.debug("Decoded Message:\n" + DOMWriter.printNode(soapMessage.getSOAPPart(), true));
+
+ if (log.isTraceEnabled())
+ log.trace("Decoded Message:\n" + DOMWriter.printNode(soapMessage.getSOAPPart(), true));
OperationMetaData opMetaData = ctx.getOperationMetaData();
if (opMetaData == null)
@@ -178,7 +180,7 @@
{
WSSecurityConfiguration config = ctx.getEndpointMetaData().getServiceMetaData().getSecurityConfiguration();
if (config == null)
- throw new WSException("Cannot obtatin security configuration from message context");
+ throw new WSException("Cannot obtain security configuration from message context");
return config;
}
@@ -232,7 +234,8 @@
Config operationConfig = getConfig(config, port, operation);
- if(log.isDebugEnabled()) log.debug("WS-Security config:" + operationConfig);
+ log.debug("WS-Security config: " + operationConfig);
+
// Nothing to process
if (operationConfig == null)
return;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ws.extensions.security.jaxrpc;
// $Id$
@@ -99,34 +99,25 @@
EndpointMetaData epMetaData = ((SOAPMessageContextJAXRPC)msgContext).getEndpointMetaData();
ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- if(null == serviceMetaData.getSecurityConfiguration()) // might be set through ServiceObjectFactory
+ WSSecurityConfiguration config = serviceMetaData.getSecurityConfiguration();
+ if (config == null) // might be set through ServiceObjectFactory
{
- UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getRootFile();
- boolean successful = false;
-
- WSSecurityConfiguration config = null;
-
try
{
WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
+ UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getRootFile();
config = wsseConfFactory.createConfiguration(vfsRoot, getConfigResourceName());
- if(config!=null) successful = true;
-
}
catch (IOException e)
{
- successful = false;
+ throw new WSException("Cannot obtain security config: " + getConfigResourceName());
}
- if(!successful)
- throw new WSException("Cannot obtain security config: " +getConfigResourceName());
-
// it's required further down the processing chain
serviceMetaData.setSecurityConfiguration(config);
}
- return serviceMetaData.getSecurityConfiguration();
-
+ return config;
}
protected abstract String getConfigResourceName();
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -39,7 +39,7 @@
*/
public class ResourceLoaderAdapter implements UnifiedVirtualFile
{
- private URL location;
+ private URL resourceURL;
private ClassLoader loader;
public ResourceLoaderAdapter()
@@ -52,9 +52,9 @@
this.loader = loader;
}
- private ResourceLoaderAdapter(ClassLoader loader, URL location)
+ private ResourceLoaderAdapter(ClassLoader loader, URL resourceURL)
{
- this.location = location;
+ this.resourceURL = resourceURL;
this.loader = loader;
}
@@ -110,13 +110,8 @@
public URL toURL()
{
- if (null == this.location)
+ if (null == this.resourceURL)
throw new IllegalStateException("UnifiedVirtualFile not initialized");
- return location;
+ return resourceURL;
}
-
- public ClassLoader getResourceLoader()
- {
- return loader;
- }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.ws.metadata.wsse;
// $Id: $
@@ -27,6 +27,7 @@
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.UnifiedVirtualFile;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
@@ -48,51 +49,47 @@
{
WSSecurityConfiguration config = null;
- URL location = getResource(vfsRoot, "WEB-INF/" + resourceName);
- if(null == location)
- location = getResource(vfsRoot, "META-INF/" + resourceName);
+ URL location = getResource(vfsRoot, "WEB-INF/" + resourceName, false);
+ if (null == location)
+ location = getResource(vfsRoot, "META-INF/" + resourceName, false);
if (location != null)
{
- if(log.isDebugEnabled()) log.debug("createConfiguration from: " + location);
+ log.debug("createConfiguration from: " + location);
config = WSSecurityOMFactory.newInstance().parse(location);
// Get and set deployment path to the keystore file
if (config.getKeyStoreFile() != null)
{
- location = getResource(vfsRoot, config.getKeyStoreFile());
- if (location != null)
- {
- if(log.isDebugEnabled()) log.debug("Add keystore: " + location);
- config.setKeyStoreURL(location);
- }
+ location = getResource(vfsRoot, config.getKeyStoreFile(), true);
+ log.debug("Add keystore: " + location);
+ config.setKeyStoreURL(location);
}
if (config.getTrustStoreFile() != null)
{
- location = getResource(vfsRoot, config.getTrustStoreFile());
- if (location != null)
- {
- if(log.isDebugEnabled()) log.debug("Add truststore: " + location);
- config.setTrustStoreURL(location);
- }
+ location = getResource(vfsRoot, config.getTrustStoreFile(), true);
+ log.debug("Add truststore: " + location);
+ config.setTrustStoreURL(location);
}
}
return config;
}
- private URL getResource(UnifiedVirtualFile vfsRoot, String resource)
+ private URL getResource(UnifiedVirtualFile vfsRoot, String resource, boolean failOnNotFound)
{
+ URL resourceURL = null;
try
{
UnifiedVirtualFile child = vfsRoot.findChild(resource);
- return child.toURL();
+ resourceURL = child.toURL();
}
- catch (Exception e)
+ catch (IOException ex)
{
- return null;
+ if (failOnNotFound)
+ throw new WSException("Cannot find required security resource: " + resource);
}
+ return resourceURL;
}
-
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -170,7 +170,7 @@
URL orgURL = locs.get(nsURI);
URL resURL = resolveNamespaceURI(resolver, nsURI);
URL url = resURL != null ? resURL : orgURL;
- if(log.isDebugEnabled()) log.debug("Load schema: " + nsURI + "=" + url);
+ log.debug("Load schema: " + nsURI + "=" + url);
XMLInputSource inputSource = new XMLInputSource(null, url.toExternalForm(), null);
InputSource tmpSrc = resolver.resolveEntity(null, url.toExternalForm());
@@ -178,6 +178,9 @@
inputSource.setByteStream(in);
SchemaGrammar grammar = (SchemaGrammar)loader.loadGrammar(inputSource);
+ if (grammar == null)
+ throw new IllegalStateException("Cannot load grammar: " + url);
+
gs[index++] = grammar;
}
catch (RuntimeException rte)
Modified: trunk/jbossws-core/src/main/resources/samples/ant-import/build-thirdparty.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/ant-import/build-thirdparty.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/resources/samples/ant-import/build-thirdparty.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -61,22 +61,14 @@
<pathelement location="${thirdparty.dir}/jaxb-api.jar"/>
<pathelement location="${thirdparty.dir}/jaxb-impl.jar"/>
<pathelement location="${thirdparty.dir}/jboss-common.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-dependency.jar"/>
<pathelement location="${thirdparty.dir}/jboss-j2ee.jar"/>
<pathelement location="${thirdparty.dir}/jboss-logging-spi.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-microcontainer.jar"/>
- <pathelement location="${thirdparty.dir}/jboss-remoting.jar"/>
<pathelement location="${thirdparty.dir}/jboss-xml-binding.jar"/>
<pathelement location="${thirdparty.dir}/jbosssx-client.jar"/>
<pathelement location="${thirdparty.dir}/mail.jar"/>
<pathelement location="${thirdparty.dir}/servlet-api.jar"/>
<pathelement location="${thirdparty.dir}/stax-api.jar"/>
<pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
- <pathelement location="${thirdparty.dir}/wstx.jar"/>
- <pathelement location="${thirdparty.dir}/getopt.jar"/>
- <pathelement location="${thirdparty.dir}/xmlsec.jar"/>
- <pathelement location="${thirdparty.dir}/xercesImpl.jar"/>
- <pathelement location="${thirdparty.dir}/xalan.jar"/>
</path>
</target>
Modified: trunk/jbossws-core/src/main/resources/samples/ant.properties.example
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/ant.properties.example 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/resources/samples/ant.properties.example 2007-02-05 20:41:17 UTC (rev 2282)
@@ -7,7 +7,7 @@
jboss40.home=/home/tdiesler/svn/jbossas/branches/Branch_4_0/build/output/jboss-4.0.5.SP1-ejb3
# The JBoss server under test. This can be [jboss50|jboss42|jboss40|tomcat]
-jbossws.integration.target=jboss50
+jbossws.integration.target=jboss42
# The JBoss server instance
jboss.server.instance=default
@@ -18,8 +18,8 @@
tomcat.manager.password=manager
# JBoss Repository
-jboss.repository=file:/home/tdiesler/cvs/jboss.local.repository
-#jboss.repository=http://repository.jboss.com
+#jboss.repository=file:/home/tdiesler/cvs/jboss.local.repository
+jboss.repository=http://repository.jboss.com
# Force thirdparty HTTP get
#force.thirdparty.get=true
Modified: trunk/jbossws-core/src/main/resources/samples/build.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-core/src/main/resources/samples/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -149,8 +149,8 @@
<target name="common-classpath" depends="prepare,thirdparty">
- <!-- The combined compile classpath -->
- <path id="jbossws.jars.classpath">
+ <path id="jbossws.classpath">
+ <pathelement location="${tests.lib.dir}/jbossws-core.jar"/>
<pathelement location="${tests.lib.dir}/jbossws-client.jar"/>
<pathelement location="${tests.lib.dir}/jboss-jaxrpc.jar"/>
<pathelement location="${tests.lib.dir}/jboss-jaxws.jar"/>
@@ -164,7 +164,7 @@
<!-- The combined compile classpath -->
<path id="javac.classpath">
<path refid="core.classpath"/>
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/jboss-vfs.jar"/>
<pathelement location="${thirdparty.dir}/junit.jar"/>
@@ -182,7 +182,7 @@
<!-- The test client classpath -->
<path id="test.client.classpath">
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${jboss.client}/commons-logging.jar"/>
<pathelement location="${jboss.client}/jboss-backport-concurrent.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
@@ -201,7 +201,7 @@
<!-- The jBPM BPEL classpath -->
<path id="jbpm.bpel.classpath">
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${thirdparty.dir}/jbpm-bpel"/> <!-- jbpm.cfg.xml -->
<pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-bpel.jar" />
<pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-jpdl.jar" />
@@ -220,10 +220,13 @@
</target>
<target name="tomcat-classpath" depends="common-classpath" if="jbossws.integration.target.tomcat">
+
+ <fail message="jdk-1.5 is required for Tomcat integration" unless="HAVE_JDK_1.5"/>
+
<!-- The test client classpath -->
<path id="test.client.classpath">
- <path refid="jbossws.jars.classpath"/>
- <pathelement location="${tomcat.common.lib}/jbossws-thirdparty.jar"/>
+ <path refid="jbossws.classpath"/>
+ <pathelement location="${tomcat.home}/common/lib/jbossws-thirdparty.jar"/>
<path refid="javac.classpath"/>
</path>
</target>
@@ -320,7 +323,7 @@
<!-- generate mapping artifacts -->
<taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
<classpath refid="core.classpath"/>
- <classpath location="${tests.lib.dir}/jbossws-client.jar"/>
+ <classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
<classpath location="${tests.output.dir}/classes"/>
<classpath location="${tests.output.dir}"/>
@@ -405,8 +408,8 @@
<sysproperty key="tomcat.home" value="${tomcat.home}"/>
<sysproperty key="tomcat.manager.password" value="${tomcat.manager.password}"/>
<sysproperty key="tomcat.manager.username" value="${tomcat.manager.username}"/>
- <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
@@ -446,8 +449,8 @@
<sysproperty key="tomcat.manager.username" value="${tomcat.manager.username}"/>
<!--
http://jira.jboss.com/jira/browse/JBWS-917
- <sysproperty key="javax.net.ssl.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="javax.net.ssl.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="javax.net.ssl.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="javax.net.ssl.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="jbossws"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="jbossws"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
@@ -455,8 +458,8 @@
-->
<!-- HTTPS hostname wrong: should be <localhost> -->
<sysproperty key="org.jboss.security.ignoreHttpsHost" value="true"/>
- <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
Modified: trunk/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml
===================================================================
--- trunk/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -349,7 +349,7 @@
</para>
<para>
- Where you put the jar is up to mostly up to you, although with jdk1.4 the best
+ Where you put the jar is mostly up to you, although with jdk1.4 the best
(and in some cases only) place to have it is in $JAVA_HOME/jre/lib/ext.
Under Windows there will normally be a JRE and a JDK install of Java if you think you have installed it
correctly and it still doesn't work chances are you have added the provider to the installation not being used.
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -2601,32 +2601,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-account-signup.war -->
- <war warfile="${tests.output.dir}/libs/jaxrpc-wsse-account-signup.war" webxml="${tests.output.dir}/resources/jaxrpc/wsse/account-signup/WEB-INF/web.xml">
- <classes dir="${tests.output.dir}/classes">
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountInfo.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountSignup.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountSignupImpl.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountSignup_signup_RequestStruct.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountSignup_signup_ResponseStruct.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/Address.class"/>
- <include name="org/jboss/test/ws/jaxrpc/wsse/signup/CreditCardInfo.class"/>
- </classes>
- <webinf dir="${tests.output.dir}/resources/jaxrpc/wsse/account-signup/WEB-INF">
- <include name="jboss-web.xml"/>
- <include name="jaxrpc-mapping.xml"/>
- <include name="webservices.xml"/>
- <include name="jboss-wsse-server.xml"/>
- <include name="wsdl/**"/>
- </webinf>
- <webinf dir="${tests.output.dir}/resources/jaxrpc/wsse">
- <include name="wsse.keystore"/>
- <include name="wsse.truststore"/>
- </webinf>
- </war>
-
- <!-- jaxrpc-wsse-account-signup-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-account-signup-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/signup/AccountInfo.class"/>
@@ -2665,8 +2639,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-rpc-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-rpc-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
@@ -2683,8 +2655,6 @@
<include name="jaxrpc-mapping.xml"/>
</metainf>
</jar>
-
- <!-- jaxrpc-wsse-rpc-none-client -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-rpc-none-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
@@ -2725,8 +2695,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-simple-encrypt-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-simple-sign-encrypt-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
@@ -2768,8 +2736,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-sign-fault-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-sign-fault-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
@@ -2811,8 +2777,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-sign-encrypt-fault-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-sign-encrypt-fault-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
@@ -2856,8 +2820,6 @@
<include name="wsse.truststore"/>
</webinf>
</war>
-
- <!-- jaxrpc-wsse-store-pass-encrypt-class-cmd-client.jar -->
<jar jarfile="${tests.output.dir}/libs/jaxrpc-wsse-store-pass-encrypt-class-cmd-client.jar">
<fileset dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/wsse/Hello.class"/>
Modified: trunk/jbossws-tests/ant-import/build-samples-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -256,16 +256,12 @@
<classes dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/samples/webservice/JSEBean01.class"/>
</classes>
- <webinf dir="${tests.output.dir}/resources/jaxws/samples/webservice/WEB-INF01">
- <include name="jboss-web.xml"/>
- </webinf>
</war>
<war warfile="${tests.output.dir}/libs/jaxws-samples-webservice02-jse.war" webxml="${tests.output.dir}/resources/jaxws/samples/webservice/WEB-INF02/web.xml">
<classes dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/samples/webservice/JSEBean02.class"/>
</classes>
<webinf dir="${tests.output.dir}/resources/jaxws/samples/webservice/WEB-INF02">
- <include name="jboss-web.xml"/>
<include name="wsdl/**"/>
</webinf>
</war>
@@ -274,9 +270,6 @@
<include name="org/jboss/test/ws/jaxws/samples/webservice/JSEBean03.class"/>
<include name="org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.class"/>
</classes>
- <webinf dir="${tests.output.dir}/resources/jaxws/samples/webservice/WEB-INF03">
- <include name="jboss-web.xml"/>
- </webinf>
</war>
<jar jarfile="${tests.output.dir}/libs/jaxws-samples-webservice01-ejb3.jar">
<fileset dir="${tests.output.dir}/classes">
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/build.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -116,18 +116,6 @@
<format property="build.id" pattern="yyyyMMddHHmm"/>
</tstamp>
- <!-- Define the jbossws.core.jar -->
- <condition property="jbossws.core.jar" value="${core.output.lib.dir}/jbossws-core.jar">
- <isset property="HAVE_JDK_1.5"/>
- </condition>
- <property name="jbossws.core.jar" value="${jboss40.output.lib.dir}/jbossws14-core.jar"/>
-
- <!-- Define the jbossws.client.jar -->
- <condition property="jbossws.client.jar" value="${core.output.lib.dir}/jbossws-client.jar">
- <isset property="HAVE_JDK_1.5"/>
- </condition>
- <property name="jbossws.client.jar" value="${jboss40.output.lib.dir}/jbossws14-client.jar"/>
-
<!-- Define excluded tests -->
<condition property="excludes-short-name" value="tests-${jbossws.integration.target}-excludes.txt">
<or>
@@ -156,10 +144,14 @@
<target name="common-classpath" depends="prepare,thirdparty">
- <!-- The combined compile classpath -->
- <path id="jbossws.jars.classpath">
- <pathelement location="${jbossws.core.jar}"/>
- <pathelement location="${jbossws.client.jar}"/>
+ <condition property="jbossws.classpath" value="jbossws.classpath.jdk15">
+ <isset property="HAVE_JDK_1.5"/>
+ </condition>
+ <property name="jbossws.classpath" value="jbossws.classpath.jdk14"/>
+
+ <path id="jbossws.classpath.jdk15">
+ <pathelement location="${core.output.lib.dir}/jbossws-core.jar"/>
+ <pathelement location="${core.output.lib.dir}/jbossws-client.jar"/>
<pathelement location="${core.output.lib.dir}/jboss-jaxrpc.jar"/>
<pathelement location="${core.output.lib.dir}/jboss-jaxws.jar"/>
<pathelement location="${core.output.lib.dir}/jboss-saaj.jar"/>
@@ -168,11 +160,20 @@
<pathelement location="${jboss40.output.lib.dir}/jbossws-jboss40-integration.jar"/>
<pathelement location="${tomcat.output.lib.dir}/jbossws-tomcat-integration.jar"/>
</path>
-
+
+ <path id="jbossws.classpath.jdk14">
+ <pathelement location="${core.output.lib.dir}/jboss-jaxrpc.jar"/>
+ <pathelement location="${core.output.lib.dir}/jboss-saaj.jar"/>
+ <pathelement location="${jboss40.output.lib.dir}/jbossws14-jboss40-integration.jar"/>
+ <pathelement location="${jboss40.output.lib.dir}/jbossws14-client.jar"/>
+ <pathelement location="${jboss40.output.lib.dir}/jbossws14-core.jar"/>
+ </path>
+ <path id="jbossws.classpath" refid="${jbossws.classpath}"/>
+
<!-- The combined compile classpath -->
<path id="javac.classpath">
<path refid="core.classpath"/>
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${thirdparty.dir}/activation.jar"/>
<pathelement location="${thirdparty.dir}/jboss-vfs.jar"/>
<pathelement location="${thirdparty.dir}/junit.jar"/>
@@ -190,7 +191,7 @@
<!-- The test client classpath -->
<path id="test.client.classpath">
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${jboss.client}/commons-logging.jar"/>
<pathelement location="${jboss.client}/jboss-backport-concurrent.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
@@ -209,7 +210,7 @@
<!-- The jBPM BPEL classpath -->
<path id="jbpm.bpel.classpath">
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${thirdparty.dir}/jbpm-bpel"/> <!-- jbpm.cfg.xml -->
<pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-bpel.jar" />
<pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-jpdl.jar" />
@@ -228,9 +229,12 @@
</target>
<target name="tomcat-classpath" depends="common-classpath" if="jbossws.integration.target.tomcat">
+
+ <fail message="jdk-1.5 is required for Tomcat integration" unless="HAVE_JDK_1.5"/>
+
<!-- The test client classpath -->
<path id="test.client.classpath">
- <path refid="jbossws.jars.classpath"/>
+ <path refid="jbossws.classpath"/>
<pathelement location="${tomcat.common.lib}/jbossws-thirdparty.jar"/>
<path refid="javac.classpath"/>
</path>
@@ -350,10 +354,7 @@
<!-- generate mapping artifacts -->
<taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
<classpath refid="core.classpath"/>
- <classpath location="${jbossws.core.jar}"/>
- <classpath location="${core.output.lib.dir}/jboss-jaxrpc.jar"/>
- <classpath location="${core.output.lib.dir}/jboss-jaxws.jar"/>
- <classpath location="${core.output.lib.dir}/jboss-saaj.jar"/>
+ <classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/jbossretro-rt.jar"/>
<classpath location="${thirdparty.dir}/jboss-backport-concurrent.jar"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
@@ -458,8 +459,8 @@
<sysproperty key="tomcat.home" value="${tomcat.home}"/>
<sysproperty key="tomcat.manager.password" value="${tomcat.manager.password}"/>
<sysproperty key="tomcat.manager.username" value="${tomcat.manager.username}"/>
- <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
@@ -500,8 +501,8 @@
<sysproperty key="tomcat.manager.username" value="${tomcat.manager.username}"/>
<!--
http://jira.jboss.com/jira/browse/JBWS-917
- <sysproperty key="javax.net.ssl.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="javax.net.ssl.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="javax.net.ssl.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="javax.net.ssl.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="javax.net.ssl.keyStorePassword" value="jbossws"/>
<sysproperty key="javax.net.ssl.trustStorePassword" value="jbossws"/>
<sysproperty key="javax.net.ssl.keyStoreType" value="jks"/>
@@ -509,8 +510,8 @@
-->
<!-- HTTPS hostname wrong: should be <localhost> -->
<sysproperty key="org.jboss.security.ignoreHttpsHost" value="true"/>
- <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.keystore"/>
- <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/wsse/wsse.truststore"/>
+ <sysproperty key="org.jboss.ws.wsse.keyStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.keystore"/>
+ <sysproperty key="org.jboss.ws.wsse.trustStore" value="${tests.resources.dir}/jaxrpc/samples/wssecurity/wsse.truststore"/>
<sysproperty key="org.jboss.ws.wsse.keyStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.trustStorePassword" value="jbossws"/>
<sysproperty key="org.jboss.ws.wsse.keyStoreType" value="jks"/>
Modified: trunk/jbossws-tests/src/main/README_XERCES
===================================================================
--- trunk/jbossws-tests/src/main/README_XERCES 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/README_XERCES 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,4 +1,6 @@
-This is a xerces bug. The problem is that the latest version of ant only bundles 2.6.2, you need at least 2.7.0 for this not to happen. So all you need to do is update your version of ant. I actually use the one in jboss-head/tools, although you have to drop log4j.jar in jboss-head/tools/lib.
+This is a xerces bug. The problem is that the latest version of ant only bundles 2.6.2, you need at least 2.7.0 for this not to happen.
+So all you need to do is update your version of ant. I actually use the one in jboss-head/tools, although you have to drop log4j.jar
+in jboss-head/tools/lib.
-Jason
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -169,7 +169,7 @@
integrationTarget = jbossVersion;
}
}
- catch (Exception ex)
+ catch (Throwable th)
{
// ignore, we are not running on jboss-4.2 or greater
}
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -74,12 +74,6 @@
public void testWebService() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
OrderStatus result = orderMgmtWS.prepareOrder(ORDER);
assertNotNull("Result was null", result);
assertEquals("Prepared", result.getStatus());
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean01.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean01.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean01.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -40,7 +40,7 @@
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@WebContext(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(urlPattern="/*")
public class EJB21Bean01 implements SessionBean
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean02.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean02.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB21Bean02.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -42,7 +42,7 @@
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService", wsdlLocation = "META-INF/wsdl/TestService.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@WebContext(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(urlPattern="/*")
public class EJB21Bean02 implements SessionBean
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean01.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean01.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean01.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -37,7 +37,7 @@
* @since 29-Apr-2005
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
-@WebContext(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean02.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean02.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EJB3Bean02.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -41,7 +41,7 @@
* @since 29-Apr-2005
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService", wsdlLocation = "META-INF/wsdl/TestService.wsdl")
-@WebContext(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/EndpointInterface03.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -36,7 +36,7 @@
* @since 29-Apr-2005
*/
@WebService(targetNamespace = "http://foo")
-@WebContext(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface03 extends Remote
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceBase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceBase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceBase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.samples.webservice;
+//$Id$
+
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
@@ -29,69 +31,54 @@
import javax.xml.ws.Service;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
-// $Id$
-
/**
- * Base testing class for @WebService
+ * Base testing class for @WebService
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
*/
public class JSR181WebServiceBase extends JBossWSTest
{
- private EndpointInterface getPort() throws MalformedURLException
+ private EndpointInterface getPort(String context) throws MalformedURLException
{
QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "TestService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/" + context + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
return service.getPort(EndpointInterface.class);
}
- private EndpointInterface03 getPort03() throws MalformedURLException
+ private EndpointInterface03 getPort03(String context) throws MalformedURLException
{
QName serviceName = new QName("http://foo", "TestService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/" + context + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
return service.getPort(EndpointInterface03.class);
}
- private void sayHello() throws RemoteException, MalformedURLException
+ private void sayHello(String context) throws RemoteException, MalformedURLException
{
- assertWSDLAccess();
String helloWorld = "Hello world!";
- Object retObj = getPort().echo(helloWorld);
+ Object retObj = getPort(context).echo(helloWorld);
assertEquals(helloWorld, retObj);
}
- public void webServiceTest() throws Exception
+ public void webServiceTest(String context) throws Exception
{
- sayHello();
+ sayHello(context);
}
- public void webServiceWsdlLocationTest() throws Exception
+ public void webServiceWsdlLocationTest(String context) throws Exception
{
- sayHello();
+ sayHello(context);
}
- public void webServiceEndpointInterfaceTest() throws Exception
+ public void webServiceEndpointInterfaceTest(String context) throws Exception
{
- assertWSDLAccess();
String helloWorld = "Hello Interface!";
- Object retObj = getPort03().echo(helloWorld);
+ Object retObj = getPort03(context).echo(helloWorld);
assertEquals(helloWorld, retObj);
}
-
- private void assertWSDLAccess() throws MalformedURLException
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
- }
}
\ No newline at end of file
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceEJB3TestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceEJB3TestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceEJB3TestCase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -64,7 +64,7 @@
deploy("jaxws-samples-webservice01-ejb3.jar");
try
{
- webServiceTest();
+ webServiceTest("jaxws-samples-webservice01-ejb3");
}
finally
{
@@ -77,7 +77,7 @@
deploy("jaxws-samples-webservice02-ejb3.jar");
try
{
- webServiceWsdlLocationTest();
+ webServiceWsdlLocationTest("jaxws-samples-webservice02-ejb3");
}
finally
{
@@ -90,7 +90,7 @@
deploy("jaxws-samples-webservice03-ejb3.jar");
try
{
- webServiceEndpointInterfaceTest();
+ webServiceEndpointInterfaceTest("jaxws-samples-webservice03-ejb3");
}
finally
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceJSETestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceJSETestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceJSETestCase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -44,7 +44,7 @@
deploy("jaxws-samples-webservice01-jse.war");
try
{
- webServiceTest();
+ webServiceTest("jaxws-samples-webservice01-jse");
}
finally
{
@@ -57,7 +57,7 @@
deploy("jaxws-samples-webservice02-jse.war");
try
{
- webServiceWsdlLocationTest();
+ webServiceWsdlLocationTest("jaxws-samples-webservice02-jse");
}
finally
{
@@ -70,7 +70,7 @@
deploy("jaxws-samples-webservice03-jse.war");
try
{
- webServiceEndpointInterfaceTest();
+ webServiceEndpointInterfaceTest("jaxws-samples-webservice03-jse");
}
finally
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -72,12 +72,6 @@
public void testEJB3Client() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
deploy("jaxws-samples-webserviceref-ejb3-client.jar");
try
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2007-02-05 20:41:17 UTC (rev 2282)
@@ -73,12 +73,6 @@
public void testServletClient() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
deploy("jaxws-samples-webserviceref-servlet-client.war");
try
{
Deleted: trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/keystore.password
===================================================================
(Binary files differ)
Deleted: trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.keystore
===================================================================
(Binary files differ)
Copied: trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.keystore (from rev 2280, branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.keystore)
===================================================================
(Binary files differ)
Deleted: trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.truststore
===================================================================
(Binary files differ)
Copied: trunk/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.truststore (from rev 2280, branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/wsse/wsse.truststore)
===================================================================
(Binary files differ)
Deleted: trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF01/jboss-web.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF01/jboss-web.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF01/jboss-web.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-web>
- <context-root>/jsr181</context-root>
-</jboss-web>
-
Deleted: trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF02/jboss-web.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF02/jboss-web.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF02/jboss-web.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-web>
- <context-root>/jsr181</context-root>
-</jboss-web>
-
Deleted: trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF03/jboss-web.xml
===================================================================
--- trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF03/jboss-web.xml 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/jaxws/samples/webservice/WEB-INF03/jboss-web.xml 2007-02-05 20:41:17 UTC (rev 2282)
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jboss-web>
- <context-root>/jsr181</context-root>
-</jboss-web>
-
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-02-05 20:41:17 UTC (rev 2282)
@@ -6,4 +6,5 @@
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
+org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
Modified: trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 20:41:17 UTC (rev 2282)
@@ -5,5 +5,5 @@
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
-org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
+org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.*
org/jboss/test/ws/jaxws/samples/webserviceref/**
Modified: trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt
===================================================================
--- trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt 2007-02-05 17:09:51 UTC (rev 2281)
+++ trunk/jbossws-tests/src/main/resources/tests-tomcat-excludes.txt 2007-02-05 20:41:17 UTC (rev 2282)
@@ -11,6 +11,7 @@
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.*
org/jboss/test/ws/jaxws/samples/jsr181ejb/**
org/jboss/test/ws/jaxws/samples/retail/**
+org/jboss/test/ws/jaxws/samples/webservice/JSR181WebServiceEJB3TestCase.*
org/jboss/test/ws/jaxws/samples/webserviceref/**
# JBoss excludes
@@ -23,3 +24,7 @@
# [JBWS-1471] - Remove unwanted tomcat excludes
org/jboss/test/ws/jaxrpc/samples/wssecurity/StorePassEncryptTestCase.*
org/jboss/test/ws/jaxws/samples/wseventing/**
+
+# [JBWS-1503] - Support XOP samples in tomcat
+org/jboss/test/ws/jaxrpc/samples/xop/**
+org/jboss/test/ws/jaxws/samples/xop/**
17 years, 3 months
JBossWS SVN: r2281 - in trunk: jbossws-core/src/main/java/org/jboss/ws/core/soap and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-05 12:09:51 -0500 (Mon, 05 Feb 2007)
New Revision: 2281
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
Log:
Revert DOMWriter changes
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-02-05 13:45:04 UTC (rev 2280)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-02-05 17:09:51 UTC (rev 2281)
@@ -140,7 +140,7 @@
completeHost = reqProtocol + "://" + hostAndPort;
}
- String newLocation = completeHost + reqPath + "?wsdl&resource=" + newResourcePath;
+ String newLocation = completeHost + reqPath + "?wsdl&resource=" + newResourcePath;
locationAttr.setNodeValue(newLocation);
log.trace("Mapping import from '" + orgLocation + "' to '" + newLocation + "'");
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-02-05 13:45:04 UTC (rev 2280)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-02-05 17:09:51 UTC (rev 2281)
@@ -108,7 +108,7 @@
{
Element srcElement = (Element)it.next();
//registerNamespacesLocally(srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false, true);
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
SOAPContentElement destElement = new SOAPHeaderElementImpl(name);
@@ -202,7 +202,7 @@
DOMUtils.copyAttributes(destElement, srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false, true);
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
destElement.setXMLFragment(xmlFragment);
}
}
@@ -215,7 +215,7 @@
DOMUtils.copyAttributes(destElement, srcElement);
- String xmlFragment = DOMWriter.printNode(srcElement, false, true);
+ String xmlFragment = DOMWriter.printNode(srcElement, false);
destElement.setXMLFragment(xmlFragment);
}
else if (style == null)
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2007-02-05 13:45:04 UTC (rev 2280)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2007-02-05 17:09:51 UTC (rev 2281)
@@ -187,8 +187,6 @@
org.w3c.dom.Node child = (org.w3c.dom.Node)getFirstChild();
- value = DOMWriter.normalize(value, false);
-
if (child instanceof org.w3c.dom.Text)
((org.w3c.dom.Text)child).setNodeValue(value);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMWriter.java 2007-02-05 13:45:04 UTC (rev 2280)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/utils/DOMWriter.java 2007-02-05 17:09:51 UTC (rev 2281)
@@ -57,14 +57,23 @@
// $Id$
-import org.jboss.logging.Logger;
-import org.w3c.dom.*;
-
-import java.io.*;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.jboss.logging.Logger;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
/**
* Traverse a DOM tree in order to print a document that is parsed.
*
@@ -94,8 +103,6 @@
// True if we want namespace completion
private boolean completeNamespaces = true;
- private boolean escapeCharacters = false;
-
public DOMWriter(Writer w)
{
this.out = new PrintWriter(w);
@@ -137,7 +144,7 @@
/**
* Print a node with explicit prettyprinting.
* The defaults for all other DOMWriter properties apply.
- * Special characters will not be escaped.
+ *
*/
public static String printNode(Node node, boolean prettyprint)
{
@@ -146,19 +153,6 @@
return strw.toString();
}
- /**
- * Print a node with explicit prettyprinting.
- * Special characters can be escaped. This is idiot proof
- * but can be very expensive.
- *
- */
- public static String printNode(Node node, boolean prettyprint, boolean escape)
- {
- StringWriter strw = new StringWriter();
- new DOMWriter(strw).setPrettyprint(prettyprint).setEscapeCharacters(escape).print(node);
- return strw.toString();
- }
-
public boolean isCanonical()
{
return canonical;
@@ -174,11 +168,6 @@
return this;
}
- public DOMWriter setEscapeCharacters(boolean b)
- {
- this.escapeCharacters = b;
- return this;
- }
/**
* Set wheter subelements should have their namespaces completed.
* Setting this to false may lead to invalid XML fragments.
@@ -298,7 +287,7 @@
Attr attr = attrs[i];
String atPrefix = attr.getPrefix();
String atName = attr.getNodeName();
- String atValue = escapeCharacters ? normalize(attr.getNodeValue(), canonical) : attr.getNodeValue();
+ String atValue = normalize(attr.getNodeValue(), canonical);
if (atPrefix != null && !atPrefix.equals("xmlns") && !atPrefix.equals("xml"))
{
@@ -405,7 +394,7 @@
// print text
case Node.TEXT_NODE:
{
- String text = escapeCharacters ? normalize(node.getNodeValue(), canonical) : node.getNodeValue();
+ String text = normalize(node.getNodeValue(), canonical);
if (prettyprint == false || text.trim().length() > 0)
out.print(text);
break;
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-02-05 13:45:04 UTC (rev 2280)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-02-05 17:09:51 UTC (rev 2281)
@@ -189,7 +189,7 @@
Element domEl = DOMUtils.parse(expStr);
- String wasStr = DOMWriter.printNode(domEl, false, true);
+ String wasStr = DOMWriter.printNode(domEl, false);
assertEquals(expStr, wasStr);
}
17 years, 3 months
JBossWS SVN: r2280 - in branches/jbossws-1.2.0: integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42 and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-05 08:45:04 -0500 (Mon, 05 Feb 2007)
New Revision: 2280
Added:
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java
Removed:
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
Modified:
branches/jbossws-1.2.0/build/etc/default.mf
branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
Log:
[JBWS-1438] - Implement @WebServiceRef injection for JBossAS-4.2
Modified: branches/jbossws-1.2.0/build/etc/default.mf
===================================================================
--- branches/jbossws-1.2.0/build/etc/default.mf 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/build/etc/default.mf 2007-02-05 13:45:04 UTC (rev 2280)
@@ -5,6 +5,6 @@
Specification-Vendor: @specification.vendor@
Implementation-Title: @implementation.title@
Implementation-URL: @implementation.url@
-Implementation-Version: @implementation.version@ (date=(a)build.id@)
+Implementation-Version: @implementation.version@ (build=(a)build.id@)
Implementation-Vendor: @implementation.vendor@
Implementation-Vendor-Id: @implementation.vendor.id@
Added: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java (rev 0)
+++ branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.ws.core.UnifiedVirtualFile;
+
+/**
+ * The default file adapter loads resources through an associated classloader.
+ * If no classload is set, the the thread context classloader will be used.
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @since 25.01.2007
+ */
+public class URLLoaderAdapter implements UnifiedVirtualFile
+{
+ private URL rootURL;
+ private URL resourceURL;
+ private transient URLClassLoader loader;
+
+ public URLLoaderAdapter(URL rootURL)
+ {
+ this.rootURL = rootURL;
+ }
+
+ private URLLoaderAdapter(URL rootURL, URLClassLoader loader, URL resourceURL)
+ {
+ this.rootURL = rootURL;
+ this.resourceURL = resourceURL;
+ this.loader = loader;
+ }
+
+ public UnifiedVirtualFile findChild(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null)
+ {
+ // Try the child as URL
+ try
+ {
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (resourceURL == null)
+ {
+ try
+ {
+ File file = new File(resourcePath);
+ if (file.exists())
+ resourceURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (resourceURL == null)
+ {
+ try
+ {
+ resourceURL = getResourceLoader().getResource(resourcePath);
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
+ }
+ }
+
+ if (resourceURL == null)
+ throw new IOException("Cannot get URL for: " + resourcePath);
+
+ return new URLLoaderAdapter(rootURL, loader, resourceURL);
+ }
+
+ public URL toURL()
+ {
+ if (null == this.resourceURL)
+ throw new IllegalStateException("UnifiedVirtualFile not initialized");
+ return resourceURL;
+ }
+
+ private URLClassLoader getResourceLoader()
+ {
+ if (loader == null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ loader = new URLClassLoader(new URL[]{rootURL}, ctxLoader);
+ }
+ return loader;
+ }
+}
Property changes on: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/URLLoaderAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java (rev 0)
+++ branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.integration.jboss42;
+
+// $Id$
+
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+
+import javax.management.MBeanServer;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.core.jaxws.UnifiedWebServiceRefHandler;
+
+/**
+ * Binds a JAXWS @WebServiceRef object in the client's ENC
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class WebServiceRefHandler extends UnifiedWebServiceRefHandler implements WebServiceRefHandlerMBean
+{
+ public void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, URL rootURL, Source metadata) throws NamingException
+ {
+ setupWebServiceRef(encCtx, encName, anElement, new URLLoaderAdapter(rootURL), metadata);
+ }
+
+ public void create() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ server.registerMBean(this, OBJECT_NAME);
+ }
+
+ public void destroy() throws Exception
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ if (server != null)
+ server.unregisterMBean(OBJECT_NAME);
+ }
+}
Property changes on: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java (rev 0)
+++ branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.ws.integration.jboss42;
+
+
+import java.lang.reflect.AnnotatedElement;
+import java.net.URL;
+
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ */
+public interface WebServiceRefHandlerMBean
+{
+ // default object name
+ public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceRefHandler");
+
+ /** Binds a JAXWS WebServiceRef into the callers ENC
+ */
+ void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement enElement, URL rootURL, Source metadata) throws NamingException;
+}
Property changes on: branches/jbossws-1.2.0/integration-jboss42/src/main/java/org/jboss/ws/integration/jboss42/WebServiceRefHandlerMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/integration-jboss42/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-02-05 13:45:04 UTC (rev 2280)
@@ -36,6 +36,9 @@
<property name="serviceEndpointServlet">org.jboss.ws.integration.jboss42.JBossServiceEndpointServlet</property>
</bean>
+ <!-- Bind JAXWS Service objects in client environment context -->
+ <bean name="WebServiceRefHandler" class="org.jboss.ws.integration.jboss42.WebServiceRefHandler"/>
+
<!-- A subscription manager for WS-Eventing -->
<bean name="SubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
Deleted: branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java
===================================================================
--- branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -1,187 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.integration.jboss50;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.client.NameValuePair;
-import org.jboss.ws.core.jaxws.client.PortInfo;
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * An ObjectModelFactory for UnifiedServiceRef
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2007
- */
-public class UnifiedServiceRefObjectFactory implements ObjectModelFactory
-{
- // Hide constructor
- private UnifiedServiceRefObjectFactory()
- {
- }
-
- public static UnifiedServiceRefObjectFactory newInstance()
- {
- return new UnifiedServiceRefObjectFactory();
- }
-
- public UnifiedServiceRef parse(Source source)
- {
- // setup the XML binding Unmarshaller
- try
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- StreamResult result = new StreamResult(baos);
- TransformerFactory tf = TransformerFactory.newInstance();
- tf.newTransformer().transform(source, result);
-
- InputStream is = new ByteArrayInputStream(baos.toByteArray());
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- return (UnifiedServiceRef)unmarshaller.unmarshal(is, this, null);
- }
- catch (Exception ex)
- {
- WSException.rethrow(ex);
- return null;
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return new UnifiedServiceRef();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
- {
- return root;
- }
-
- public void setValue(UnifiedServiceRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("service-ref-name"))
- {
- ref.setServiceRefName(value);
- }
- else if (localName.equals("service-class-name"))
- {
- ref.setServiceClassName(value);
- }
- else if (localName.equals("service-qname"))
- {
- ref.setServiceQName(QName.valueOf(value));
- }
- else if (localName.equals("config-name"))
- {
- ref.setConfigName(value);
- }
- else if (localName.equals("config-file"))
- {
- ref.setConfigFile(value);
- }
- else if (localName.equals("handler-chain"))
- {
- ref.setHandlerChain(value);
- }
- else if (localName.equals("wsdl-override"))
- {
- ref.setWsdlLocation(value);
- }
- }
-
- public Object newChild(UnifiedServiceRef parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- Object child = null;
-
- if (localName.equals("port-info"))
- child = new PortInfo(parent);
-
- return child;
- }
-
- public void addChild(UnifiedServiceRef parent, PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- parent.getPortInfos().add(portInfo);
- }
-
- public void setValue(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("service-endpoint-interface"))
- {
- portInfo.setServiceEndpointInterface(value);
- }
- else if (localName.equals("port-qname"))
- {
- portInfo.setPortQName(QName.valueOf(value));
- }
- else if (localName.equals("config-name"))
- {
- portInfo.setConfigName(value);
- }
- else if (localName.equals("config-file"))
- {
- portInfo.setConfigFile(value);
- }
- }
-
- public Object newChild(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- Object child = null;
- if (localName.equals("stub-property"))
- child = new NameValuePair();
- return child;
- }
-
- public void addChild(PortInfo parent, NameValuePair stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- parent.getStubProperties().add(stubProp);
- }
-
- public void setValue(NameValuePair nvPair, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (localName.equals("name"))
- {
- nvPair.setName(value);
- }
- else if (localName.equals("value"))
- {
- nvPair.setValue(value);
- }
- }
-}
Modified: branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java
===================================================================
--- branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/WebServiceRefHandler.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -23,171 +23,30 @@
// $Id$
-import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import javax.jws.HandlerChain;
import javax.management.MBeanServer;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.xml.transform.Source;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceRef;
-import javax.xml.ws.WebServiceRefs;
-import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.util.naming.Util;
import org.jboss.virtual.VirtualFile;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxws.client.ServiceReferenceable;
-import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.ws.core.jaxws.UnifiedWebServiceRefHandler;
/**
- * Binds a JAXWS Service object in the client's ENC
+ * Binds a JAXWS @WebServiceRef object in the client's ENC
*
* @author Thomas.Diesler(a)jboss.org
* @since 17-Jan-2007
*/
-public class WebServiceRefHandler implements WebServiceRefHandlerMBean
+public class WebServiceRefHandler extends UnifiedWebServiceRefHandler implements WebServiceRefHandlerMBean
{
- // logging support
- private static Logger log = Logger.getLogger(WebServiceRefHandler.class);
-
public void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, VirtualFile vfsRoot, Source metadata) throws NamingException
{
- WebServiceRef wsref = null;
-
- // Build the list of @WebServiceRef relevant annotations
- List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
- for (Annotation an : anElement.getAnnotations())
- {
- if (an instanceof WebServiceRef)
- wsrefList.add((WebServiceRef)an);
-
- if (an instanceof WebServiceRefs)
- {
- WebServiceRefs wsrefs = (WebServiceRefs)an;
- for (WebServiceRef aux : wsrefs.value())
- wsrefList.add(aux);
- }
- }
-
- // Use the single @WebServiceRef
- if (wsrefList.size() == 1)
- {
- wsref = wsrefList.get(0);
- }
- else
- {
- for (WebServiceRef aux : wsrefList)
- {
- if (encName.endsWith("/" + aux.name()))
- {
- wsref = aux;
- break;
- }
- }
- }
-
- if (wsref == null)
- throw new IllegalArgumentException("@WebServiceRef must be present on: " + anElement);
-
- Class targetClass = null;
- if (anElement instanceof Field)
- targetClass = ((Field)anElement).getType();
- else if (anElement instanceof Method)
- targetClass = ((Method)anElement).getParameterTypes()[0];
-
- String externalName = encCtx.getNameInNamespace() + "/" + encName;
- String targetClassName = (targetClass != null ? targetClass.getName() : null);
- log.debug("setupWebServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
-
- String serviceClassName = null;
-
- // #1 Use the explicit @WebServiceRef.value
- if (wsref.value() != Object.class)
- serviceClassName = wsref.value().getName();
-
- // #2 Use the target ref type
- if (serviceClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
- serviceClassName = targetClass.getName();
-
- // #3 Use javax.xml.ws.Service
- if (serviceClassName == null)
- serviceClassName = Service.class.getName();
-
- // #1 Use the explicit @WebServiceRef.type
- if (wsref.type() != Object.class)
- targetClassName = wsref.type().getName();
-
- // #2 Use the target ref type
- if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
- targetClassName = targetClass.getName();
-
- try
- {
- UnifiedServiceRefObjectFactory factory = UnifiedServiceRefObjectFactory.newInstance();
- UnifiedServiceRef usRef = factory.parse(metadata);
- usRef.setRootFile(new VirtualFileAdaptor(vfsRoot));
-
- // Set the wsdlLocation if there is no override already
- if (usRef.getWsdlLocation() == null && wsref.wsdlLocation().length() > 0)
- usRef.setWsdlLocation(wsref.wsdlLocation());
-
- // Set the handlerChain from @HandlerChain on the annotated element
- String handlerChain = usRef.getHandlerChain();
- HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
- if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
- handlerChain = anHandlerChain.file();
-
- // Resolve path to handler chain
- if (handlerChain != null)
- {
- try
- {
- new URL(handlerChain);
- }
- catch (MalformedURLException ex)
- {
- Class declaringClass = null;
- if (anElement instanceof Field)
- declaringClass = ((Field)anElement).getDeclaringClass();
- else if (anElement instanceof Method)
- declaringClass = ((Method)anElement).getDeclaringClass();
- else if (anElement instanceof Class)
- declaringClass = (Class)anElement;
-
- handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
- VirtualFile vfHandlerChain = vfsRoot.findChild(handlerChain);
- if (vfHandlerChain == null)
- throw new IllegalStateException("Cannot find handler chain: " + handlerChain);
- }
- usRef.setHandlerChain(handlerChain);
- }
-
- // Do not use rebind, the binding should be unique
- // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
- Util.rebind(encCtx, encName, new ServiceReferenceable(serviceClassName, targetClassName, usRef));
-
- log.debug("<service-ref> bound to: java:comp/env/" + encName);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot bind web service ref: " + encName, ex);
- }
+ setupWebServiceRef(encCtx, encName, anElement, new VirtualFileAdaptor(vfsRoot), metadata);
}
-
+
public void create() throws Exception
{
MBeanServer server = MBeanServerLocator.locateJBoss();
Copied: branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java (from rev 2273, branches/jbossws-1.2.0/integration-jboss50/src/main/java/org/jboss/ws/integration/jboss50/UnifiedServiceRefObjectFactory.java)
===================================================================
--- branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java (rev 0)
+++ branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedServiceRefObjectFactory.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxws.client.NameValuePair;
+import org.jboss.ws.core.jaxws.client.PortInfo;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * An ObjectModelFactory for UnifiedServiceRef
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class UnifiedServiceRefObjectFactory implements ObjectModelFactory
+{
+ // Hide constructor
+ private UnifiedServiceRefObjectFactory()
+ {
+ }
+
+ public static UnifiedServiceRefObjectFactory newInstance()
+ {
+ return new UnifiedServiceRefObjectFactory();
+ }
+
+ public UnifiedServiceRef parse(Source source)
+ {
+ // setup the XML binding Unmarshaller
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ StreamResult result = new StreamResult(baos);
+ TransformerFactory tf = TransformerFactory.newInstance();
+ tf.newTransformer().transform(source, result);
+
+ InputStream is = new ByteArrayInputStream(baos.toByteArray());
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ return (UnifiedServiceRef)unmarshaller.unmarshal(is, this, null);
+ }
+ catch (Exception ex)
+ {
+ WSException.rethrow(ex);
+ return null;
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new UnifiedServiceRef();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ public void setValue(UnifiedServiceRef ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-ref-name"))
+ {
+ ref.setServiceRefName(value);
+ }
+ else if (localName.equals("service-class-name"))
+ {
+ ref.setServiceClassName(value);
+ }
+ else if (localName.equals("service-qname"))
+ {
+ ref.setServiceQName(QName.valueOf(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ ref.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ ref.setConfigFile(value);
+ }
+ else if (localName.equals("handler-chain"))
+ {
+ ref.setHandlerChain(value);
+ }
+ else if (localName.equals("wsdl-override"))
+ {
+ ref.setWsdlLocation(value);
+ }
+ }
+
+ public Object newChild(UnifiedServiceRef parent, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+
+ if (localName.equals("port-info"))
+ child = new PortInfo(parent);
+
+ return child;
+ }
+
+ public void addChild(UnifiedServiceRef parent, PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getPortInfos().add(portInfo);
+ }
+
+ public void setValue(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("service-endpoint-interface"))
+ {
+ portInfo.setServiceEndpointInterface(value);
+ }
+ else if (localName.equals("port-qname"))
+ {
+ portInfo.setPortQName(QName.valueOf(value));
+ }
+ else if (localName.equals("config-name"))
+ {
+ portInfo.setConfigName(value);
+ }
+ else if (localName.equals("config-file"))
+ {
+ portInfo.setConfigFile(value);
+ }
+ }
+
+ public Object newChild(PortInfo portInfo, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ Object child = null;
+ if (localName.equals("stub-property"))
+ child = new NameValuePair();
+ return child;
+ }
+
+ public void addChild(PortInfo parent, NameValuePair stubProp, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ parent.getStubProperties().add(stubProp);
+ }
+
+ public void setValue(NameValuePair nvPair, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (localName.equals("name"))
+ {
+ nvPair.setName(value);
+ }
+ else if (localName.equals("value"))
+ {
+ nvPair.setValue(value);
+ }
+ }
+}
Added: branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java (rev 0)
+++ branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.jaxws;
+
+// $Id$
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+import org.jboss.logging.Logger;
+import org.jboss.util.naming.Util;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.UnifiedVirtualFile;
+import org.jboss.ws.core.jaxws.client.ServiceReferenceable;
+import org.jboss.ws.core.jaxws.client.UnifiedServiceRef;
+
+/**
+ * Binds a JAXWS Service object in the client's ENC
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2007
+ */
+public class UnifiedWebServiceRefHandler
+{
+ // logging support
+ private static Logger log = Logger.getLogger(UnifiedWebServiceRefHandler.class);
+
+ protected void setupWebServiceRef(Context encCtx, String encName, AnnotatedElement anElement, UnifiedVirtualFile vfsRoot, Source metadata) throws NamingException
+ {
+ WebServiceRef wsref = null;
+
+ // Build the list of @WebServiceRef relevant annotations
+ List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
+ for (Annotation an : anElement.getAnnotations())
+ {
+ if (an instanceof WebServiceRef)
+ wsrefList.add((WebServiceRef)an);
+
+ if (an instanceof WebServiceRefs)
+ {
+ WebServiceRefs wsrefs = (WebServiceRefs)an;
+ for (WebServiceRef aux : wsrefs.value())
+ wsrefList.add(aux);
+ }
+ }
+
+ // Use the single @WebServiceRef
+ if (wsrefList.size() == 1)
+ {
+ wsref = wsrefList.get(0);
+ }
+ else
+ {
+ for (WebServiceRef aux : wsrefList)
+ {
+ if (encName.endsWith("/" + aux.name()))
+ {
+ wsref = aux;
+ break;
+ }
+ }
+ }
+
+ if (wsref == null)
+ throw new IllegalArgumentException("@WebServiceRef must be present on: " + anElement);
+
+ Class targetClass = null;
+ if (anElement instanceof Field)
+ targetClass = ((Field)anElement).getType();
+ else if (anElement instanceof Method)
+ targetClass = ((Method)anElement).getParameterTypes()[0];
+
+ String externalName = encCtx.getNameInNamespace() + "/" + encName;
+ String targetClassName = (targetClass != null ? targetClass.getName() : null);
+ log.debug("setupWebServiceRef [jndi=" + externalName + ",target=" + targetClassName + "]");
+
+ String serviceClassName = null;
+
+ // #1 Use the explicit @WebServiceRef.value
+ if (wsref.value() != Object.class)
+ serviceClassName = wsref.value().getName();
+
+ // #2 Use the target ref type
+ if (serviceClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass))
+ serviceClassName = targetClass.getName();
+
+ // #3 Use javax.xml.ws.Service
+ if (serviceClassName == null)
+ serviceClassName = Service.class.getName();
+
+ // #1 Use the explicit @WebServiceRef.type
+ if (wsref.type() != Object.class)
+ targetClassName = wsref.type().getName();
+
+ // #2 Use the target ref type
+ if (targetClassName == null && targetClass != null && Service.class.isAssignableFrom(targetClass) == false)
+ targetClassName = targetClass.getName();
+
+ try
+ {
+ UnifiedServiceRefObjectFactory factory = UnifiedServiceRefObjectFactory.newInstance();
+ UnifiedServiceRef usRef = factory.parse(metadata);
+ usRef.setRootFile(vfsRoot);
+
+ // Set the wsdlLocation if there is no override already
+ if (usRef.getWsdlLocation() == null && wsref.wsdlLocation().length() > 0)
+ usRef.setWsdlLocation(wsref.wsdlLocation());
+
+ // Set the handlerChain from @HandlerChain on the annotated element
+ String handlerChain = usRef.getHandlerChain();
+ HandlerChain anHandlerChain = anElement.getAnnotation(HandlerChain.class);
+ if (handlerChain == null && anHandlerChain != null && anHandlerChain.file().length() > 0)
+ handlerChain = anHandlerChain.file();
+
+ // Resolve path to handler chain
+ if (handlerChain != null)
+ {
+ try
+ {
+ new URL(handlerChain);
+ }
+ catch (MalformedURLException ex)
+ {
+ Class declaringClass = null;
+ if (anElement instanceof Field)
+ declaringClass = ((Field)anElement).getDeclaringClass();
+ else if (anElement instanceof Method)
+ declaringClass = ((Method)anElement).getDeclaringClass();
+ else if (anElement instanceof Class)
+ declaringClass = (Class)anElement;
+
+ handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
+ UnifiedVirtualFile vfHandlerChain = vfsRoot.findChild(handlerChain);
+ if (vfHandlerChain == null)
+ throw new IllegalStateException("Cannot find handler chain: " + handlerChain);
+ }
+ usRef.setHandlerChain(handlerChain);
+ }
+
+ // Do not use rebind, the binding should be unique
+ // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
+ Util.rebind(encCtx, encName, new ServiceReferenceable(serviceClassName, targetClassName, usRef));
+
+ log.debug("<service-ref> bound to: java:comp/env/" + encName);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot bind web service ref: " + encName, ex);
+ }
+ }
+}
Property changes on: branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/UnifiedWebServiceRefHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ResourceLoaderAdapter.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -39,7 +39,7 @@
*/
public class ResourceLoaderAdapter implements UnifiedVirtualFile
{
- private URL location;
+ private URL resourceURL;
private ClassLoader loader;
public ResourceLoaderAdapter()
@@ -52,9 +52,9 @@
this.loader = loader;
}
- private ResourceLoaderAdapter(ClassLoader loader, URL location)
+ private ResourceLoaderAdapter(ClassLoader loader, URL resourceURL)
{
- this.location = location;
+ this.resourceURL = resourceURL;
this.loader = loader;
}
@@ -110,13 +110,8 @@
public URL toURL()
{
- if (null == this.location)
+ if (null == this.resourceURL)
throw new IllegalStateException("UnifiedVirtualFile not initialized");
- return location;
+ return resourceURL;
}
-
- public ClassLoader getResourceLoader()
- {
- return loader;
- }
}
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefEJB3TestCase.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -72,12 +72,6 @@
public void testEJB3Client() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
deploy("jaxws-samples-webserviceref-ejb3-client.jar");
try
{
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/webserviceref/WebServiceRefServletTestCase.java 2007-02-05 13:45:04 UTC (rev 2280)
@@ -73,12 +73,6 @@
public void testServletClient() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
deploy("jaxws-samples-webserviceref-servlet-client.war");
try
{
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 12:19:56 UTC (rev 2279)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 13:45:04 UTC (rev 2280)
@@ -5,6 +5,5 @@
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
-org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
-org/jboss/test/ws/jaxws/samples/retail/**
+org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase.*
org/jboss/test/ws/jaxws/samples/webserviceref/**
17 years, 3 months
JBossWS SVN: r2279 - in branches/jbossws-1.2.0/jbossws-tests/src/main: resources and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-05 07:19:56 -0500 (Mon, 05 Feb 2007)
New Revision: 2279
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
Log:
Exclude samples retail
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2007-02-05 12:01:52 UTC (rev 2278)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/retail/RetailSampleTestCase.java 2007-02-05 12:19:56 UTC (rev 2279)
@@ -74,12 +74,6 @@
public void testWebService() throws Exception
{
- if (isTargetJBoss50() == false)
- {
- System.out.println("FIXME: [JBWS-1438] Implement @WebServiceRef injection for JBossAS-4.2");
- return;
- }
-
OrderStatus result = orderMgmtWS.prepareOrder(ORDER);
assertNotNull("Result was null", result);
assertEquals("Prepared", result.getStatus());
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-02-05 12:01:52 UTC (rev 2278)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss40-excludes.txt 2007-02-05 12:19:56 UTC (rev 2279)
@@ -6,4 +6,5 @@
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
+org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
Modified: branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 12:01:52 UTC (rev 2278)
+++ branches/jbossws-1.2.0/jbossws-tests/src/main/resources/tests-jboss42-excludes.txt 2007-02-05 12:19:56 UTC (rev 2279)
@@ -6,4 +6,5 @@
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/endpoint/**
org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
+org/jboss/test/ws/jaxws/samples/retail/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
17 years, 3 months
JBossWS SVN: r2278 - branches/hbraun.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-02-05 07:01:52 -0500 (Mon, 05 Feb 2007)
New Revision: 2278
Added:
branches/hbraun/1.2.0/
Log:
create user branch
Copied: branches/hbraun/1.2.0 (from rev 2277, branches/jbossws-1.2.0)
17 years, 3 months
JBossWS SVN: r2277 - branches/jbossws-1.2.0/jbossws-docs/user-guide/project/en/modules/wssecurity.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-05 06:59:56 -0500 (Mon, 05 Feb 2007)
New Revision: 2277
Modified:
branches/jbossws-1.2.0/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml
Log:
typo
Modified: branches/jbossws-1.2.0/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml
===================================================================
--- branches/jbossws-1.2.0/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml 2007-02-05 11:49:39 UTC (rev 2276)
+++ branches/jbossws-1.2.0/jbossws-docs/user-guide/project/en/modules/wssecurity/wssecurity.xml 2007-02-05 11:59:56 UTC (rev 2277)
@@ -349,7 +349,7 @@
</para>
<para>
- Where you put the jar is up to mostly up to you, although with jdk1.4 the best
+ Where you put the jar is mostly up to you, although with jdk1.4 the best
(and in some cases only) place to have it is in $JAVA_HOME/jre/lib/ext.
Under Windows there will normally be a JRE and a JDK install of Java if you think you have installed it
correctly and it still doesn't work chances are you have added the provider to the installation not being used.
17 years, 3 months
JBossWS SVN: r2276 - in branches/jbossws-1.2.0: integration-jboss40 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-02-05 06:49:39 -0500 (Mon, 05 Feb 2007)
New Revision: 2276
Modified:
branches/jbossws-1.2.0/build/ant-import/build-setup.xml
branches/jbossws-1.2.0/integration-jboss40/build.xml
branches/jbossws-1.2.0/integration-jboss42/build.xml
branches/jbossws-1.2.0/integration-jboss50/build.xml
Log:
Update compile target availablility
Modified: branches/jbossws-1.2.0/build/ant-import/build-setup.xml
===================================================================
--- branches/jbossws-1.2.0/build/ant-import/build-setup.xml 2007-02-05 11:19:25 UTC (rev 2275)
+++ branches/jbossws-1.2.0/build/ant-import/build-setup.xml 2007-02-05 11:49:39 UTC (rev 2276)
@@ -63,11 +63,16 @@
<property name="tomcat.common.lib" value="${tomcat.home}/common/lib"/>
<property name="tomcat.webapps.dir" value="${tomcat.home}/webapps"/>
- <available property="jboss50.available" file="${jboss50.client}/jboss-client.jar"/>
- <available property="jboss42.available" file="${jboss42.client}/jboss-client.jar"/>
- <available property="jboss40.available" file="${jboss40.client}/jboss-client.jar"/>
- <available property="tomcat.available" file="${tomcat.home}/server/lib/catalina.jar"/>
+ <property name="jboss50.available.file" value="${jboss50.client}/jboss-ejb3-client.jar"/>
+ <property name="jboss42.available.file" value="${jboss42.client}/jboss-ejb3-client.jar"/>
+ <property name="jboss40.available.file" value="${jboss40.client}/jboss-client.jar"/>
+ <property name="tomcat.available.file" value="${tomcat.home}/server/lib/catalina.jar"/>
+ <available property="jboss50.available" file="${jboss50.available.file}"/>
+ <available property="jboss42.available" file="${jboss42.available.file}"/>
+ <available property="jboss40.available" file="${jboss40.available.file}"/>
+ <available property="tomcat.available" file="${tomcat.available.file}"/>
+
<!-- JDK Detection -->
<available classname="java.lang.StackTraceElement" property="HAVE_JDK_1.4"/>
<available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
Modified: branches/jbossws-1.2.0/integration-jboss40/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-02-05 11:19:25 UTC (rev 2275)
+++ branches/jbossws-1.2.0/integration-jboss40/build.xml 2007-02-05 11:49:39 UTC (rev 2276)
@@ -11,7 +11,8 @@
<!-- $Id$ -->
-<project default="main" basedir="../integration-jboss40" name="JBossWS-jboss40">
+<project default="main" basedir="../integration-jboss40" name="JBossWS-jboss40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="schema.xsd">
<import file="${basedir}/../build/ant-import/build-thirdparty.xml"/>
<import file="${basedir}/../build/ant-import/build-setup.xml"/>
@@ -25,7 +26,7 @@
<property name="jboss40.output.classes.dir" value="${jboss40.output.dir}/classes"/>
<property name="jboss40.output.classes14.dir" value="${jboss40.output.dir}/classes14"/>
<property name="jboss40.output.lib.dir" value="${jboss40.output.dir}/lib"/>
-
+
<property name="jboss42.src.dir" value="${integration.jboss42.dir}/src/main"/>
<property name="jboss42.java.dir" value="${jboss42.src.dir}/java"/>
<property name="jboss42.resources.dir" value="${jboss42.src.dir}/resources"/>
@@ -33,9 +34,9 @@
<property name="jboss42.output.classes.dir" value="${jboss42.output.dir}/classes"/>
<property name="jboss42.output.classes14.dir" value="${jboss42.output.dir}/classes14"/>
<property name="jboss42.output.lib.dir" value="${jboss42.output.dir}/lib"/>
-
+
<target name="jboss40-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss40.client}/jboss-client.jar" unless="jboss40.available"/>
+ <fail message="Not available: ${jboss40.available.file}" unless="jboss40.available"/>
<available file="${jboss40.client}/jboss-ejb3-client.jar" property="jboss40.ejb3.available"/>
</target>
@@ -51,14 +52,12 @@
| documentation compiles.
-->
- <target name="jboss40-compile" depends="jboss40-compile-classes,jboss40-compile-ejb3-classes,jboss40-compile-etc"
- description="Compile all source files."/>
+ <target name="jboss40-compile" depends="jboss40-compile-classes,jboss40-check-ejb3-classes,jboss40-compile-ejb3-classes,jboss40-compile-etc" description="Compile all source files."/>
<!-- Compile integration java sources -->
<target name="jboss40-compile-classes" depends="jboss40-init,core-compile">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}"
- encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<include name="org/jboss/ws/integration/jboss42/**"/>
<exclude name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
@@ -71,8 +70,7 @@
</target>
<target name="jboss40-compile-ejb3-classes" depends="jboss40-init,core-compile" if="jboss40.ejb3.available">
<mkdir dir="${jboss40.output.classes.dir}"/>
- <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}"
- encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
+ <javac srcdir="${jboss42.java.dir}" sourcepath="" destdir="${jboss40.output.classes.dir}" encoding="utf-8" debug="${javac.debug}" verbose="${javac.verbose}"
deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<include name="org/jboss/ws/integration/jboss42/DeployerInterceptorEJB3.java"/>
<include name="org/jboss/ws/integration/jboss42/ServiceEndpointGeneratorEJB3.java"/>
@@ -82,6 +80,13 @@
<classpath path="${core.output.classes.dir}"/>
</javac>
</target>
+ <target name="jboss40-check-ejb3-classes" depends="jboss40-init" unless="jboss40.ejb3.available">
+ <echo message="****************************************"/>
+ <echo message="* EJB3 not available *"/>
+ <echo message="* jboss40 integartion layer will be *"/>
+ <echo message="* build without EJB3 support! *"/>
+ <echo message="****************************************"/>
+ </target>
<!-- Compile etc files (manifests and such) -->
<target name="jboss40-compile-etc" depends="jboss40-init">
@@ -92,7 +97,7 @@
<!-- ================================================================== -->
<target name="jboss40-retro" depends="jboss40-compile,core-compile">
-
+
<!-- Weave the build.classes to build.classes14 -->
<taskdef name="retro" classname="org.jboss.ant.tasks.retro.Retro">
<classpath>
@@ -100,7 +105,7 @@
<pathelement location="${thirdparty.dir}/jbossretro.jar"/>
</classpath>
</taskdef>
-
+
<mkdir dir="${jboss40.output.classes14.dir}"/>
<retro destdir="${jboss40.output.classes14.dir}">
<classpath>
@@ -120,7 +125,7 @@
<src path="${core.dir}/output/classes"/>
</retro>
</target>
-
+
<!-- ================================================================== -->
<!-- Archives -->
<!-- ================================================================== -->
@@ -128,7 +133,7 @@
<!--
| Build all jar files.
-->
- <target name="jboss40-jars" depends="jboss40-compile,jboss40-module-jars" description="Builds all jar files.">
+ <target name="jboss40-jars" depends="jboss40-compile,jboss40-module-jars" description="Builds all jar files.">
</target>
<!--
@@ -195,7 +200,7 @@
| Build retrotranslated jar files.
-->
<target name="jboss40-jars14" depends="jboss40-jars,jboss40-retro">
-
+
<!-- Build jbossws14-core.jar -->
<mkdir dir="${jboss40.output.lib.dir}"/>
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-core.jar" manifest="${etc.dir}/default.mf">
@@ -209,7 +214,7 @@
<include name="dtd/**"/>
</fileset>
</jar>
-
+
<!-- Build jbossws14-jboss40-integration.jar -->
<jar jarfile="${jboss40.output.lib.dir}/jbossws14-jboss40-integration.jar" manifest="${etc.dir}/default.mf">
<fileset dir="${jboss40.output.classes14.dir}">
@@ -244,9 +249,10 @@
</fileset>
<metainf dir="${core.resources.dir}/jboss-saaj.jar/META-INF"/>
</jar>
-
+
<mkdir dir="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF"/>
- <copy tofile="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF/jboss-service.xml" file="${jboss42.resources.dir}/jbossws.sar/META-INF/jboss-service-no-ejb3.xml"/>
+ <copy tofile="${jboss40.output.dir}/resources/jbossws40-jdk14.sar/META-INF/jboss-service.xml"
+ file="${jboss42.resources.dir}/jbossws.sar/META-INF/jboss-service-no-ejb3.xml"/>
<!-- Build jbossws40-jdk14.sar -->
<jar jarfile="${jboss40.output.lib.dir}/jbossws40-jdk14.sar" manifest="${etc.dir}/default.mf">
@@ -277,7 +283,7 @@
<include name="jboss-service.xml"/>
</metainf>
</jar>
-
+
</target>
<!-- ================================================================== -->
Modified: branches/jbossws-1.2.0/integration-jboss42/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss42/build.xml 2007-02-05 11:19:25 UTC (rev 2275)
+++ branches/jbossws-1.2.0/integration-jboss42/build.xml 2007-02-05 11:49:39 UTC (rev 2276)
@@ -26,7 +26,7 @@
<property name="jboss42.output.lib.dir" value="${jboss42.output.dir}/lib"/>
<target name="jboss42-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss42.client}/jboss-client.jar" unless="jboss42.available"/>
+ <fail message="Not available: ${jboss42.available.file}" unless="jboss42.available"/>
</target>
<!-- ================================================================== -->
Modified: branches/jbossws-1.2.0/integration-jboss50/build.xml
===================================================================
--- branches/jbossws-1.2.0/integration-jboss50/build.xml 2007-02-05 11:19:25 UTC (rev 2275)
+++ branches/jbossws-1.2.0/integration-jboss50/build.xml 2007-02-05 11:49:39 UTC (rev 2276)
@@ -26,7 +26,7 @@
<property name="jboss50.output.lib.dir" value="${jboss50.output.dir}/lib"/>
<target name="jboss50-init" depends="prepare, thirdparty">
- <fail message="Not available: ${jboss50.client}/jboss-client.jar" unless="jboss50.available"/>
+ <fail message="Not available: ${jboss50.available.file}" unless="jboss50.available"/>
</target>
<!-- ================================================================== -->
17 years, 3 months