cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r723338 - in /cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/EndpointImpl.java test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java test/java/org/apache/cxf/jaxws/spring/endpoints.xml
Date Thu, 04 Dec 2008 14:44:16 GMT
Author: ningjiang
Date: Thu Dec  4 06:44:16 2008
New Revision: 723338

URL: http://svn.apache.org/viewvc?rev=723338&view=rev
Log:
CXF-1931 added setDataBinding into EndpointImpl

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?rev=723338&r1=723337&r2=723338&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Thu Dec
 4 06:44:16 2008
@@ -48,6 +48,7 @@
 import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.configuration.Configurable;
 import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerImpl;
 import org.apache.cxf.feature.AbstractFeature;
@@ -446,9 +447,18 @@
     public void setBindingUri(String binding) {
         this.bindingUri = binding;
     }
+    
     public String getBindingUri() {
         return this.bindingUri;
     }
+    
+    public void setDataBinding(DataBinding dataBinding) {
+        serverFactory.setDataBinding(dataBinding);
+    }
+    
+    public DataBinding getDataBinding() {
+        return serverFactory.getDataBinding();
+    }
 
     public List<Interceptor> getOutFaultInterceptors() {
         return outFault;

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?rev=723338&r1=723337&r2=723338&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Thu Dec  4 06:44:16 2008
@@ -37,6 +37,7 @@
 import org.apache.cxf.binding.soap.SoapBindingConfiguration;
 import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
 import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.databinding.source.SourceDataBinding;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.NullConduitSelector;
@@ -44,6 +45,7 @@
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
@@ -157,7 +159,14 @@
         String expectedEndpointUrl = "http://cxf.apache.org/Greeter";
         ep = (EndpointImpl) bean;
         assertEquals(expectedEndpointUrl, ep.getPublishedEndpointUrl());
-
+        
+        bean = ctx.getBean("epWithDataBinding");
+        assertNotNull(bean);
+        ep = (EndpointImpl) bean;
+        DataBinding dataBinding = ep.getDataBinding();
+        
+        assertTrue(dataBinding instanceof JAXBDataBinding);
+        assertEquals("The namespace map should have an entry", ((JAXBDataBinding)dataBinding).getNamespaceMap().size(),1);
         // test for existence of Endpoint without an id element
         boolean found = false;
         String[] names = ctx.getBeanNamesForType(EndpointImpl.class);

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?rev=723338&r1=723337&r2=723338&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml Thu
Dec  4 06:44:16 2008
@@ -112,9 +112,24 @@
 	</jaxws:outInterceptors>
   </jaxws:endpoint>
 
-  <jaxws:endpoint implementor="org.apache.cxf.jaxws.service.Hello"
-    address="http://localhost:8080/test2"/>
+  <jaxws:endpoint id="epWithDataBinding" implementor="org.apache.cxf.jaxws.service.Hello"
+    address="http://localhost:8080/test2">
+    <jaxws:dataBinding>
+      <bean class="org.apache.cxf.jaxb.JAXBDataBinding">
+        <property name="namespaceMap">
+    		<map>
+   			<entry>
+      			<key><value>http://cxf.apache.org/anonymous_complex_type/</value></key>
+      			<value>BeepBeep</value>
+   			</entry>
+      		</map>
+        </property>
+      </bean>
+      </jaxws:dataBinding>
+  </jaxws:endpoint>
     
+  <jaxws:endpoint implementor="org.apache.cxf.jaxws.service.Hello"
+    address="http://localhost:8080/testx"/>
     
   <jaxws:endpoint id="implementorClass"
     implementor="java.lang.Object"



Mime
View raw message