Author: dkulp
Date: Mon Apr 5 02:12:38 2010
New Revision: 930780
URL: http://svn.apache.org/viewvc?rev=930780&view=rev
Log:
Merged revisions 930240 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r930240 | ema | 2010-04-02 07:16:51 -0400 (Fri, 02 Apr 2010) | 1 line
[CXF-2723]:Reenable the ClientProxyFactoryBean and JAXWSClientFactoryBean
configuration during port creation. This makes other Configurer implementation
can replace the default dababinding with
ClientProxyFactoryBean.getServiceFactory.setDatabinding(ownConfiguredDatabinding)
in client side
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=930780&r1=930779&r2=930780&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Mon Apr 5 02:12:38 2010
@@ -401,6 +401,10 @@ public class ServiceImpl extends Service
if (wsdlURL != null) {
proxyFac.setWsdlURL(wsdlURL);
}
+
+ configureObject(proxyFac);
+ configureObject(clientFac);
+
if (portName == null) {
QName portTypeName = getPortTypeName(serviceEndpointInterface);
Modified:
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java?rev=930780&r1=930779&r2=930780&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
Mon Apr 5 02:12:38 2010
@@ -38,9 +38,12 @@ import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.calculator.CalculatorPortType;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.endpoint.NullConduitSelector;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxb.JAXBDataBinding;
import org.apache.hello_world_soap_http.Greeter;
import org.apache.hello_world_soap_http.SOAPService;
@@ -60,6 +63,10 @@ public class ServiceImplTest extends Abs
private static final QName SOAP_PORT1 =
new QName("http://apache.org/hello_world_soap_http", "SoapPort1");
+ private boolean isJAXWSClientFactoryConfigured;
+
+ private boolean isClientProxyFactoryBeanConfigured;
+
@Test
public void testServiceImpl() throws Exception {
SOAPService service = new SOAPService();
@@ -260,4 +267,32 @@ public class ServiceImplTest extends Abs
}
}
+ @Test
+ //CXF-2723 :Allow configuration of JaxWsClientFactoryBean during port
creation
+ public void testConfigureBean() throws Exception {
+ Configurer oldConfiguer = this.getBus().getExtension(Configurer.class);
+ JAXWSClientFactoryCongfiguer clientConfiguer = new
JAXWSClientFactoryCongfiguer();
+ getBus().setExtension(clientConfiguer, Configurer.class);
+ URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
+ ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1,
ServiceImpl.class);
+ service.createPort(PORT_1, null, CalculatorPortType.class);
+ assertTrue("The JAXWSClientFcatoryBean is not configured by the new
configurer",
+ isJAXWSClientFactoryConfigured);
+ assertTrue("The ClientProxyFcatoryBean is not configured by the new
configurer",
+ isClientProxyFactoryBeanConfigured);
+ getBus().setExtension(oldConfiguer, Configurer.class);
+ }
+
+ class JAXWSClientFactoryCongfiguer extends ConfigurerImpl {
+ @Override
+ public synchronized void configureBean(String bn, Object beanInstance,
boolean checkWildcards) {
+ if (beanInstance instanceof JaxWsClientFactoryBean) {
+ isJAXWSClientFactoryConfigured = true;
+ }
+ if (beanInstance instanceof ClientProxyFactoryBean) {
+ isClientProxyFactoryBeanConfigured = true;
+ }
+ }
+ }
+
}