Author: dkulp Date: Fri Sep 11 20:23:49 2009 New Revision: 814013 URL: http://svn.apache.org/viewvc?rev=814013&view=rev Log: Merged revisions 814012 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................ r814012 | dkulp | 2009-09-11 16:20:35 -0400 (Fri, 11 Sep 2009) | 10 lines Merged revisions 814011 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r814011 | dkulp | 2009-09-11 16:16:33 -0400 (Fri, 11 Sep 2009) | 2 lines [CXF-2415] Fix issues with dynamic client not properly using JAX-WS interceptors that cause strange failures ........ ................ Modified: cxf/branches/2.1.x-fixes/ (props changed) cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java 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/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Fri Sep 11 20:23:49 2009 @@ -0,0 +1,2 @@ +/cxf/branches/2.2.x-fixes:814012 +/cxf/trunk:814011 Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=814013&r1=814012&r2=814013&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original) +++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Fri Sep 11 20:23:49 2009 @@ -151,7 +151,11 @@ EndpointInfo epfo = findEndpoint(svc, port); try { - getConduitSelector().setEndpoint(new EndpointImpl(bus, svc, epfo)); + if (endpointImplFactory != null) { + getConduitSelector().setEndpoint(endpointImplFactory.newEndpointImpl(bus, svc, epfo)); + } else { + getConduitSelector().setEndpoint(new EndpointImpl(bus, svc, epfo)); + } } catch (EndpointException epex) { throw new IllegalStateException("Unable to create endpoint: " + epex.getMessage(), epex); } 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=814013&r1=814012&r2=814013&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 Fri Sep 11 20:23:49 2009 @@ -362,13 +362,18 @@ // Setup the new classloader! Thread.currentThread().setContextClassLoader(cl); - TypeClassInitializer visitor = new TypeClassInitializer(svcfo, intermediateModel); + TypeClassInitializer visitor = new TypeClassInitializer(svcfo, + intermediateModel, + allowWrapperOps()); visitor.walk(); // delete the classes files FileUtils.removeDir(classes); return client; } - + protected boolean allowWrapperOps() { + return false; + } + private void addBindingFiles(List<String> bindingFiles, SchemaCompiler compiler) { if (bindingFiles != null) { for (String s : bindingFiles) { Modified: cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java?rev=814013&r1=814012&r2=814013&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java (original) +++ cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java Fri Sep 11 20:23:49 2009 @@ -44,16 +44,20 @@ private static final Logger LOG = LogUtils.getL7dLogger(TypeClassInitializer.class); S2JJAXBModel model; + boolean allowWrapperOperations; - public TypeClassInitializer(ServiceInfo serviceInfo, S2JJAXBModel model) { + public TypeClassInitializer(ServiceInfo serviceInfo, + S2JJAXBModel model, + boolean allowWr) { super(serviceInfo); this.model = model; + this.allowWrapperOperations = allowWr; } @Override public void begin(MessagePartInfo part) { OperationInfo op = part.getMessageInfo().getOperation(); - if (op.isUnwrappedCapable() && !op.isUnwrapped()) { + if (!allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped()) { return; } @@ -120,6 +124,12 @@ rootType = rootType.elementType(); arrayCount++; } + if (arrayCount == 0 + && part.isElement() + && part.getXmlSchema() instanceof XmlSchemaElement + && ((XmlSchemaElement)part.getXmlSchema()).getMaxOccurs() > 1) { + arrayCount = 1; + } cls = getClassByName(rootType); // bmargulies cannot find a way to ask the JVM to do this without creating // an array object on the way. Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java?rev=814013&r1=814012&r2=814013&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java Fri Sep 11 20:23:49 2009 @@ -46,7 +46,10 @@ protected EndpointImplFactory getEndpointImplFactory() { return JaxWsEndpointImplFactory.getSingleton(); } - + protected boolean allowWrapperOps() { + return true; + } + /** * Create a new instance using a specific <tt>Bus</tt>. * Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=814013&r1=814012&r2=814013&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java (original) +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java Fri Sep 11 20:23:49 2009 @@ -61,8 +61,10 @@ for (MessagePartInfo part : parts) { if (part.getIndex() != 0 && part.getTypeClass() != null) { Holder holder = (Holder)outHolders.get(part.getIndex() - 1); - holder.value = inObjects.get(part); - inObjects.put(part, holder); + if (holder != null) { + holder.value = inObjects.get(part); + inObjects.put(part, holder); + } } } } else { Modified: cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java?rev=814013&r1=814012&r2=814013&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java (original) +++ cxf/branches/2.1.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java Fri Sep 11 20:23:49 2009 @@ -81,5 +81,5 @@ r = (Operation1Response)rparts[0]; assertEquals(md5(bucketOfBytes), r.getStatus()); } - + }
