cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r564584 - in /incubator/cxf/trunk/rt/ws/rm/src: main/java/org/apache/cxf/ws/rm/RMEndpoint.java test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
Date Fri, 10 Aug 2007 13:37:33 GMT
Author: andreasmyth
Date: Fri Aug 10 06:37:30 2007
New Revision: 564584

URL: http://svn.apache.org/viewvc?view=rev&rev=564584
Log:
Workaround for problem that soap version cannot be determined for some of the registered soap
bindingsIds, which causes the building of the service model for an RM endpoint to fail. 

Modified:
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?view=diff&rev=564584&r1=564583&r2=564584
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Fri Aug
10 06:37:30 2007
@@ -28,6 +28,7 @@
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.common.logging.LogUtils;
@@ -404,9 +405,14 @@
 
     void buildBindingInfo(ServiceInfo si) {
         // use same binding id as for application endpoint
+        // also, to workaround the problem that it may not be possible to determine
+        // the soap version depending on the bindingId, speciffy the soap version
+        // explicitly
         if (null != applicationEndpoint) {
-            String bindingId = applicationEndpoint.getEndpointInfo().getBinding().getBindingId();
-            SoapBindingInfo bi = new SoapBindingInfo(si, bindingId);
+            SoapBindingInfo sbi = (SoapBindingInfo)applicationEndpoint.getEndpointInfo().getBinding();
+            SoapVersion sv = sbi.getSoapVersion();
+            String bindingId = sbi.getBindingId();
+            SoapBindingInfo bi = new SoapBindingInfo(si, bindingId, sv);
             bi.setName(BINDING_NAME);
             BindingOperationInfo boi = null;
             SoapOperationInfo soi = null;

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?view=diff&rev=564584&r1=564583&r2=564584
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Fri
Aug 10 06:37:30 2007
@@ -29,6 +29,9 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.SoapVersion;
+import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.service.Service;
@@ -171,8 +174,10 @@
         EasyMock.expect(ae.getService()).andReturn(as);
         EndpointInfo aei = control.createMock(EndpointInfo.class);
         EasyMock.expect(ae.getEndpointInfo()).andReturn(aei).times(2);
-        BindingInfo bi = control.createMock(BindingInfo.class);
-        EasyMock.expect(aei.getBinding()).andReturn(bi);
+        SoapBindingInfo bi = control.createMock(SoapBindingInfo.class);
+        EasyMock.expect(aei.getBinding()).andReturn(bi); 
+        SoapVersion sv = Soap11.getInstance();
+        EasyMock.expect(bi.getSoapVersion()).andReturn(sv);
         String ns = "http://schemas.xmlsoap.org/wsdl/soap/";
         EasyMock.expect(bi.getBindingId()).andReturn(ns);
         EasyMock.expect(aei.getTransportId()).andReturn(ns);



Mime
View raw message