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