cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r948153 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceImplTest.java
Date Tue, 25 May 2010 18:25:08 GMT
Author: dkulp
Date: Tue May 25 18:25:08 2010
New Revision: 948153

URL: http://svn.apache.org/viewvc?rev=948153&view=rev
Log:
Merged revisions 946963 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r946963 | ema | 2010-05-21 06:08:13 -0400 (Fri, 21 May 2010) | 1 line
  
  [CXF-2819]:Modified the bindingID to SOAP12HTTPBinding when the SOAP12Binding transportid
from wsdl is http://schemas.xmlsoap.org/soap/http
........

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=948153&r1=948152&r2=948153&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
Tue May 25 18:25:08 2010
@@ -40,7 +40,6 @@ import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap.SOAPBinding;
 import javax.wsdl.extensions.soap12.SOAP12Address;
 import javax.wsdl.extensions.soap12.SOAP12Binding;
 import javax.xml.bind.JAXBContext;
@@ -52,6 +51,7 @@ import javax.xml.ws.WebServiceException;
 import javax.xml.ws.WebServiceFeature;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.spi.ServiceDelegate;
 
 import org.apache.cxf.Bus;
@@ -169,16 +169,15 @@ public class ServiceImpl extends Service
                 
                 String tpId = null;
                 String address = null;
+                String bindingID = null;
                 List<? extends ExtensibilityElement> extensions 
                     = CastUtils.cast(port.getBinding().getExtensibilityElements());
                 if (!extensions.isEmpty()) {
                     ExtensibilityElement e = extensions.get(0);
                     if (e instanceof SoapBinding) {
-                        tpId = ((SoapBinding)e).getTransportURI();
+                        bindingID = SOAPBinding.SOAP11HTTP_BINDING;
                     } else if (e instanceof SOAP12Binding) {
-                        tpId = ((SOAP12Binding)e).getTransportURI();
-                    } else if (e instanceof SOAPBinding) {
-                        tpId = ((SOAPBinding)e).getTransportURI();
+                        bindingID = SOAPBinding.SOAP12HTTP_BINDING;
                     }
                 }
                 extensions = CastUtils.cast(port.getExtensibilityElements());
@@ -198,7 +197,6 @@ public class ServiceImpl extends Service
                     }
                 }
                 this.ports.add(name);
-                String bindingID = BindingID.getJaxwsBindingID(tpId);
                 addPort(name, bindingID, address);
             }
         } catch (WebServiceException e) {

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=948153&r1=948152&r2=948153&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
Tue May 25 18:25:08 2010
@@ -18,11 +18,13 @@
  */
 package org.apache.cxf.jaxws;
 
+import java.lang.reflect.Field;
 import java.lang.reflect.Proxy;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 import javax.xml.transform.Source;
@@ -45,6 +47,7 @@ import org.apache.cxf.endpoint.NullCondu
 import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.apache.cxf.jaxb.JAXBDataBinding;
+import org.apache.cxf.jaxws.handler.PortInfoImpl;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.SOAPService;
 import org.junit.Test;
@@ -79,7 +82,7 @@ public class ServiceImplTest extends Abs
         assertTrue("unexpected ConduitSelector",
                    client.getConduitSelector() instanceof NullConduitSelector);
     }
-    
+        
     @Test
     public void testNonSpecificGetPort() throws Exception {
         SOAPService service = new SOAPService();
@@ -283,6 +286,24 @@ public class ServiceImplTest extends Abs
         getBus().setExtension(oldConfiguer, Configurer.class);
     }
     
+    
+    
+    @Test
+    @SuppressWarnings("unchecked")
+    // CXF-2819:<protocl-bindings>##SOAP12_Binding <protocl-bindings> in handler
chain is not correctly
+    // matched
+    public void testGetSOAP12BindingIDFromWSDL() throws Exception {
+        QName serviceName = new QName("http://apache.org/hello_world_soap12_http", "SOAPService");
+        URL wsdlURL = getClass().getResource("/wsdl/hello_world_soap12.wsdl");
+        ServiceImpl seviceImpl = new ServiceImpl(this.getBus(), wsdlURL, serviceName,
+                                                 org.apache.hello_world_soap12_http.Greeter.class);
+        Field f = seviceImpl.getClass().getDeclaredField("portInfos");
+        f.setAccessible(true);
+        Map<QName, PortInfoImpl> portInfoMap = (Map<QName, PortInfoImpl>)f.get(seviceImpl);
+        assertEquals(portInfoMap.values().iterator().next().getBindingID(), SOAPBinding.SOAP12HTTP_BINDING);
+    }
+    
+    
     class JAXWSClientFactoryCongfiguer extends ConfigurerImpl {
         @Override
         public synchronized void configureBean(String bn, Object beanInstance, boolean checkWildcards)
{



Mime
View raw message