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;
+ }
+}