Author: ningjiang
Date: Wed Aug 1 00:13:44 2007
New Revision: 561682
URL: http://svn.apache.org/viewvc?view=rev&rev=561682
Log:
CXF-869 clean up the simple front end and jaxw front end spring support codes
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
incubator/cxf/trunk/rt/frontend/simple/pom.xml
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
Wed Aug 1 00:13:44 2007
@@ -32,6 +32,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.binding.BindingConfiguration;
import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
import org.apache.cxf.configuration.Configurable;
import org.apache.cxf.configuration.Configurer;
@@ -429,6 +430,14 @@
public void setImplementorClass(Class implementorClass) {
this.implementorClass = implementorClass;
+ }
+
+ public void setBindingConfig(BindingConfiguration config) {
+ serverFactory.setBindingConfig(config);
+ }
+
+ public BindingConfiguration getBindingConfig() {
+ return serverFactory.getBindingConfig();
}
/*
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Wed Aug 1 00:13:44 2007
@@ -98,6 +98,8 @@
if ("properties".equals(n.getLocalName())) {
Map map = ctx.getDelegate().parseMapElement((Element) n,
bean.getBeanDefinition());
bean.addPropertyValue("properties", map);
+ } else if ("binding".equals(name)) {
+ setFirstChildAsProperty((Element) n, ctx, bean,
"bindingConfig");
} else if ("inInterceptors".equals(name) ||
"inFaultInterceptors".equals(name)
|| "outInterceptors".equals(name) ||
"outFaultInterceptors".equals(name)
|| "features".equals(name)) {
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Wed Aug 1 00:13:44 2007
@@ -86,6 +86,23 @@
assertTrue(ep.getInvoker() instanceof NullInvoker);
assertTrue(ep.getService().getInvoker() instanceof NullInvoker);
+ bean = ctx.getBean("simpleWithBindingUri");
+ assertNotNull(bean);
+ ep = (EndpointImpl) bean;
+ assertEquals("get the wrong bindingId",
+ ep.getBindingUri(),
+ "http://cxf.apache.org/bindings/xformat");
+
+ bean = ctx.getBean("simpleWithBinding");
+ assertNotNull(bean);
+ ep = (EndpointImpl) bean;
+ BindingConfiguration bc = ep.getBindingConfig();
+ assertTrue(bc instanceof SoapBindingConfiguration);
+ SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
+ assertTrue(sbc.getVersion() instanceof Soap12);
+ assertTrue("the soap configure should set isMtomEnabled to be true",
+ sbc.isMtomEnabled());
+
bean = ctx.getBean("implementorClass");
assertNotNull(bean);
ep = (EndpointImpl) bean;
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
Wed Aug 1 00:13:44 2007
@@ -20,11 +20,14 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<bean class="org.apache.cxf.transport.local.LocalTransportFactory"
lazy-init="false">
@@ -33,6 +36,7 @@
<value>http://cxf.apache.org/transports/local</value>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+ <value>http://schemas.xmlsoap.org/wsdl/http/</value>
</list>
</property>
</bean>
@@ -44,6 +48,10 @@
<jaxws:endpoint id="simpleWithAddress"
implementor="#greeter" address="http://localhost:8080/simpleWithAddress"/>
+ <jaxws:endpoint id="simpleWithBindingUri"
+ implementor="#greeter" address="http://localhost:8080/simpeWithHttpBinding"
+ bindingUri="http://cxf.apache.org/bindings/xformat"/>
+
<jaxws:endpoint id="inlineImplementor"
address="http://localhost:8080/simpleWithAddress">
<jaxws:implementor>
<bean class="org.apache.hello_world_soap_http.GreeterImpl">
@@ -52,6 +60,12 @@
</jaxws:implementor>
</jaxws:endpoint>
+ <jaxws:endpoint id="simpleWithBinding"
+ implementor="#greeter" address="http://localhost:8080/simpleWithAddress">
+ <jaxws:binding>
+ <soap:soapBinding mtomEnabled="true" version="1.2"/>
+ </jaxws:binding>
+ </jaxws:endpoint>
<jaxws:endpoint id="inlineInvoker"
address="http://localhost:8080/simpleWithAddress">
<jaxws:implementor>
Modified: incubator/cxf/trunk/rt/frontend/simple/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/pom.xml?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/pom.xml (original)
+++ incubator/cxf/trunk/rt/frontend/simple/pom.xml Wed Aug 1 00:13:44 2007
@@ -45,6 +45,13 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-bindings-xml</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
<artifactId>cxf-testutils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Wed Aug 1 00:13:44 2007
@@ -197,6 +197,14 @@
public void setConduitSelector(ConduitSelector selector) {
clientFactoryBean.setConduitSelector(selector);
}
+
+ public void setBindingId(String bind) {
+ clientFactoryBean.setBindingId(bind);
+ }
+
+ public String getBindingId() {
+ return clientFactoryBean.getBindingId();
+ }
public ReflectionServiceFactoryBean getServiceFactory() {
return clientFactoryBean.getServiceFactory();
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
Wed Aug 1 00:13:44 2007
@@ -68,6 +68,8 @@
if ("properties".equals(name)) {
Map map = ctx.getDelegate().parseMapElement(e,
bean.getBeanDefinition());
bean.addPropertyValue("properties", map);
+ } else if ("binding".equals(name)) {
+ setFirstChildAsProperty(e, ctx, bean, "bindingConfig");
} else if ("inInterceptors".equals(name) ||
"inFaultInterceptors".equals(name)
|| "outInterceptors".equals(name) ||
"outFaultInterceptors".equals(name)
|| "features".equals(name)) {
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/SpringBeansTest.java
Wed Aug 1 00:13:44 2007
@@ -30,6 +30,7 @@
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.frontend.ServerFactoryBean;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.LoggingInInterceptor;
@@ -67,6 +68,10 @@
SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
assertTrue(sbc.getVersion() instanceof Soap12);
+ bean = (ServerFactoryBean) ctx.getBean("simpleWithBindingId");
+ assertEquals("get the wrong BindingId",
+ bean.getBindingId(),
+ "http://cxf.apache.org/bindings/xformat");
}
@@ -78,6 +83,12 @@
Object bean = ctx.getBean("client1.proxyFactory");
assertNotNull(bean);
+ ClientProxyFactoryBean cpfbean = (ClientProxyFactoryBean)bean;
+ BindingConfiguration bc = cpfbean.getBindingConfig();
+ assertTrue(bc instanceof SoapBindingConfiguration);
+ SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
+ assertTrue(sbc.getVersion() instanceof Soap12);
+
HelloService greeter = (HelloService) ctx.getBean("client1");
assertNotNull(greeter);
@@ -110,5 +121,13 @@
}
assertTrue(saaj);
assertTrue(logging);
+
+ ClientProxyFactoryBean clientProxyFactoryBean =
+ (ClientProxyFactoryBean) ctx.getBean("client2.proxyFactory");
+ assertNotNull(clientProxyFactoryBean);
+
+ assertEquals("get the wrong bindingId",
+ clientProxyFactoryBean.getBindingId(),
+ "http://cxf.apache.org/bindings/xformat");
}
}
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/clients.xml
Wed Aug 1 00:13:44 2007
@@ -27,14 +27,16 @@
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
-
+
<bean class="org.apache.cxf.transport.local.LocalTransportFactory"
lazy-init="false">
<property name="transportIds">
<list>
<value>http://cxf.apache.org/transports/local</value>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+ <value>http://schemas.xmlsoap.org/wsdl/http/</value>
</list>
</property>
</bean>
@@ -47,6 +49,9 @@
address="http://localhost:9000/foo"
serviceName="s:SOAPService"
xmlns:s="http://apache.org/hello_world_soap_http">
+ <simple:binding>
+ <soap:soapBinding mtomEnabled="true" version="1.2"/>
+ </simple:binding>
<simple:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
<ref bean="saajIn"/>
@@ -59,5 +64,12 @@
<bean class="org.apache.cxf.endpoint.NullConduitSelector"/>
</simple:conduitSelector>
</simple:client>
-
+
+ <simple:client id="client2"
+ serviceClass="org.apache.cxf.service.factory.HelloService"
+ address="http://localhost:9000/foo2"
+ serviceName="s:XMLService"
+ xmlns:s="http://apache.org/hello_world_soap_http"
+ bindingId="http://cxf.apache.org/bindings/xformat">
+ </simple:client>
</beans>
Modified:
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml?view=diff&rev=561682&r1=561681&r2=561682
==============================================================================
---
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
(original)
+++
incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml
Wed Aug 1 00:13:44 2007
@@ -27,6 +27,7 @@
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<bean class="org.apache.cxf.transport.local.LocalTransportFactory"
lazy-init="false">
@@ -35,6 +36,7 @@
<value>http://cxf.apache.org/transports/local</value>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+ <value>http://schemas.xmlsoap.org/wsdl/http/</value>
</list>
</property>
</bean>
@@ -46,6 +48,10 @@
<simple:server id="simpleWithAddress"
serviceBean="#greeter" address="http://localhost:8080/simpleWithAddress"/>
+ <simple:server id="simpleWithBindingId"
+ serviceBean="#greeter" address="http://localhost:8080/simpleWithAddress"
+ bindingId="http://cxf.apache.org/bindings/xformat"/>
+
<simple:server id="inlineImplementor"
address="http://localhost:8080/simpleWithAddress">
<simple:serviceBean>
<bean class="org.apache.cxf.service.factory.HelloServiceImpl"/>