JBossWS SVN: r11874 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/metadata/umdm and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-03-28 05:00:37 -0400 (Sun, 28 Mar 2010)
New Revision: 11874
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java
Removed:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
[JBWS-2975]:Use defaultNS to create JAXBContext
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -88,9 +88,10 @@
public JAXBContext createContext(final Class[] clazzes, final BindingCustomization bcust) throws WSException
{
+ JAXBContext jaxbCtx = null;
try
{
- JAXBContext jaxbCtx = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {
+ jaxbCtx = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {
public JAXBContext run() throws PrivilegedActionException
{
try
@@ -104,12 +105,42 @@
}
});
incrementContextCount();
- return jaxbCtx;
}
catch (Exception e)
- {
- throw new WSException("Failed to create JAXBContext", e);
+ {
+ if (bcust != null && bcust.get("com.sun.xml.bind.defaultNamespaceRemap") != null)
+ {
+ String dns = (String) bcust.get("com.sun.xml.bind.defaultNamespaceRemap");
+ bcust.remove("com.sun.xml.bind.defaultNamespaceRemap");
+ bcust.put("com.sun.xml.internal.bind.defaultNamespaceRemap", dns);
+ try
+ {
+ jaxbCtx = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {
+ public JAXBContext run() throws PrivilegedActionException
+ {
+ try
+ {
+ return JAXBContext.newInstance(clazzes, bcust);
+ }
+ catch (JAXBException e)
+ {
+ throw new PrivilegedActionException(e);
+ }
+ }
+ });
+ incrementContextCount();
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Failed to create JAXBContext", ex);
+ }
+ }
+ else
+ {
+ throw new WSException("Failed to create JAXBContext", e);
+ }
}
+ return jaxbCtx;
}
public JAXBRIContext createContext(Class[] classes, Collection<TypeReference> refs, String defaultNS, boolean c14n, BindingCustomization bcust)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -21,22 +21,30 @@
*/
package org.jboss.ws.core.jaxws;
+import java.lang.reflect.Method;
+
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.TypeMappingImpl;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
/**
* A Deserializer that can handle complex types by delegating to JAXB.
@@ -104,7 +112,31 @@
JAXBContext context = cache.get(types);
if(null==context)
{
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
BindingCustomization bindingCustomization = getBindingCustomization();
+ for (Class<?> clz : types)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method meth : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
+ }
context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
cache.add(types, context);
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -21,24 +21,31 @@
*/
package org.jboss.ws.core.jaxws;
+import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.util.xml.BufferedStreamResult;
import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
import org.w3c.dom.NamedNodeMap;
/**
@@ -117,9 +124,33 @@
private JAXBContext getJAXBContext(Class[] types){
JAXBContextCache cache = JAXBContextCache.getContextCache();
JAXBContext context = cache.get(types);
- if(null==context)
- {
+ if(null == context)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
BindingCustomization bindingCustomization = getBindingCustomization();
+ for (Class<?> clz : types)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method meth : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
+ }
context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
cache.add(types, context);
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -40,6 +40,7 @@
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.WebServiceFeature;
@@ -74,6 +75,7 @@
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -699,6 +701,28 @@
try
{
Class[] classes = getRegisteredTypes().toArray(new Class[0]);
+ String defaultNS = portTypeName.getNamespaceURI();
+ for (Class<?> clz : classes)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method method : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = method.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
+ }
JAXBContext context = JAXBContextFactory.newInstance().createContext(classes, bindingCustomization);
jaxbCache.add(classes, context);
}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975 (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975)
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-import javax.xml.bind.annotation.XmlSeeAlso;
-
-/**
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-(a)XmlSeeAlso({Toyota.class, Ford.class})
-
-public abstract class Car {
- private String model;
- private String make;
-
- public String getModel() {
- return model;
- }
-
- public void setModel(String model) {
- this.model = model;
- }
-
-
- public String getMake() {
- return make;
- }
-
- public void setMake(String make) {
- this.make = make;
- }
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+(a)XmlSeeAlso({Toyota.class, Ford.class})
+
+public abstract class Car {
+ private String model;
+ private String make;
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-/**
- *
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-public class Ford extends Car {
-
- private String color;
- private final String make="Ford";
-
- public Ford() {
- setMake("Ford");
- }
-
- public String getMake() {
- return make;
- }
-
- public Ford(String model, String color) {
- setModel(model);
- this.color = color;
- }
-
- public String getColor() {
- return color;
- }
-
- public void setColor(String color) {
- this.color = color;
- }
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+/**
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class Ford extends Car {
+
+ private String color;
+ private final String make="Ford";
+
+ public Ford() {
+ setMake("Ford");
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public Ford(String model, String color) {
+ setModel(model);
+ this.color = color;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-@XmlRootElement(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
-public class GetCars {
-
- @XmlElement(name = "return", namespace = "")
- private List<Car> _return;
-
- /**
- *
- * @return
- * returns List<Car>
- */
- public List<Car> getReturn() {
- return this._return;
- }
-
- /**
- *
- * @param _return
- * the value for the _return property
- */
- public void setReturn(List<Car> _return) {
- this._return = _return;
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+@XmlRootElement(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
+public class GetCars {
+
+ @XmlElement(name = "return", namespace = "")
+ private List<Car> _return;
+
+ /**
+ *
+ * @return
+ * returns List<Car>
+ */
+ public List<Car> getReturn() {
+ return this._return;
+ }
+
+ /**
+ *
+ * @param _return
+ * the value for the _return property
+ */
+ public void setReturn(List<Car> _return) {
+ this._return = _return;
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.jaxws.JAXBSerializer;
-import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.util.xml.BufferedStreamResult;
-import org.jboss.wsf.common.DOMUtils;
-import org.w3c.dom.Element;
-
-import com.sun.org.apache.xerces.internal.util.DOMUtil;
-
-/**
- * A JAXBSerializerTestCase.
- *
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-public class JAXBSerializerTestCase extends junit.framework.TestCase
-{
- public void testSerializer() throws Exception
- {
- JAXBSerializer serializer = new JAXBSerializer();
- SerializationContext context = new SerializationContextJAXWS();
- context.setProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES, new Class[]{GetCars.class});
- context.setJavaType(GetCars.class);
- QName qname = new QName("http://jbossws.jboss.org", "GetSedansResponse");
-
- GetCars response = new GetCars();
- List<Car> cars = new ArrayList<Car>();
- Toyota camry = new Toyota();
-
- camry.setMake("Toyota");
- camry.setModel("Camry");
- camry.setColor("Black");
-
- cars.add(camry);
-
- Ford focus = new Ford();
-
- focus.setMake("Ford");
- focus.setModel("Focus");
- focus.setColor("White");
- cars.add(focus);
- response.setReturn(cars);
-
- SOAPMessageContextJAXWS messageContext = new SOAPMessageContextJAXWS();
- QName portTypeName = new QName("http://jbossws.jboss.org", "GetSedans");
- EndpointMetaData endpointMetaData = new MockEndpointMetaData(portTypeName);
- messageContext.setEndpointMetaData(endpointMetaData);
- MessageContextAssociation.pushMessageContext(messageContext);
- BufferedStreamResult result = (BufferedStreamResult)serializer.serialize(qname, null, response, context, null);
- Element element = DOMUtils.parse(result.toString());
- List<Element> elements = DOMUtils.getChildElementsAsList(element, "return");
- for (Element ele : elements)
- {
- String typeValue = DOMUtil.getAttrValueNS(ele, "http://www.w3.org/2001/XMLSchema-instance", "type");
- assertEquals("The namespace prefix is not serialized", true ,typeValue.indexOf(":") > 0);
- }
- //cleanup the mock object
- MessageContextAssociation.popMessageContext();
- }
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxws.JAXBSerializer;
+import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.util.xml.BufferedStreamResult;
+import org.jboss.wsf.common.DOMUtils;
+import org.w3c.dom.Element;
+
+import com.sun.org.apache.xerces.internal.util.DOMUtil;
+
+/**
+ * A JAXBSerializerTestCase.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class JAXBSerializerTestCase extends junit.framework.TestCase
+{
+ public void testSerializer() throws Exception
+ {
+ JAXBSerializer serializer = new JAXBSerializer();
+ SerializationContext context = new SerializationContextJAXWS();
+ context.setProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES, new Class[]{GetCars.class});
+ context.setJavaType(GetCars.class);
+ QName qname = new QName("http://jbossws.jboss.org", "GetSedansResponse");
+
+ GetCars response = new GetCars();
+ List<Car> cars = new ArrayList<Car>();
+ Toyota camry = new Toyota();
+
+ camry.setMake("Toyota");
+ camry.setModel("Camry");
+ camry.setColor("Black");
+
+ cars.add(camry);
+
+ Ford focus = new Ford();
+
+ focus.setMake("Ford");
+ focus.setModel("Focus");
+ focus.setColor("White");
+ cars.add(focus);
+ response.setReturn(cars);
+
+ SOAPMessageContextJAXWS messageContext = new SOAPMessageContextJAXWS();
+ QName portTypeName = new QName("http://jbossws.jboss.org", "GetSedans");
+ EndpointMetaData endpointMetaData = new MockEndpointMetaData(portTypeName);
+ messageContext.setEndpointMetaData(endpointMetaData);
+ MessageContextAssociation.pushMessageContext(messageContext);
+ BufferedStreamResult result = (BufferedStreamResult)serializer.serialize(qname, null, response, context, null);
+ Element element = DOMUtils.parse(result.toString());
+ List<Element> elements = DOMUtils.getChildElementsAsList(element, "return");
+ for (Element ele : elements)
+ {
+ String typeValue = DOMUtil.getAttrValueNS(ele, "http://www.w3.org/2001/XMLSchema-instance", "type");
+ assertEquals("The namespace prefix is not serialized", true ,typeValue.indexOf(":") > 0);
+ }
+ //cleanup the mock object
+ MessageContextAssociation.popMessageContext();
+ }
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-
-/**
- * A MockEndpointMetaData.
- *
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-public class MockEndpointMetaData extends EndpointMetaData
-{
-
- public MockEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
- {
- super(service, portName, portTypeName, type);
- }
-
- public MockEndpointMetaData(QName portTypeName) {
- super(null, null, portTypeName, null);
- }
- public String getEndpointAddress() {
- return null;
- }
-
- public void setEndpointAddress(String endpointAddress) {
-
- }
-
-
-
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+
+/**
+ * A MockEndpointMetaData.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class MockEndpointMetaData extends EndpointMetaData
+{
+
+ public MockEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
+ {
+ super(service, portName, portTypeName, type);
+ }
+
+ public MockEndpointMetaData(QName portTypeName) {
+ super(null, null, portTypeName, null);
+ }
+ public String getEndpointAddress() {
+ return null;
+ }
+
+ public void setEndpointAddress(String endpointAddress) {
+
+ }
+
+
+
+}
Deleted: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java 2010-03-28 07:14:22 UTC (rev 11873)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
-
-/**
- * @author <a href="ema(a)redhat.com">Jim Ma</a>
- */
-public class Toyota extends Car {
-
- private String color;
- private final String make="Toyota";
-
- public Toyota() {
- setMake("Toyota");
- }
-
- public String getMake() {
- return make;
- }
-
- public Toyota(String model, String color) {
- setModel(model);
- this.color = color;
- }
-
- public String getColor() {
- return color;
- }
-
- public void setColor(String color) {
- this.color = color;
- }
-}
Copied: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java (from rev 11873, stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java)
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java 2010-03-28 09:00:37 UTC (rev 11874)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class Toyota extends Car {
+
+ private String color;
+ private final String make="Toyota";
+
+ public Toyota() {
+ setMake("Toyota");
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public Toyota(String model, String color) {
+ setModel(model);
+ this.color = color;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+}
14 years, 9 months
JBossWS SVN: r11873 - in stack/native/branches/jbossws-native-3.1.2/modules: core/src/main/java/org/jboss/ws/metadata/umdm and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-03-28 03:14:22 -0400 (Sun, 28 Mar 2010)
New Revision: 11873
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
[JBPAPP-4024]:Use defaultNS to create JAXBContext
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2010-03-26 17:59:21 UTC (rev 11872)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/CustomizableJAXBContextFactory.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -85,16 +85,35 @@
public JAXBContext createContext(Class[] clazzes, BindingCustomization bcust) throws WSException
{
+ JAXBContext jaxbCtx = null;
try
{
- JAXBContext jaxbCtx = JAXBContext.newInstance(clazzes, bcust);
- incrementContextCount();
- return jaxbCtx;
+ jaxbCtx = JAXBContext.newInstance(clazzes, bcust);
+ incrementContextCount();
}
catch (JAXBException e)
- {
- throw new WSException("Failed to create JAXBContext", e);
+ {
+ if (bcust != null && bcust.get("com.sun.xml.bind.defaultNamespaceRemap") != null)
+ {
+ String dns = (String) bcust.get("com.sun.xml.bind.defaultNamespaceRemap");
+ bcust.remove("com.sun.xml.bind.defaultNamespaceRemap");
+ bcust.put("com.sun.xml.internal.bind.defaultNamespaceRemap", dns);
+ try
+ {
+ jaxbCtx = JAXBContext.newInstance(clazzes, bcust);
+ incrementContextCount();
+ }
+ catch (JAXBException ex)
+ {
+ throw new WSException("Failed to create JAXBContext", ex);
+ }
+ }
+ else
+ {
+ throw new WSException("Failed to create JAXBContext", e);
+ }
}
+ return jaxbCtx;
}
public JAXBRIContext createContext(Class[] classes, Collection<TypeReference> refs, String defaultNS, boolean c14n, BindingCustomization bcust)
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2010-03-26 17:59:21 UTC (rev 11872)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBDeserializer.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -21,19 +21,26 @@
*/
package org.jboss.ws.core.jaxws;
+import java.lang.reflect.Method;
+
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeDeserializer;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.TypeMappingImpl;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.jaxws.AttachmentUnmarshallerImpl;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.wsf.spi.binding.BindingCustomization;
/**
@@ -92,9 +99,32 @@
JAXBContext context = cache.get(types);
if(null==context)
{
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
BindingCustomization bindingCustomization = getBindingCustomization();
+ for (Class<?> clz : types)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method meth : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
+ }
context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
- cache.add(types, context);
}
return context;
}
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2010-03-26 17:59:21 UTC (rev 11872)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/jaxws/JAXBSerializer.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -21,22 +21,28 @@
*/
package org.jboss.ws.core.jaxws;
+import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.ComplexTypeSerializer;
import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.extensions.xop.jaxws.AttachmentMarshallerImpl;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.util.xml.BufferedStreamResult;
import org.jboss.wsf.spi.binding.BindingCustomization;
import org.w3c.dom.NamedNodeMap;
@@ -117,9 +123,33 @@
private JAXBContext getJAXBContext(Class[] types){
JAXBContextCache cache = JAXBContextCache.getContextCache();
JAXBContext context = cache.get(types);
- if(null==context)
- {
+ if(null == context)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ EndpointMetaData epMetaData = msgContext.getEndpointMetaData();
+ String defaultNS = epMetaData.getPortTypeName().getNamespaceURI();
BindingCustomization bindingCustomization = getBindingCustomization();
+ for (Class<?> clz : types)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method meth : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = meth.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNS);
+ }
context = JAXBContextFactory.newInstance().createContext(types, bindingCustomization);
cache.add(types, context);
}
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2010-03-26 17:59:21 UTC (rev 11872)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -40,6 +40,7 @@
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.ws.WebServiceFeature;
@@ -55,6 +56,7 @@
import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
import org.jboss.ws.core.jaxrpc.binding.SOAPArrayDeserializerFactory;
import org.jboss.ws.core.jaxrpc.binding.SOAPArraySerializerFactory;
+import org.jboss.ws.core.jaxws.JAXBBindingCustomization;
import org.jboss.ws.core.jaxws.JAXBContextCache;
import org.jboss.ws.core.jaxws.JAXBContextFactory;
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
@@ -692,6 +694,28 @@
try
{
Class[] classes = getRegisteredTypes().toArray(new Class[0]);
+ String defaultNS = portTypeName.getNamespaceURI();
+ for (Class<?> clz : classes)
+ {
+ if (clz.getName().endsWith("ObjectFactory"))
+ {
+ for (Method method : clz.getMethods())
+ {
+ XmlElementDecl elementDecl = method.getAnnotation(XmlElementDecl.class);
+ if (elementDecl != null && XmlElementDecl.GLOBAL.class.equals(elementDecl.scope())
+ && elementDecl.namespace() != null && elementDecl.namespace().length() > 0)
+ {
+ defaultNS = null;
+ }
+ }
+ }
+ }
+ if (defaultNS != null)
+ {
+ if (bindingCustomization == null)
+ bindingCustomization = new JAXBBindingCustomization();
+ bindingCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, defaultNS);
+ }
JAXBContext context = JAXBContextFactory.newInstance().createContext(classes, bindingCustomization);
jaxbCache.add(classes, context);
}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Car.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import javax.xml.bind.annotation.XmlSeeAlso;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+(a)XmlSeeAlso({Toyota.class, Ford.class})
+
+public abstract class Car {
+ private String model;
+ private String make;
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Ford.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+/**
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class Ford extends Car {
+
+ private String color;
+ private final String make="Ford";
+
+ public Ford() {
+ setMake("Ford");
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public Ford(String model, String color) {
+ setModel(model);
+ this.color = color;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/GetCars.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+@XmlRootElement(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "getSedansResponse", namespace = "http://jbossws.jboss.org")
+public class GetCars {
+
+ @XmlElement(name = "return", namespace = "")
+ private List<Car> _return;
+
+ /**
+ *
+ * @return
+ * returns List<Car>
+ */
+ public List<Car> getReturn() {
+ return this._return;
+ }
+
+ /**
+ *
+ * @param _return
+ * the value for the _return property
+ */
+ public void setReturn(List<Car> _return) {
+ this._return = _return;
+ }
+
+}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/JAXBSerializerTestCase.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.core.binding.SerializationContext;
+import org.jboss.ws.core.jaxws.JAXBSerializer;
+import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.util.xml.BufferedStreamResult;
+import org.jboss.wsf.common.DOMUtils;
+import org.w3c.dom.Element;
+
+import com.sun.org.apache.xerces.internal.util.DOMUtil;
+
+/**
+ * A JAXBSerializerTestCase.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class JAXBSerializerTestCase extends junit.framework.TestCase
+{
+ public void testSerializer() throws Exception
+ {
+ JAXBSerializer serializer = new JAXBSerializer();
+ SerializationContext context = new SerializationContextJAXWS();
+ context.setProperty(SerializationContextJAXWS.JAXB_CONTEXT_TYPES, new Class[]{GetCars.class});
+ context.setJavaType(GetCars.class);
+ QName qname = new QName("http://jbossws.jboss.org", "GetSedansResponse");
+
+ GetCars response = new GetCars();
+ List<Car> cars = new ArrayList<Car>();
+ Toyota camry = new Toyota();
+
+ camry.setMake("Toyota");
+ camry.setModel("Camry");
+ camry.setColor("Black");
+
+ cars.add(camry);
+
+ Ford focus = new Ford();
+
+ focus.setMake("Ford");
+ focus.setModel("Focus");
+ focus.setColor("White");
+ cars.add(focus);
+ response.setReturn(cars);
+
+ SOAPMessageContextJAXWS messageContext = new SOAPMessageContextJAXWS();
+ QName portTypeName = new QName("http://jbossws.jboss.org", "GetSedans");
+ EndpointMetaData endpointMetaData = new MockEndpointMetaData(portTypeName);
+ messageContext.setEndpointMetaData(endpointMetaData);
+ MessageContextAssociation.pushMessageContext(messageContext);
+ BufferedStreamResult result = (BufferedStreamResult)serializer.serialize(qname, null, response, context, null);
+ Element element = DOMUtils.parse(result.toString());
+ List<Element> elements = DOMUtils.getChildElementsAsList(element, "return");
+ for (Element ele : elements)
+ {
+ String typeValue = DOMUtil.getAttrValueNS(ele, "http://www.w3.org/2001/XMLSchema-instance", "type");
+ assertEquals("The namespace prefix is not serialized", true ,typeValue.indexOf(":") > 0);
+ }
+ //cleanup the mock object
+ MessageContextAssociation.popMessageContext();
+ }
+
+}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/MockEndpointMetaData.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+
+/**
+ * A MockEndpointMetaData.
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class MockEndpointMetaData extends EndpointMetaData
+{
+
+ public MockEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
+ {
+ super(service, portName, portTypeName, type);
+ }
+
+ public MockEndpointMetaData(QName portTypeName) {
+ super(null, null, portTypeName, null);
+ }
+ public String getEndpointAddress() {
+ return null;
+ }
+
+ public void setEndpointAddress(String endpointAddress) {
+
+ }
+
+
+
+}
Added: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2975/Toyota.java 2010-03-28 07:14:22 UTC (rev 11873)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.jbws2975;
+
+/**
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class Toyota extends Car {
+
+ private String color;
+ private final String make="Toyota";
+
+ public Toyota() {
+ setMake("Toyota");
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public Toyota(String model, String color) {
+ setModel(model);
+ this.color = color;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+}
14 years, 9 months
JBossWS SVN: r11872 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-03-26 13:59:21 -0400 (Fri, 26 Mar 2010)
New Revision: 11872
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
Log:
[JBWS-2974] Refactoring CXF Bus creation and configuration + adding a deployment aspect for eargerly loading the bus during deploy when required
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BusHolder.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BusHolder.java 2010-03-26 17:59:21 UTC (rev 11872)
@@ -0,0 +1,229 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf.client.configuration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
+import org.apache.cxf.bus.spring.BusApplicationContext;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.resource.ResourceResolver;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.servlet.ServletTransportFactory;
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.InputStreamResource;
+
+/**
+ * An wrapper of the Bus for performing most of the configurations required on it by JBossWS
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Mar-2010
+ *
+ */
+public class BusHolder
+{
+ private static final Logger log = Logger.getLogger(BusHolder.class);
+ public static final String PARAM_CXF_BEANS_URL = "jbossws.cxf.beans.url";
+ private boolean configured = false;
+ protected BusApplicationContext ctx ;
+ protected List<GenericApplicationContext> additionalCtx = new LinkedList<GenericApplicationContext>();
+ protected Bus bus;
+
+ /**
+ * Private constructor
+ */
+ private BusHolder()
+ {
+ //NOP
+ }
+
+ /**
+ * Creates a new BusHolder instance; a new Bus is created using the
+ * provided location for loading additional configurations
+ *
+ * @param location
+ * @return
+ */
+ public static BusHolder create(URL location)
+ {
+ BusHolder holder = new BusHolder();
+ holder.createBus(location);
+ return holder;
+ }
+
+ /**
+ * Creates a new BusHolder instance using the provided Bus
+ *
+ * @param bus
+ * @return
+ */
+ public static BusHolder create(Bus bus)
+ {
+ BusHolder holder = new BusHolder();
+ holder.setBus(bus);
+ holder.setContext(bus.getExtension(BusApplicationContext.class));
+ return holder;
+ }
+
+ /**
+ * Update the Bus held by the this instance using the provided parameters.
+ * This basically prepares the bus for being used with JBossWS.
+ *
+ * @param jbossCxfXml The location of the jboss-cxf.xml configuration file
+ * @param soapTransportFactory The SoapTransportFactory to configure, if any
+ * @param resolver The ResourceResolver to configure, if any
+ * @param customization The BindingCustomization to configure, if any
+ * @throws IOException Throws IOException if the jboss-cxf.xml file can't be read
+ */
+ public void configure(URL jbossCxfXml, SoapTransportFactory soapTransportFactory, ResourceResolver resolver, BindingCustomization customization) throws IOException
+ {
+ if (configured)
+ {
+ throw new IllegalStateException("Underlying bus is already configured for JBossWS use!");
+ }
+ setSoapTransportFactory(bus, soapTransportFactory);
+ setResourceResolver(bus, resolver);
+ setBindingCustomization(bus, customization);
+ if (jbossCxfXml != null)
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, jbossCxfXml));
+ }
+ configured = true;
+ }
+
+ /**
+ * Performs close operations (currently implies destroying additional contexts)
+ *
+ */
+ public void close()
+ {
+ for (GenericApplicationContext gac : additionalCtx)
+ {
+ gac.destroy();
+ }
+ }
+
+ /**
+ * Creates the Bus using a SpringBusFactory with no specific Spring application context.
+ * Then loads additional configurations from the provided location
+ *
+ * @param location
+ * @return
+ */
+ protected void createBus(URL location)
+ {
+ bus = new SpringBusFactory().createBus();
+ ctx = bus.getExtension(BusApplicationContext.class);
+ //Load additional configurations from cxf-servlet.xml
+ if (location != null)
+ {
+ try
+ {
+ additionalCtx.add(loadAdditionalConfig(ctx, location));
+ }
+ catch (IOException e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Could not load additional config from location: " + location, e);
+ }
+ }
+ //Force servlet transport to prevent CXF from using Jetty as a transport
+ DestinationFactory factory = new ServletTransportFactory(bus);
+ for (String s : factory.getTransportIds()) {
+ registerTransport(factory, s);
+ }
+ }
+
+ protected static void setResourceResolver(Bus bus, ResourceResolver resourceResolver)
+ {
+ if (resourceResolver != null)
+ {
+ bus.getExtension(ResourceManager.class).addResourceResolver(resourceResolver);
+ }
+ }
+
+ protected static void setSoapTransportFactory(Bus bus, SoapTransportFactory factory)
+ {
+ if (factory != null)
+ {
+ DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+ factory.setBus(bus);
+ dfm.registerDestinationFactory(Constants.NS_SOAP11, factory);
+ dfm.registerDestinationFactory(Constants.NS_SOAP12, factory);
+ }
+ }
+
+ protected static void setBindingCustomization(Bus bus, BindingCustomization customization)
+ {
+ if (customization != null) {
+ Configurer prev = bus.getExtension(Configurer.class);
+ JBossWSCXFConfigurer jbosswsConfigurer = (prev instanceof JBossWSCXFConfigurer) ? (JBossWSCXFConfigurer)prev : new JBossWSCXFConfigurer(prev);
+ jbosswsConfigurer.setBindingCustomization(customization);
+ bus.setExtension(jbosswsConfigurer, Configurer.class);
+ }
+ }
+
+ protected static GenericApplicationContext loadAdditionalConfig(ApplicationContext ctx, URL locationUrl) throws IOException
+ {
+ if (locationUrl == null) throw new IllegalArgumentException("Cannot load additional config from null location!");
+ InputStream is = locationUrl.openStream();
+ GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
+ reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
+ reader.loadBeanDefinitions(new InputStreamResource(is));
+ childCtx.refresh();
+ return childCtx;
+ }
+
+ private void registerTransport(DestinationFactory factory, String namespace)
+ {
+ bus.getExtension(DestinationFactoryManager.class).registerDestinationFactory(namespace, factory);
+ }
+
+ public Bus getBus()
+ {
+ return bus;
+ }
+
+ private void setBus(Bus bus)
+ {
+ this.bus = bus;
+ }
+
+ private void setContext(BusApplicationContext ctx)
+ {
+ this.ctx = ctx;
+ }
+}
Property changes on: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BusHolder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java 2010-03-26 17:59:21 UTC (rev 11872)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import org.apache.cxf.BusFactory;
+import org.jboss.ws.Constants;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.integration.WSConstants;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.stack.cxf.client.configuration.BusHolder;
+
+/**
+ * A deployment aspect that creates the CXF Bus early and attaches it to the endpoints (wrapped in a BusHolder)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Mar-2010
+ */
+public class BusDeploymentAspect extends AbstractDeploymentAspect
+{
+ @SuppressWarnings("unchecked")
+ @Override
+ public void start(Deployment dep)
+ {
+ if (Constants.LAZY_LOAD_CXF_BUS)
+ return;
+
+ log.debug("Lazy load of CXF bus disabled, loading bus during deployment...");
+ BusHolder holder;
+ ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
+ try
+ {
+ //set the runtime classloader (pointing to the deployment unit) to allow CXF accessing to the classes
+ SecurityActions.setContextClassLoader(dep.getRuntimeClassLoader());
+
+ ResourceResolver deploymentResolver = ((ArchiveDeployment)dep).getResourceResolver();
+
+ URL cxfServletURL = null;
+ try
+ {
+ cxfServletURL = deploymentResolver.resolve("WEB-INF/cxf-servlet.xml");
+ }
+ catch (IOException e)
+ {
+ } //ignore, cxf-servlet.xml is optional
+
+ holder = BusHolder.create(cxfServletURL);
+
+ Map<String, String> contextParams = (Map<String, String>)dep.getProperty(WSConstants.STACK_CONTEXT_PARAMS);
+ try
+ {
+ URL jbossCxfXml = deploymentResolver.resolve(contextParams.get(BusHolder.PARAM_CXF_BEANS_URL));
+ org.apache.cxf.resource.ResourceResolver resolver = new JBossWSResourceResolver(deploymentResolver);
+ BindingCustomization customizations = dep.getAttachment(BindingCustomization.class);
+ holder.configure(jbossCxfXml, new SoapTransportFactoryExt(), resolver, customizations);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); //re-throw, jboss-cxf.xml is required
+ }
+ }
+ finally
+ {
+ //clean threadlocals in BusFactory and restore the original classloader
+ BusFactory.setDefaultBus(null);
+ BusFactory.setThreadDefaultBus(null);
+ SecurityActions.setContextClassLoader(origClassLoader);
+ }
+
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ endpoint.addAttachment(BusHolder.class, holder);
+ }
+ dep.addAttachment(BusHolder.class, holder);
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ for (Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ BusHolder holder = endpoint.removeAttachment(BusHolder.class);
+ if (holder != null)
+ {
+ holder.close();
+ }
+ }
+ BusHolder holder = dep.removeAttachment(BusHolder.class);
+ if (holder != null)
+ {
+ holder.close();
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/BusDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-03-26 17:23:50 UTC (rev 11871)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-03-26 17:59:21 UTC (rev 11872)
@@ -22,8 +22,6 @@
package org.jboss.wsf.stack.cxf;
import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
@@ -37,20 +35,12 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.configuration.Configurer;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
-import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.management.InstrumentationManager;
import org.apache.cxf.management.counters.CounterRepository;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
-import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.jms.AddressType;
-import org.apache.cxf.transport.jms.JMSDestination;
import org.apache.cxf.transport.servlet.CXFServlet;
+import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
import org.apache.cxf.transport.servlet.ServletController;
import org.apache.cxf.transport.servlet.ServletTransportFactory;
import org.jboss.logging.Logger;
@@ -64,12 +54,9 @@
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
+import org.jboss.wsf.stack.cxf.client.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.InputStreamResource;
/**
* An extension to the CXF servlet
@@ -79,15 +66,12 @@
*/
public class CXFServletExt extends CXFServlet
{
- public static final String PARAM_CXF_BEANS_URL = "jbossws.cxf.beans.url";
+ private static final Logger log = Logger.getLogger(CXFServletExt.class);
public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
- public static final String JMS_NS = "http://cxf.apache.org/transports/jms";
- private static Logger log = Logger.getLogger(CXFServletExt.class);
-
protected Endpoint endpoint;
protected EndpointRegistry epRegistry;
- protected GenericApplicationContext childCtx;
+ protected BusHolder lazyLoadedBusHolder;
@Override
public void init(ServletConfig servletConfig) throws ServletException
@@ -105,31 +89,73 @@
@Override
public void loadBus(ServletConfig servletConfig) throws ServletException
{
- super.loadBus(servletConfig);
-
+ //Init the Endpoint
+ initEndpoint(servletConfig);
+
ServletContext svCtx = getServletContext();
- ApplicationContext appCtx = (ApplicationContext)svCtx.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
-
- Bus bus = getBus();
-
+ if (isBusLoadRequired(svCtx))
+ {
+ //reload bus using CXF servlet
+ lazyLoadBus(servletConfig);
+ }
+ else
+ {
+ //keep the bus created during deployment and update it with the information coming from the servlet config
+ updateAvailableBusWithServletInfo(servletConfig);
+ }
+
//register the InstrumentManagementImpl
+ //TODO!! remove reflection use inside this by providing proper hook in CXF and move this configuration to BusHolder
if (svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT) != null && "true".equalsIgnoreCase((String)svCtx.getInitParameter(ENABLE_CXF_MANAGEMENT))) {
registerInstrumentManger(bus);
}
-
- //Install our SoapTransportFactory to allow for proper soap address rewrite
- DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
- SoapTransportFactory factory = new SoapTransportFactoryExt();
- factory.setBus(bus);
- dfm.registerDestinationFactory(Constants.NS_SOAP11, factory);
- dfm.registerDestinationFactory(Constants.NS_SOAP12, factory);
-
- //Init the Endpoint
- initEndpoint(servletConfig);
-
- //Load additional configurations
- loadAdditionalConfigExt(appCtx, servletConfig);
}
+
+ private static boolean isBusLoadRequired(ServletContext svCtx)
+ {
+ boolean result = Constants.LAZY_LOAD_CXF_BUS;
+ result = result || (ApplicationContext)svCtx.getAttribute("interface org.springframework.web.context.WebApplicationContext.ROOT") != null;
+ result = result || (ApplicationContext)svCtx.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT") != null;
+ return result;
+ }
+
+ private void lazyLoadBus(ServletConfig servletConfig) throws ServletException
+ {
+ log.debug("Loading Bus through CXF servlet...");
+ super.loadBus(servletConfig);
+ //set the controller in the servlet context now that the bus has been configured in the servlet
+ servletConfig.getServletContext().setAttribute(ServletController.class.getName(), getController());
+ //recreate holder from the new bus
+ lazyLoadedBusHolder = BusHolder.create(getBus());
+ //configure bus for jbossws use
+ String jbossCxfXml = servletConfig.getServletContext().getInitParameter(BusHolder.PARAM_CXF_BEANS_URL);
+ try
+ {
+ ResourceResolver resolver = endpoint.getAttachment(ResourceResolver.class);
+ BindingCustomization customizations = endpoint.getAttachment(BindingCustomization.class);
+ lazyLoadedBusHolder.configure(new URL(jbossCxfXml), new SoapTransportFactoryExt(), resolver, customizations);
+ }
+ catch (IOException e)
+ {
+ throw new ServletException("Error while configuring bus for JBossWS use", e);
+ }
+ }
+
+ private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
+ {
+ BusHolder holder = endpoint.getAttachment(BusHolder.class);
+ //set the bus from deployment into the CXF servlet and assign it to the current thread
+ bus = holder.getBus();
+ BusFactory.possiblySetDefaultBus(bus);
+ //update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet
+ ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+ resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext()));
+ replaceDestinationFactory();
+ //set up the ServletController as the CXF servlet would have done
+ controller = createServletController(servletConfig);
+ //set the controller in the servlet context now that the bus has been configured in the servlet
+ servletConfig.getServletContext().setAttribute(ServletController.class.getName(), getController());
+ }
private void initEndpoint(ServletConfig servletConfig)
{
@@ -139,50 +165,8 @@
ServletContext context = servletConfig.getServletContext();
String contextPath = context.getContextPath();
endpoint = initServiceEndpoint(contextPath);
-
- //Install the JBossWS resource resolver
- ResourceResolver resourceResolver = endpoint.getAttachment(ResourceResolver.class);
- if (resourceResolver != null)
- {
- bus.getExtension(ResourceManager.class).addResourceResolver(resourceResolver);
- }
-
- //Add customization check to use default CXF configurer
- BindingCustomization customization = endpoint.getAttachment(BindingCustomization.class);
- if (customization != null) {
- //Add extension to configure server beans according to JBossWS customizations
- JBossWSCXFConfigurer jbosswsConfigurer = new JBossWSCXFConfigurer(bus.getExtension(Configurer.class));
- jbosswsConfigurer.setBindingCustomization(endpoint.getAttachment(BindingCustomization.class));
- bus.setExtension(jbosswsConfigurer, Configurer.class);
- }
- context.setAttribute(ServletController.class.getName(), getController());
}
- private void loadAdditionalConfigExt(ApplicationContext ctx, ServletConfig servletConfig) throws ServletException
- {
- //Load configuration
- String location = servletConfig.getServletContext().getInitParameter(PARAM_CXF_BEANS_URL);
- if (location != null)
- {
- InputStream is;
- try
- {
- is = new URL(location).openStream();
- }
- catch (IOException e)
- {
- throw new ServletException(e);
- }
-
- childCtx = new GenericApplicationContext(ctx);
- XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
- reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
- reader.loadBeanDefinitions(new InputStreamResource(is, location));
-
- childCtx.refresh();
- }
- }
-
@Override
protected void invoke(HttpServletRequest req, HttpServletResponse res) throws ServletException
{
@@ -204,15 +188,6 @@
}
}
- @Override
- public void destroy()
- {
- if (childCtx != null)
- childCtx.destroy();
-
- super.destroy();
- }
-
/** Initialize the service endpoint
*/
private Endpoint initServiceEndpoint(String contextPath)
@@ -243,6 +218,16 @@
return endpoint;
}
+ @Override
+ public void destroy()
+ {
+ if (lazyLoadedBusHolder != null)
+ {
+ lazyLoadedBusHolder.close();
+ }
+ super.destroy();
+ }
+
private void registerInstrumentManger(Bus bus) throws ServletException
{
InstrumentationManagerExtImpl instrumentationManagerImpl = new InstrumentationManagerExtImpl();
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-03-26 17:23:50 UTC (rev 11871)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/DescriptorDeploymentAspect.java 2010-03-26 17:59:21 UTC (rev 11872)
@@ -37,6 +37,7 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.stack.cxf.client.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
@@ -214,7 +215,7 @@
dep.setProperty(WSConstants.STACK_CONTEXT_PARAMS, contextParams);
}
// put cxf config URL to the property map
- contextParams.put(CXFServletExt.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
+ contextParams.put(BusHolder.PARAM_CXF_BEANS_URL, cxfURL.toExternalForm());
}
private static boolean isMtomEnabled(Class<?> beanClass)
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java 2010-03-26 17:59:21 UTC (rev 11872)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-Mar-2010
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/SecurityActions.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml 2010-03-26 17:23:50 UTC (rev 11871)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as5.xml 2010-03-26 17:59:21 UTC (rev 11872)
@@ -75,5 +75,11 @@
<property name="provides">JAXBIntros</property>
<property name="relativeOrder">20</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
+
+ <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.BusDeploymentAspect">
+ <property name="provides">BusHolder</property>
+ <property name="requires">ResourceResolver,StackDescriptor</property>
+ <property name="relativeOrder">24</property> <!-- [JBDEPLOY-201] workaround -->
+ </bean>
</deployment>
Modified: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-03-26 17:23:50 UTC (rev 11871)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-03-26 17:59:21 UTC (rev 11872)
@@ -75,5 +75,11 @@
<property name="provides">JAXBIntros</property>
<property name="forJaxRpc">false</property>
</bean>
+
+ <bean name="WSCXFBusDeploymentAspect" class="org.jboss.wsf.stack.cxf.BusDeploymentAspect">
+ <property name="provides">BusHolder</property>
+ <property name="requires">ResourceResolver,StackDescriptor</property>
+ <property name="forJaxRpc">false</property>
+ </bean>
</deployment>
14 years, 9 months
JBossWS SVN: r11871 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-03-26 13:23:50 -0400 (Fri, 26 Mar 2010)
New Revision: 11871
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java
Log:
[JBWS-2974] Set binding customizations in the deployment
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java 2010-03-26 17:22:31 UTC (rev 11870)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java 2010-03-26 17:23:50 UTC (rev 11871)
@@ -86,6 +86,8 @@
BindingCustomization jaxbCustomizations = new JAXBBindingCustomization();
BindingCustomizationFactory.populateBindingCustomization(introsConfigStream, jaxbCustomizations);
+ // Add the customizations to the deployment too; later consumed by BusDeploymentAspect in CXF stack
+ deployment.addAttachment(BindingCustomization.class, jaxbCustomizations);
// JBossWSBeanConfigurer#configureService becomes the consumer later on
for(Endpoint endpoint : deployment.getService().getEndpoints())
{
14 years, 9 months
JBossWS SVN: r11870 - common/trunk/src/main/java/org/jboss/ws.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-03-26 13:22:31 -0400 (Fri, 26 Mar 2010)
New Revision: 11870
Modified:
common/trunk/src/main/java/org/jboss/ws/Constants.java
Log:
[JBWS-2974] Adding constants for disabling lazy load
Modified: common/trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/Constants.java 2010-03-26 14:21:36 UTC (rev 11869)
+++ common/trunk/src/main/java/org/jboss/ws/Constants.java 2010-03-26 17:22:31 UTC (rev 11870)
@@ -327,6 +327,7 @@
static final String NETTY_MESSAGE = "org.jboss.ws.http.netty.Message";
- static final boolean BC_CONTEXT_MODE = Boolean.parseBoolean(
- System.getProperty("org.jboss.ws.backward_compatible_context_creator", "false"));
+ static final boolean BC_CONTEXT_MODE = Boolean.parseBoolean(System.getProperty("org.jboss.ws.backward_compatible_context_creator", "false"));
+
+ static final boolean LAZY_LOAD_CXF_BUS = Boolean.parseBoolean(System.getProperty("org.jboss.ws.lazyLoadCxfBus", "true"));
}
14 years, 9 months
JBossWS SVN: r11869 - in framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws: samples/handlerchain and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-26 10:21:36 -0400 (Fri, 26 Mar 2010)
New Revision: 11869
Added:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java
Modified:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
Log:
[JBPAPP-3995] fixing tests - moving @HandlerChain annotation from client SEI to Service
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -35,6 +35,7 @@
* Test SOAP12 binding type
*
* @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @since 12-Aug-2006
*/
public class HandlerScopeTestCase extends JBossWSTest
@@ -48,60 +49,23 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerscope?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new SOAPEndpointService(wsdlURL, serviceName);
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
String retStr = port.echo("hello");
-
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- testForStacksNotSupportingAnnotationOnClienSEI(retStr);
- }
- else if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- testForStacksNotSupportingAnnotationOnClienSEI(retStr);
- }
- else
- {
- StringBuffer expStr = new StringBuffer("hello");
- expStr.append(":SOAP12ClientHandler");
- expStr.append(":SOAPClientHandler");
- expStr.append(":ServiceClientHandler");
- expStr.append(":ServiceWildcardClientHandler");
- expStr.append(":PortClientHandler");
- expStr.append(":PortWildcardClientHandler");
- expStr.append(":GeneralClientHandler");
- expStr.append(":GeneralServerHandler");
- expStr.append(":PortWildcardServerHandler");
- expStr.append(":PortServerHandler");
- expStr.append(":ServiceWildcardServerHandler");
- expStr.append(":ServiceServerHandler");
- expStr.append(":SOAPServerHandler");
- expStr.append(":SOAP12ServerHandler");
- expStr.append(":endpoint");
- expStr.append(":SOAP12ServerHandler");
- expStr.append(":SOAPServerHandler");
- expStr.append(":ServiceServerHandler");
- expStr.append(":ServiceWildcardServerHandler");
- expStr.append(":PortServerHandler");
- expStr.append(":PortWildcardServerHandler");
- expStr.append(":GeneralServerHandler");
- expStr.append(":GeneralClientHandler");
- expStr.append(":PortWildcardClientHandler");
- expStr.append(":PortClientHandler");
- expStr.append(":ServiceWildcardClientHandler");
- expStr.append(":ServiceClientHandler");
- expStr.append(":SOAPClientHandler");
- expStr.append(":SOAP12ClientHandler");
- assertEquals(expStr.toString(), retStr);
- }
+ assertResponse(retStr);
}
- private static void testForStacksNotSupportingAnnotationOnClienSEI(String retStr)
+ private static void assertResponse(String retStr)
{
StringBuffer expStr = new StringBuffer("hello");
+ expStr.append(":SOAP12ClientHandler");
+ expStr.append(":SOAPClientHandler");
+ expStr.append(":ServiceClientHandler");
+ expStr.append(":ServiceWildcardClientHandler");
+ expStr.append(":PortClientHandler");
+ expStr.append(":PortWildcardClientHandler");
+ expStr.append(":GeneralClientHandler");
expStr.append(":GeneralServerHandler");
expStr.append(":PortWildcardServerHandler");
expStr.append(":PortServerHandler");
@@ -117,6 +81,13 @@
expStr.append(":PortServerHandler");
expStr.append(":PortWildcardServerHandler");
expStr.append(":GeneralServerHandler");
+ expStr.append(":GeneralClientHandler");
+ expStr.append(":PortWildcardClientHandler");
+ expStr.append(":PortClientHandler");
+ expStr.append(":ServiceWildcardClientHandler");
+ expStr.append(":ServiceClientHandler");
+ expStr.append(":SOAPClientHandler");
+ expStr.append(":SOAP12ClientHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.handlerscope;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
@@ -29,7 +28,6 @@
@WebService(targetNamespace = "http://org.jboss.ws/jaxws/handlerscope")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
-@HandlerChain(file = "jaxws-client-handlers.xml")
public interface SOAPEndpoint
{
@WebMethod
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java (from rev 11866, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.handlerscope;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-handlers.xml")
+public class SOAPEndpointService extends Service
+{
+ public SOAPEndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -21,13 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.handlerchain;
-import javax.jws.HandlerChain;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@HandlerChain(file = "jaxws-handlers-client.xml") // relative path from the class file
public interface EndpointWithHandlerChain
{
public String echo(String input);
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java (from rev 11866, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.handlerchain;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-handlers-client.xml")
+public class EndpointWithHandlerChainService extends Service
+{
+ public EndpointWithHandlerChainService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -38,6 +38,7 @@
/**
* Test the JSR-181 annotation: javax.jws.HandlerChain
*
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author Thomas.Diesler(a)jboss.org
* @since 15-Oct-2005
*/
@@ -50,6 +51,7 @@
return new JBossWSTestSetup(HandlerChainTestCase.class, "jaxws-samples-handlerchain.war");
}
+ @SuppressWarnings("unchecked")
public void testDynamicHandlerChain() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
@@ -57,7 +59,7 @@
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-
+
BindingProvider bindingProvider = (BindingProvider)port;
List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(new LogHandler());
@@ -65,48 +67,29 @@
handlerChain.add(new RoutingHandler());
handlerChain.add(new ClientMimeHandler());
bindingProvider.getBinding().setHandlerChain(handlerChain);
-
+
String resStr = port.echo("Kermit");
assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
-
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
- return;
- }
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1507] CXF client handler cannot set mime header");
- return;
- }
-
- assertEquals("server-cookie=true", ClientMimeHandler.inboundCookie);
+ assertCookies();
}
- public void testHandlerChainOnServiceEndpointInterface() throws Exception
+ public void testHandlerChainOnService() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-handlerchain/TestService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new EndpointWithHandlerChainService(wsdlURL, serviceName);
EndpointWithHandlerChain port = (EndpointWithHandlerChain)service.getPort(EndpointWithHandlerChain.class);
-
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
+ assertCookies();
+ }
+
+ private void assertCookies() throws Exception
+ {
if (isIntegrationMetro())
{
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- else
- {
- String resStr = port.echo("Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
- }
-
- if (isIntegrationMetro())
- {
System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
return;
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -35,6 +35,7 @@
/**
* Test JAXWS logical handlers
*
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author Thomas.Diesler(a)jboss.org
* @since 12-Aug-2006
*/
@@ -49,7 +50,7 @@
{
String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-jaxb";
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointJAXBService(new URL(endpointAddress + "?wsdl"), serviceName);
SOAPEndpointJAXB port = (SOAPEndpointJAXB)service.getPort(SOAPEndpointJAXB.class);
BindingProvider bindingProvider = (BindingProvider)port;
@@ -58,23 +59,9 @@
String retStr = port.echo("hello");
StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalJAXBHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Outbound:LogicalJAXBHandler");
+ expStr.append(":Outbound:ProtocolHandler");
+ expStr.append(":Outbound:PortHandler");
expStr.append(":Inbound:PortHandler");
expStr.append(":Inbound:ProtocolHandler");
expStr.append(":Inbound:LogicalJAXBHandler");
@@ -82,23 +69,9 @@
expStr.append(":Outbound:LogicalJAXBHandler");
expStr.append(":Outbound:ProtocolHandler");
expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalJAXBHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Inbound:PortHandler");
+ expStr.append(":Inbound:ProtocolHandler");
+ expStr.append(":Inbound:LogicalJAXBHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -46,86 +46,32 @@
public void testSourceDoc() throws Exception
{
- String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc";
+ URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointDocService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
SOAPEndpointSourceDoc port = (SOAPEndpointSourceDoc)service.getPort(SOAPEndpointSourceDoc.class);
String retStr = port.echo("hello");
-
- StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- expStr.append(":endpoint");
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
- assertEquals(expStr.toString(), retStr);
+ assertResponse(retStr);
}
-
public void testSourceRpc() throws Exception
{
- String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc";
+ URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointRpcService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
SOAPEndpointSourceRpc port = (SOAPEndpointSourceRpc)service.getPort(SOAPEndpointSourceRpc.class);
String retStr = port.echo("hello");
-
+ assertResponse(retStr);
+ }
+
+ private void assertResponse(String retStr)
+ {
StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Outbound:LogicalSourceHandler");
+ expStr.append(":Outbound:ProtocolHandler");
+ expStr.append(":Outbound:PortHandler");
expStr.append(":Inbound:PortHandler");
expStr.append(":Inbound:ProtocolHandler");
expStr.append(":Inbound:LogicalSourceHandler");
@@ -133,23 +79,9 @@
expStr.append(":Outbound:LogicalSourceHandler");
expStr.append(":Outbound:ProtocolHandler");
expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Inbound:PortHandler");
+ expStr.append(":Inbound:ProtocolHandler");
+ expStr.append(":Inbound:LogicalSourceHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -30,14 +29,11 @@
import javax.xml.ws.ResponseWrapper;
@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
public interface SOAPEndpointJAXB
{
-
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name = "result")
@RequestWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.Echo")
@ResponseWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.EchoResponse")
public String echo(@WebParam(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name="String_1") String string1);
-
}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java (from rev 11866, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
+public class SOAPEndpointJAXBService extends Service
+{
+ public SOAPEndpointJAXBService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -30,7 +29,6 @@
import javax.xml.ws.ResponseWrapper;
@WebService(name = "SOAPEndpointDoc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-source-handlers.xml")
public interface SOAPEndpointSourceDoc
{
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java 2010-03-26 14:16:07 UTC (rev 11868)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService(name = "SOAPEndpointRpc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-source-handlers.xml")
@SOAPBinding(style = Style.RPC)
public interface SOAPEndpointSourceRpc
{
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java (from rev 11866, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java 2010-03-26 14:21:36 UTC (rev 11869)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-source-handlers.xml")
+public class SOAPEndpointSourceService extends Service
+{
+ public SOAPEndpointSourceService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
14 years, 9 months
JBossWS SVN: r11868 - in stack/native/branches/jbossws-native-3.1.2/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-26 10:16:07 -0400 (Fri, 26 Mar 2010)
New Revision: 11868
Added:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
Log:
[JBPAPP-3995] fixing @HandlerChain accepted on client SEI - it shouldn't be
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2010-03-26 13:54:09 UTC (rev 11867)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -284,9 +284,6 @@
processEndpointConfig(epMetaData, wsClass);
epMetaData.initEndpointConfig();
- // Process an optional @HandlerChain annotation
- processHandlerChain(epMetaData, wsClass);
-
// Process @WebMethod
processWebMethods(epMetaData, wsClass);
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java 2010-03-26 13:54:09 UTC (rev 11867)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -24,7 +24,6 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-
public class ClientHandler2 extends LifecycleHandler
{
protected boolean handleOutboundMessage(MessageContext msgContext)
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2010-03-26 13:54:09 UTC (rev 11867)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -67,7 +67,7 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointBeanService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new SOAPEndpointService(wsdlURL, serviceName);
port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
}
}
@@ -90,11 +90,11 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
- expMessages.add("PreClientHandler1:PostConstruct");
- expMessages.add("PreClientHandler2:PostConstruct");
expMessages.add("ClientHandler1:PostConstruct");
expMessages.add("ClientHandler2:PostConstruct");
expMessages.add("ClientHandler3:PostConstruct");
+ expMessages.add("PreClientHandler1:PostConstruct");
+ expMessages.add("PreClientHandler2:PostConstruct");
expMessages.add("PostClientHandler1:PostConstruct");
expMessages.add("PostClientHandler2:PostConstruct");
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2010-03-26 13:54:09 UTC (rev 11867)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.ws.jaxws.handlerlifecycle;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import org.jboss.ws.annotation.EndpointConfig;
@WebService
-@HandlerChain(file = "jaxws-client-handlers.xml")
@EndpointConfig(configName = "Custom Client Config", configFile = "META-INF/jaxws-client-config.xml")
public interface SOAPEndpoint
{
Modified: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2010-03-26 13:54:09 UTC (rev 11867)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -39,7 +39,6 @@
@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/handlerlifecycle")
@HandlerChain(file = "jaxws-server-handlers.xml")
@SOAPBinding(style = Style.RPC)
-
@EndpointConfig(configName = "Custom Server Config", configFile = "WEB-INF/jaxws-endpoint-config.xml")
public class SOAPEndpointBean
{
Copied: stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java (from rev 11867, stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java)
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java (rev 0)
+++ stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java 2010-03-26 14:16:07 UTC (rev 11868)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.handlerlifecycle;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-handlers.xml")
+public class SOAPEndpointService extends Service
+{
+ public SOAPEndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
14 years, 9 months
JBossWS SVN: r11867 - in stack/native/trunk/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-26 09:54:09 -0400 (Fri, 26 Mar 2010)
New Revision: 11867
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
Log:
[JBWS-1672][CXF-1253][JBWS-2973] fixing issue plus fixing test - moving @HandlerChain annotation from client SEI to Service
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2010-03-26 13:47:04 UTC (rev 11866)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -298,9 +298,6 @@
processEndpointConfig(epMetaData, wsClass);
epMetaData.initEndpointConfig();
- // Process an optional @HandlerChain annotation
- processHandlerChain(epMetaData, wsClass);
-
// Process @WebMethod
processWebMethods(epMetaData, wsClass);
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java 2010-03-26 13:47:04 UTC (rev 11866)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/ClientHandler2.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -24,7 +24,6 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-
public class ClientHandler2 extends LifecycleHandler
{
protected boolean handleOutboundMessage(MessageContext msgContext)
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2010-03-26 13:47:04 UTC (rev 11866)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -67,7 +67,7 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointBeanService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new SOAPEndpointService(wsdlURL, serviceName);
port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
}
}
@@ -90,11 +90,11 @@
String trackerMessages = HandlerTracker.getListMessages();
List<String> expMessages = new ArrayList<String>();
- expMessages.add("PreClientHandler1:PostConstruct");
- expMessages.add("PreClientHandler2:PostConstruct");
expMessages.add("ClientHandler1:PostConstruct");
expMessages.add("ClientHandler2:PostConstruct");
expMessages.add("ClientHandler3:PostConstruct");
+ expMessages.add("PreClientHandler1:PostConstruct");
+ expMessages.add("PreClientHandler2:PostConstruct");
expMessages.add("PostClientHandler1:PostConstruct");
expMessages.add("PostClientHandler2:PostConstruct");
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2010-03-26 13:47:04 UTC (rev 11866)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpoint.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.ws.jaxws.handlerlifecycle;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import org.jboss.ws.annotation.EndpointConfig;
@WebService
-@HandlerChain(file = "jaxws-client-handlers.xml")
@EndpointConfig(configName = "Custom Client Config", configFile = "META-INF/jaxws-client-config.xml")
public interface SOAPEndpoint
{
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2010-03-26 13:47:04 UTC (rev 11866)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointBean.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -39,7 +39,6 @@
@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/handlerlifecycle")
@HandlerChain(file = "jaxws-server-handlers.xml")
@SOAPBinding(style = Style.RPC)
-
@EndpointConfig(configName = "Custom Server Config", configFile = "WEB-INF/jaxws-endpoint-config.xml")
public class SOAPEndpointBean
{
Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/SOAPEndpointService.java 2010-03-26 13:54:09 UTC (rev 11867)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.handlerlifecycle;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-handlers.xml")
+public class SOAPEndpointService extends Service
+{
+ public SOAPEndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
14 years, 9 months
JBossWS SVN: r11866 - in framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws: samples/handlerchain and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-26 09:47:04 -0400 (Fri, 26 Mar 2010)
New Revision: 11866
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
Log:
[JBWS-1672][CXF-1253][JBWS-2973] fixing tests - moving @HandlerChain annotation from client SEI to Service
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -35,6 +35,7 @@
* Test SOAP12 binding type
*
* @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @since 12-Aug-2006
*/
public class HandlerScopeTestCase extends JBossWSTest
@@ -48,60 +49,23 @@
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerscope?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointService");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new SOAPEndpointService(wsdlURL, serviceName);
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
String retStr = port.echo("hello");
-
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- testForStacksNotSupportingAnnotationOnClienSEI(retStr);
- }
- else if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- testForStacksNotSupportingAnnotationOnClienSEI(retStr);
- }
- else
- {
- StringBuffer expStr = new StringBuffer("hello");
- expStr.append(":SOAP12ClientHandler");
- expStr.append(":SOAPClientHandler");
- expStr.append(":ServiceClientHandler");
- expStr.append(":ServiceWildcardClientHandler");
- expStr.append(":PortClientHandler");
- expStr.append(":PortWildcardClientHandler");
- expStr.append(":GeneralClientHandler");
- expStr.append(":GeneralServerHandler");
- expStr.append(":PortWildcardServerHandler");
- expStr.append(":PortServerHandler");
- expStr.append(":ServiceWildcardServerHandler");
- expStr.append(":ServiceServerHandler");
- expStr.append(":SOAPServerHandler");
- expStr.append(":SOAP12ServerHandler");
- expStr.append(":endpoint");
- expStr.append(":SOAP12ServerHandler");
- expStr.append(":SOAPServerHandler");
- expStr.append(":ServiceServerHandler");
- expStr.append(":ServiceWildcardServerHandler");
- expStr.append(":PortServerHandler");
- expStr.append(":PortWildcardServerHandler");
- expStr.append(":GeneralServerHandler");
- expStr.append(":GeneralClientHandler");
- expStr.append(":PortWildcardClientHandler");
- expStr.append(":PortClientHandler");
- expStr.append(":ServiceWildcardClientHandler");
- expStr.append(":ServiceClientHandler");
- expStr.append(":SOAPClientHandler");
- expStr.append(":SOAP12ClientHandler");
- assertEquals(expStr.toString(), retStr);
- }
+ assertResponse(retStr);
}
- private static void testForStacksNotSupportingAnnotationOnClienSEI(String retStr)
+ private static void assertResponse(String retStr)
{
StringBuffer expStr = new StringBuffer("hello");
+ expStr.append(":SOAP12ClientHandler");
+ expStr.append(":SOAPClientHandler");
+ expStr.append(":ServiceClientHandler");
+ expStr.append(":ServiceWildcardClientHandler");
+ expStr.append(":PortClientHandler");
+ expStr.append(":PortWildcardClientHandler");
+ expStr.append(":GeneralClientHandler");
expStr.append(":GeneralServerHandler");
expStr.append(":PortWildcardServerHandler");
expStr.append(":PortServerHandler");
@@ -117,6 +81,13 @@
expStr.append(":PortServerHandler");
expStr.append(":PortWildcardServerHandler");
expStr.append(":GeneralServerHandler");
+ expStr.append(":GeneralClientHandler");
+ expStr.append(":PortWildcardClientHandler");
+ expStr.append(":PortClientHandler");
+ expStr.append(":ServiceWildcardClientHandler");
+ expStr.append(":ServiceClientHandler");
+ expStr.append(":SOAPClientHandler");
+ expStr.append(":SOAP12ClientHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpoint.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.handlerscope;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
@@ -29,7 +28,6 @@
@WebService(targetNamespace = "http://org.jboss.ws/jaxws/handlerscope")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
-@HandlerChain(file = "jaxws-client-handlers.xml")
public interface SOAPEndpoint
{
@WebMethod
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointService.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.handlerscope;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-handlers.xml")
+public class SOAPEndpointService extends Service
+{
+ public SOAPEndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChain.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -21,13 +21,11 @@
*/
package org.jboss.test.ws.jaxws.samples.handlerchain;
-import javax.jws.HandlerChain;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@HandlerChain(file = "jaxws-handlers-client.xml") // relative path from the class file
public interface EndpointWithHandlerChain
{
public String echo(String input);
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/EndpointWithHandlerChainService.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.handlerchain;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-handlers-client.xml")
+public class EndpointWithHandlerChainService extends Service
+{
+ public EndpointWithHandlerChainService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainTestCase.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -38,6 +38,7 @@
/**
* Test the JSR-181 annotation: javax.jws.HandlerChain
*
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author Thomas.Diesler(a)jboss.org
* @since 15-Oct-2005
*/
@@ -50,6 +51,7 @@
return new JBossWSTestSetup(HandlerChainTestCase.class, "jaxws-samples-handlerchain.war");
}
+ @SuppressWarnings("unchecked")
public void testDynamicHandlerChain() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
@@ -57,7 +59,7 @@
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
-
+
BindingProvider bindingProvider = (BindingProvider)port;
List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(new LogHandler());
@@ -65,48 +67,29 @@
handlerChain.add(new RoutingHandler());
handlerChain.add(new ClientMimeHandler());
bindingProvider.getBinding().setHandlerChain(handlerChain);
-
+
String resStr = port.echo("Kermit");
assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
-
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
- return;
- }
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1507] CXF client handler cannot set mime header");
- return;
- }
-
- assertEquals("server-cookie=true", ClientMimeHandler.inboundCookie);
+ assertCookies();
}
- public void testHandlerChainOnServiceEndpointInterface() throws Exception
+ public void testHandlerChainOnService() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-handlerchain/TestService?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = new EndpointWithHandlerChainService(wsdlURL, serviceName);
EndpointWithHandlerChain port = (EndpointWithHandlerChain)service.getPort(EndpointWithHandlerChain.class);
-
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
+ assertCookies();
+ }
+
+ private void assertCookies() throws Exception
+ {
if (isIntegrationMetro())
{
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else if (isIntegrationCXF())
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- else
- {
- String resStr = port.echo("Kermit");
- assertEquals("Kermit|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn|endpoint|LogOut|AuthOut|RoutOut|RoutIn|AuthIn|LogIn", resStr);
- }
-
- if (isIntegrationMetro())
- {
System.out.println("FIXME: [JBWS-1671] Metro client handler cannot set mime header");
return;
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerJAXBTestCase.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -35,6 +35,7 @@
/**
* Test JAXWS logical handlers
*
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author Thomas.Diesler(a)jboss.org
* @since 12-Aug-2006
*/
@@ -49,7 +50,7 @@
{
String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-jaxb";
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointJAXBService(new URL(endpointAddress + "?wsdl"), serviceName);
SOAPEndpointJAXB port = (SOAPEndpointJAXB)service.getPort(SOAPEndpointJAXB.class);
BindingProvider bindingProvider = (BindingProvider)port;
@@ -58,23 +59,9 @@
String retStr = port.echo("hello");
StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalJAXBHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Outbound:LogicalJAXBHandler");
+ expStr.append(":Outbound:ProtocolHandler");
+ expStr.append(":Outbound:PortHandler");
expStr.append(":Inbound:PortHandler");
expStr.append(":Inbound:ProtocolHandler");
expStr.append(":Inbound:LogicalJAXBHandler");
@@ -82,23 +69,9 @@
expStr.append(":Outbound:LogicalJAXBHandler");
expStr.append(":Outbound:ProtocolHandler");
expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalJAXBHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Inbound:PortHandler");
+ expStr.append(":Inbound:ProtocolHandler");
+ expStr.append(":Inbound:LogicalJAXBHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/LogicalHandlerSourceTestCase.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -46,86 +46,32 @@
public void testSourceDoc() throws Exception
{
- String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc";
+ URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/doc?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointDocService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
SOAPEndpointSourceDoc port = (SOAPEndpointSourceDoc)service.getPort(SOAPEndpointSourceDoc.class);
String retStr = port.echo("hello");
-
- StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- expStr.append(":endpoint");
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
- assertEquals(expStr.toString(), retStr);
+ assertResponse(retStr);
}
-
public void testSourceRpc() throws Exception
{
- String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc";
+ URL endpointAddress = new URL("http://" + getServerHost() + ":8080/jaxws-samples-logicalhandler-source/rpc?wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/samples/logicalhandler", "SOAPEndpointRpcService");
- Service service = Service.create(new URL(endpointAddress + "?wsdl"), serviceName);
+ Service service = new SOAPEndpointSourceService(endpointAddress, serviceName);
SOAPEndpointSourceRpc port = (SOAPEndpointSourceRpc)service.getPort(SOAPEndpointSourceRpc.class);
String retStr = port.echo("hello");
-
+ assertResponse(retStr);
+ }
+
+ private void assertResponse(String retStr)
+ {
StringBuffer expStr = new StringBuffer("hello");
- if (isIntegrationNative())
- {
- expStr.append(":Outbound:LogicalSourceHandler");
- expStr.append(":Outbound:ProtocolHandler");
- expStr.append(":Outbound:PortHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Outbound:LogicalSourceHandler");
+ expStr.append(":Outbound:ProtocolHandler");
+ expStr.append(":Outbound:PortHandler");
expStr.append(":Inbound:PortHandler");
expStr.append(":Inbound:ProtocolHandler");
expStr.append(":Inbound:LogicalSourceHandler");
@@ -133,23 +79,9 @@
expStr.append(":Outbound:LogicalSourceHandler");
expStr.append(":Outbound:ProtocolHandler");
expStr.append(":Outbound:PortHandler");
- if (isIntegrationNative())
- {
- expStr.append(":Inbound:PortHandler");
- expStr.append(":Inbound:ProtocolHandler");
- expStr.append(":Inbound:LogicalSourceHandler");
- }
- else
- {
- if (isIntegrationMetro())
- {
- System.out.println("FIXME: [JBWS-1672] Metro does not respect @HandlerChain on client SEI");
- }
- else
- {
- System.out.println("FIXME: [CXF-1253] CXF does not respect @HandlerChain on client SEI");
- }
- }
+ expStr.append(":Inbound:PortHandler");
+ expStr.append(":Inbound:ProtocolHandler");
+ expStr.append(":Inbound:LogicalSourceHandler");
assertEquals(expStr.toString(), retStr);
}
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXB.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -30,14 +29,11 @@
import javax.xml.ws.ResponseWrapper;
@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
public interface SOAPEndpointJAXB
{
-
@WebMethod
@WebResult(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name = "result")
@RequestWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.Echo")
@ResponseWrapper(className = "org.jboss.test.ws.jaxws.samples.logicalhandler.EchoResponse")
public String echo(@WebParam(targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler", name="String_1") String string1);
-
}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointJAXBService.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-jaxb-handlers.xml")
+public class SOAPEndpointJAXBService extends Service
+{
+ public SOAPEndpointJAXBService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceDoc.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
@@ -30,7 +29,6 @@
import javax.xml.ws.ResponseWrapper;
@WebService(name = "SOAPEndpointDoc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-source-handlers.xml")
public interface SOAPEndpointSourceDoc
{
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java 2010-03-26 13:37:41 UTC (rev 11865)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceRpc.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -21,14 +21,12 @@
*/
package org.jboss.test.ws.jaxws.samples.logicalhandler;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService(name = "SOAPEndpointRpc", targetNamespace = "http://org.jboss.ws/jaxws/samples/logicalhandler")
-@HandlerChain(file = "jaxws-client-source-handlers.xml")
@SOAPBinding(style = Style.RPC)
public interface SOAPEndpointSourceRpc
{
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/logicalhandler/SOAPEndpointSourceService.java 2010-03-26 13:47:04 UTC (rev 11866)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxws.samples.logicalhandler;
+
+import java.net.URL;
+
+import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+@HandlerChain(file = "jaxws-client-source-handlers.xml")
+public class SOAPEndpointSourceService extends Service
+{
+ public SOAPEndpointSourceService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+}
14 years, 9 months
JBossWS SVN: r11865 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-03-26 09:37:41 -0400 (Fri, 26 Mar 2010)
New Revision: 11865
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
Log:
[JBWS-2973] excluding tests
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-03-26 06:44:42 UTC (rev 11864)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-03-26 13:37:41 UTC (rev 11865)
@@ -51,6 +51,6 @@
# [JBWS-2895] JAX-RPC available from AS 6.0.0.M3
org/jboss/test/ws/jaxrpc/**
-# [JBWS-2960] TODO
+# TODO investigate failures
org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
+org/jboss/test/ws/jaxws/handlerscope/*TestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-03-26 06:44:42 UTC (rev 11864)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-03-26 13:37:41 UTC (rev 11865)
@@ -51,6 +51,6 @@
# [JBWS-2895] JAX-RPC available from AS 6.0.0.M3
org/jboss/test/ws/jaxrpc/**
-# [JBWS-2960] TODO
+# TODO investigate failures
org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
+org/jboss/test/ws/jaxws/handlerscope/*TestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-03-26 06:44:42 UTC (rev 11864)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-03-26 13:37:41 UTC (rev 11865)
@@ -51,6 +51,6 @@
# [JBWS-2895] JAX-RPC available from AS 6.0.0.M3
org/jboss/test/ws/jaxrpc/**
-# [JBWS-2960] TODO
+# TODO investigate failures
org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
+org/jboss/test/ws/jaxws/handlerscope/*TestCase.*
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-03-26 06:44:42 UTC (rev 11864)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-03-26 13:37:41 UTC (rev 11865)
@@ -47,6 +47,6 @@
org/jboss/test/ws/jaxws/jbws2942/**
org/jboss/test/ws/jaxws/endpointReference/EndpointReferenceBuilderTestCase.*
-# [JBWS-2960] TODO
+# TODO investigate failures
org/jboss/test/ws/jaxws/jbws2960/*TestCase.*
-
+org/jboss/test/ws/jaxws/handlerscope/*TestCase.*
14 years, 9 months