cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r704938 - in /cxf/branches/2.1.x-fixes: ./ parent/ rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/ tools/wsdlto/databinding/jaxb/src/main/java/org/a...
Date Wed, 15 Oct 2008 15:05:17 GMT
Author: dkulp
Date: Wed Oct 15 08:05:17 2008
New Revision: 704938

URL: http://svn.apache.org/viewvc?rev=704938&view=rev
Log:
Merged revisions 704937 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r704937 | dkulp | 2008-10-15 10:59:50 -0400 (Wed, 15 Oct 2008) | 3 lines
  
  Work around https://jaxb.dev.java.net/issues/show_bug.cgi?id=557 if JAXB 2.1.8 is used instead
of 2.1.7.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/parent/pom.xml
    cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
    cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Oct 15 08:05:17 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584,704937

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/parent/pom.xml?rev=704938&r1=704937&r2=704938&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.1.x-fixes/parent/pom.xml Wed Oct 15 08:05:17 2008
@@ -47,7 +47,7 @@
         <jaxb.xjc.version>2.1.7</jaxb.xjc.version>
         <jetty.version>6.1.9</jetty.version>
         <saaj.version>1.3</saaj.version>
-        <saaj.impl.version>1.3</saaj.impl.version>
+        <saaj.impl.version>1.3.2</saaj.impl.version>
         <spring.version>2.0.8</spring.version>
         <spring.mock>spring-mock</spring.mock>
         <wsdl4j.version>1.6.2</wsdl4j.version>

Modified: cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=704938&r1=704937&r2=704938&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Wed Oct 15 08:05:17 2008
@@ -21,6 +21,7 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -321,11 +322,18 @@
         
     }
 
+    @SuppressWarnings("deprecation")
     private void addSchemas(String wsdlUrl, Collection<SchemaInfo> schemas, SchemaCompiler
compiler) {
         int num = 1;
         for (SchemaInfo schema : schemas) {
             Element el = schema.getElement();
-            
+
+            //For JAXB 2.1.8
+            InputSource is = new InputSource((InputStream)null);
+            is.setSystemId(wsdlUrl + "#types" + num);
+            is.setPublicId(wsdlUrl + "#types" + num);
+            compiler.getOptions().addGrammar(is);
+
             compiler.parseSchema(wsdlUrl + "#types" + num, el);
             num++;
         }

Modified: cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java?rev=704938&r1=704937&r2=704938&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
Wed Oct 15 08:05:17 2008
@@ -29,6 +29,7 @@
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
@@ -67,47 +68,55 @@
 
         conversationToken.setInclusion(consts.getInclusionFromAttributeValue(inclusionValue));
 
-        Element issuer = DOMUtils.getFirstChildWithName(element, consts.getNamespace(), SPConstants.ISSUER);
-        if (issuer != null) {
-            conversationToken.setIssuerEpr(DOMUtils.getFirstElement(issuer));
-        }
-
-        element = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
-        if (element != null) {
-            if (DOMUtils.getFirstChildWithName(element, 
-                                               consts.getNamespace(),
-                                               SPConstants.REQUIRE_DERIVED_KEYS) != null)
{
-                conversationToken.setDerivedKeys(true);
-            } else if (DOMUtils.getFirstChildWithName(element, 
-                                                      SP12Constants.REQUIRE_IMPLIED_DERIVED_KEYS)
!= null) {
-                conversationToken.setImpliedDerivedKeys(true);
-            } else if (DOMUtils.getFirstChildWithName(element, 
-                                                      SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS)
!= null) {
-                conversationToken.setExplicitDerivedKeys(true);
-            }
-
-
-            if (DOMUtils.getFirstChildWithName(element,
-                                               consts.getNamespace(),
-                                               SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE)
!= null) {
-                conversationToken.setRequireExternalUriRef(true);
-            }
-
-            if (DOMUtils.getFirstChildWithName(element, 
-                                               consts.getNamespace(),
-                                               SPConstants.SC10_SECURITY_CONTEXT_TOKEN) !=
null) {
-                conversationToken.setSc10SecurityContextToken(true);
-            }
-
-            Element bootstrapPolicyElement = DOMUtils.getFirstChildWithName(element, 
-                                                                            consts.getNamespace(),
-                                                                            SPConstants.BOOTSTRAP_POLICY);
-            if (bootstrapPolicyElement != null) {
-                Policy policy = builder.getPolicy(DOMUtils.getFirstElement(bootstrapPolicyElement));
-                conversationToken.setBootstrapPolicy(policy);
+        
+        Element elem = DOMUtils.getFirstElement(element);
+        while (elem != null) {
+            QName qn = DOMUtils.getElementQName(elem);
+            if (PolicyConstants.isPolicyElem(qn)) {
+                if (DOMUtils.getFirstChildWithName(elem, 
+                                                   consts.getNamespace(),
+                                                   SPConstants.REQUIRE_DERIVED_KEYS) != null)
{
+                    conversationToken.setDerivedKeys(true);
+                } else if (DOMUtils.getFirstChildWithName(elem, 
+                                                          SP12Constants
+                                                              .REQUIRE_IMPLIED_DERIVED_KEYS)

+                                                          != null) {
+                    conversationToken.setImpliedDerivedKeys(true);
+                } else if (DOMUtils.getFirstChildWithName(elem, 
+                                                          SP12Constants
+                                                              .REQUIRE_EXPLICIT_DERIVED_KEYS)
+                                                              != null) {
+                    conversationToken.setExplicitDerivedKeys(true);
+                }
+
+
+                if (DOMUtils.getFirstChildWithName(elem,
+                                                   consts.getNamespace(),
+                                                   SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE)
!= null) {
+                    conversationToken.setRequireExternalUriRef(true);
+                }
+
+                if (DOMUtils.getFirstChildWithName(elem, 
+                                                   consts.getNamespace(),
+                                                   SPConstants.SC10_SECURITY_CONTEXT_TOKEN)
!= null) {
+                    conversationToken.setSc10SecurityContextToken(true);
+                }
+
+                Element bootstrapPolicyElement = DOMUtils.getFirstChildWithName(elem, 
+                                                                                consts.getNamespace(),
+                                                                                SPConstants.BOOTSTRAP_POLICY);
+                if (bootstrapPolicyElement != null) {
+                    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(bootstrapPolicyElement));
+                    conversationToken.setBootstrapPolicy(policy);
+                }
+
+            } else if (consts.getNamespace().equals(qn.getNamespaceURI())
+                && SPConstants.ISSUER.equals(qn.getLocalPart())) {
+                conversationToken.setIssuerEpr(DOMUtils.getFirstElement(elem));         
      
             }
+            elem = DOMUtils.getNextElement(elem);
         }
-
+        
         return conversationToken;
     }
 

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=704938&r1=704937&r2=704938&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Wed Oct 15 08:05:17 2008
@@ -19,6 +19,7 @@
 package org.apache.cxf.tools.wsdlto.databinding.jaxb;
 import java.io.File;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.Writer;
 import java.lang.reflect.Field;
 import java.net.URL;
@@ -130,7 +131,6 @@
         SchemaCompilerImpl schemaCompiler = (SchemaCompilerImpl)XJC.createSchemaCompiler();
         ClassCollector classCollector = context.get(ClassCollector.class);
         
-        
         ClassNameAllocatorImpl allocator 
             = new ClassNameAllocatorImpl(classCollector,
                                          c.optionSet(ToolConstants.CFG_AUTORESOLVE));
@@ -143,22 +143,14 @@
         List<InputSource> jaxbBindings = context.getJaxbBindingFile();
         Map<String, Element> schemaLists = CastUtils.cast((Map<?, ?>)context.get(ToolConstants.SCHEMA_MAP));
 
-        for (String key : schemaLists.keySet()) {
-            Element ele = schemaLists.get(key);
-            ele = removeImportElement(ele);
-            String tns = ele.getAttribute("targetNamespace");
-            if (StringUtils.isEmpty(tns)) {
-                continue;
-            }
-            if (context.get(ToolConstants.CFG_VALIDATE_WSDL) != null) {
-                validateSchema(ele);
-            }           
-            schemaCompiler.parseSchema(key, ele);
+        
+        Options opts = null;
+        opts = getOptions(schemaCompiler);
 
-        }
+        addSchemas(opts, schemaCompiler, schemaLists);
 
         for (InputSource binding : jaxbBindings) {
-            schemaCompiler.parseSchema(binding);
+            opts.addBindFile(binding);
         }
 
                        
@@ -176,8 +168,6 @@
             schemaCompiler.setDefaultPackageName(context.getPackageName());
         }  
         
-        Options opts = null;
-        opts = getOptions(schemaCompiler);
         
         Vector<String> args = new Vector<String>();
         if (context.get(ToolConstants.CFG_NO_ADDRESS_BINDING) == null) {
@@ -185,7 +175,7 @@
             args.add("-extension");
             URL bindingFileUrl = getClass().getResource("W3CEPRJaxbBinding.xml");
             InputSource ins = new InputSource(bindingFileUrl.toString());
-            schemaCompiler.parseSchema(ins);
+            opts.addBindFile(ins);
         }
         
         if (context.get(ToolConstants.CFG_XJC_ARGS) != null) {
@@ -200,7 +190,6 @@
         if (context.get(ToolConstants.CFG_NO_ADDRESS_BINDING) == null
             || context.get(ToolConstants.CFG_XJC_ARGS) != null) {
             try {
-
                 // keep parseArguments happy, supply dummy required command-line
                 // opts
                 opts.addGrammar(new InputSource("null"));
@@ -248,6 +237,25 @@
         initialized = true;
     }
 
+    private void addSchemas(Options opts, SchemaCompilerImpl schemaCompiler,
+                            Map<String, Element> schemaLists) {
+        for (String key : schemaLists.keySet()) {
+            Element ele = schemaLists.get(key);
+            ele = removeImportElement(ele);
+            String tns = ele.getAttribute("targetNamespace");
+            if (StringUtils.isEmpty(tns)) {
+                continue;
+            }
+            if (context.get(ToolConstants.CFG_VALIDATE_WSDL) != null) {
+                validateSchema(ele);
+            }           
+            InputSource is = new InputSource((InputStream)null);
+            is.setSystemId(key);
+            is.setPublicId(key);
+            opts.addGrammar(is);
+            schemaCompiler.parseSchema(key, ele);
+        }
+    }
     private String getPluginUsageString(Options opts) {
         StringBuffer buf = new StringBuffer();
         buf.append("\navaliable plugin options:\n");

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=704938&r1=704937&r2=704938&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Wed Oct 15 08:05:17 2008
@@ -280,7 +280,8 @@
 
     @Test
     public void testDefaultLoadNSMappingOFF() throws Exception {
-        String[] args = new String[] {"-dns", "false", "-d", output.getCanonicalPath(), "-noAddressBinding",
+        String[] args = new String[] {"-dns", "false",
+                                      "-d", output.getCanonicalPath(), "-noAddressBinding",
                                       getLocation("/wsdl2java_wsdl/basic_callback.wsdl")};
 
         WSDLToJava.main(args);



Mime
View raw message