cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r548796 - in /incubator/cxf/trunk: parent/pom.xml rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Date Tue, 19 Jun 2007 16:48:29 GMT
Author: dkulp
Date: Tue Jun 19 09:48:28 2007
New Revision: 548796

URL: http://svn.apache.org/viewvc?view=rev&rev=548796
Log:
Update to new version of ws-metatdata jar from Geronimo
Fix use of EPR nexted inside other structures

Modified:
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?view=diff&rev=548796&r1=548795&r2=548796
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Tue Jun 19 09:48:28 2007
@@ -685,7 +685,7 @@
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>
                 <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
-                <version>1.1</version>
+                <version>1.1.1</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.activemq</groupId>

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?view=diff&rev=548796&r1=548795&r2=548796
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Tue Jun 19 09:48:28 2007
@@ -72,7 +72,6 @@
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.apache.cxf.ws.addressing.ObjectFactory;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
@@ -365,7 +364,7 @@
     }
     
     public JAXBContext createJAXBContext(Set<Class<?>> classes,
-                                                   String defaultNs) throws JAXBException
{
+                                          String defaultNs) throws JAXBException {
         Iterator it = classes.iterator();
         String className = "";
         Object remoteExceptionObject = null;
@@ -389,27 +388,31 @@
                 defaultNs = null;
             }
         }
-
-        if (classes.contains(EndpointReferenceType.class)
-            || classes.contains(ObjectFactory.class)) {
-            //ws-addressing is used, lets add the specific types
-            try {
-                classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.AttributedQNameType"));
-                classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.ObjectFactory"));
-                classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.ServiceNameType"));
-            } catch (ClassNotFoundException e) {
-                // REVISIT - ignorable if WS-ADDRESSING not available?
-                // maybe add a way to allow interceptors to add stuff to the
-                // context?
-            }
-        }
         
         Map<String, Object> map = new HashMap<String, Object>();
         if (defaultNs != null) {
             map.put("com.sun.xml.bind.defaultNamespaceRemap", defaultNs);
         }
         
-        return JAXBContext.newInstance(classes.toArray(new Class[classes.size()]), map);
+        JAXBContext ctx = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),
map);
+        if (ctx instanceof JAXBContextImpl) {
+            JAXBContextImpl rictx = (JAXBContextImpl)ctx;
+            if (rictx.getBeanInfo(EndpointReferenceType.class) != null) {
+                //ws-addressing is used, lets add the specific types
+                try {
+                    classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.ObjectFactory"));
+                    classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.AttributedQNameType"));

+                    classes.add(Class.forName("org.apache.cxf.ws.addressing.wsdl.ServiceNameType"));
+                    ctx = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),
map);
+                } catch (ClassNotFoundException e) {
+                    // REVISIT - ignorable if WS-ADDRESSING not available?
+                    // maybe add a way to allow interceptors to add stuff to the
+                    // context?
+                } 
+            }
+        }
+        
+        return ctx;
     }
 
 }



Mime
View raw message