You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2010/04/02 13:16:51 UTC
svn commit: r930240 - in /cxf/trunk/rt/frontend/jaxws/src:
main/java/org/apache/cxf/jaxws/ServiceImpl.java
test/java/org/apache/cxf/jaxws/ServiceImplTest.java
Author: ema
Date: Fri Apr 2 11:16:51 2010
New Revision: 930240
URL: http://svn.apache.org/viewvc?rev=930240&view=rev
Log:
[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/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=930240&r1=930239&r2=930240&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Fri Apr 2 11:16:51 2010
@@ -406,6 +406,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/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java?rev=930240&r1=930239&r2=930240&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java Fri Apr 2 11:16:51 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;
+ }
+ }
+ }
+
}