Author: dkulp
Date: Fri Sep 11 20:20:35 2009
New Revision: 814012
URL: http://svn.apache.org/viewvc?rev=814012&view=rev
Log:
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.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 11 20:20:35 2009
@@ -1 +1 @@
-/cxf/trunk:813943,813953
+/cxf/trunk:813943,813953,814011
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
Fri Sep 11 20:20:35 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.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Fri Sep 11 20:20:35 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.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/TypeClassInitializer.java
Fri Sep 11 20:20:35 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.2.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.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/endpoint/dynamic/JaxWsDynamicClientFactory.java
Fri Sep 11 20:20:35 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.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
Fri Sep 11 20:20:35 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.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java?rev=814012&r1=814011&r2=814012&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
(original)
+++
cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
Fri Sep 11 20:20:35 2009
@@ -81,5 +81,5 @@
r = (Operation1Response)rparts[0];
assertEquals(md5(bucketOfBytes), r.getStatus());
}
-
+
}