cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r542395 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ frontend/simple/src/main/java/org/apache/cxf/frontend/
Date Tue, 29 May 2007 03:10:51 GMT
Author: dkulp
Date: Mon May 28 20:10:51 2007
New Revision: 542395

URL: http://svn.apache.org/viewvc?view=rev&rev=542395
Log:
More SWA updates.

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=542395&r1=542394&r2=542395
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Mon May 28 20:10:51 2007
@@ -375,9 +375,19 @@
                                 addSoapBodyPart(msg, bodyParts, partName);
                             }
                         } else if (SOAPBindingUtil.isSOAPHeader(content)) {
-                            SoapHeader sb = SOAPBindingUtil.getSoapHeader(content);
-                        
-                            bmsg.addExtensor(sb);
+                            SoapHeader header = SOAPBindingUtil.getSoapHeader(content);
+
+                            SoapHeaderInfo headerInfo = new SoapHeaderInfo();
+                            headerInfo.setUse(header.getUse());
+                            MessagePartInfo mpi = 
+                                msg.getMessagePart(new QName(msg.getName().getNamespaceURI(),
header
+                                            .getPart()));
+                            if (mpi != null) {
+                                headerInfo.setPart(mpi);
+                                messageParts.remove(part);
+                                bmsg.getMessageParts().remove(mpi);
+                                bmsg.addExtensor(headerInfo);
+                            }
                         }                  
                     }
                 } else {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java?view=diff&rev=542395&r1=542394&r2=542395
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapTransportFactory.java
Mon May 28 20:10:51 2007
@@ -91,8 +91,10 @@
     }
 
     public void createPortExtensors(EndpointInfo ei, Service service) {
-        SoapBindingInfo bi = (SoapBindingInfo)ei.getBinding();
-        createSoapExtensors(ei, bi, bi.getSoapVersion() instanceof Soap12);
+        if (ei.getBinding() instanceof SoapBindingInfo) {
+            SoapBindingInfo bi = (SoapBindingInfo)ei.getBinding();
+            createSoapExtensors(ei, bi, bi.getSoapVersion() instanceof Soap12);
+        }
     }
 
     private void createSoapExtensors(EndpointInfo ei, SoapBindingInfo bi, boolean isSoap12)
{
@@ -205,7 +207,11 @@
     }
     
     public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, Port port)
{
-        SoapBindingInfo sbi = (SoapBindingInfo)b;
+        String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
+        if (b instanceof SoapBindingInfo) {
+            SoapBindingInfo sbi = (SoapBindingInfo)b;
+            transportURI = sbi.getTransportURI();
+        }
         if (port != null) {
             List ees = port.getExtensibilityElements();
             for (Iterator itr = ees.iterator(); itr.hasNext();) {
@@ -214,14 +220,14 @@
                 if (SOAPBindingUtil.isSOAPAddress(extensor)) {
                     final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
     
-                    EndpointInfo info = new SoapEndpointInfo(serviceInfo, sbi.getTransportURI());
+                    EndpointInfo info = new SoapEndpointInfo(serviceInfo, transportURI);
                     info.addExtensor(sa);
                     info.setAddress(sa.getLocationURI());
                     return info;
                 }
             }
         }
-        return new SoapEndpointInfo(serviceInfo, sbi.getTransportURI());
+        return new SoapEndpointInfo(serviceInfo, transportURI);
     }
 
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?view=diff&rev=542395&r1=542394&r2=542395
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
Mon May 28 20:10:51 2007
@@ -164,6 +164,15 @@
             } else if (o instanceof DataHandler) {
                 dh = (DataHandler) o;
                 ct = dh.getContentType();
+                
+                try {
+                    if ("text/xml".equals(ct)
+                        && dh.getContent() instanceof Source) {
+                        dh = new DataHandler(createDataSource((Source)dh.getContent(), ct));
+                    }
+                } catch (IOException e) {
+                    //ignore, use same dh
+                }
             } else if (dh == null) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("ATTACHMENT_NOT_SUPPORTED",

                                                                        LOG, o.getClass()));

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java?view=diff&rev=542395&r1=542394&r2=542395
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractEndpointFactory.java
Mon May 28 20:10:51 2007
@@ -161,24 +161,16 @@
     }
 
     protected EndpointInfo createEndpointInfo() throws BusException {
-        if (transportId == null) {
-            if (getAddress() != null) {
-                DestinationFactory df = getDestinationFactory();
-                if (df == null) {
-                    DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
-                    df = dfm.getDestinationFactoryForUri(getAddress());
-                }
-                
-                if (df != null) {
-                    transportId = df.getTransportIds().get(0);
-                }
+        if (transportId == null 
+            && getAddress() != null) {
+            DestinationFactory df = getDestinationFactory();
+            if (df == null) {
+                DestinationFactoryManager dfm = getBus().getExtension(DestinationFactoryManager.class);
+                df = dfm.getDestinationFactoryForUri(getAddress());
             }
             
-            if (transportId == null) {
-                // TODO: we shouldn't have to do this, but the DF is null because the
-                // LocalTransport doesn't return for the http:// uris
-                // People also seem to be supplying a null JMS getAddress(), which is worrying
-                transportId = "http://schemas.xmlsoap.org/wsdl/soap/";
+            if (df != null) {
+                transportId = df.getTransportIds().get(0);
             }
         }
         
@@ -192,6 +184,19 @@
             ((SoapBindingInfo) bindingInfo).setTransportURI(transportId);
             transportId = "http://schemas.xmlsoap.org/wsdl/soap/";
         }
+        
+        
+        if (transportId == null) {
+            if (bindingInfo instanceof SoapBindingInfo) {
+                // TODO: we shouldn't have to do this, but the DF is null because the
+                // LocalTransport doesn't return for the http:// uris
+                // People also seem to be supplying a null JMS getAddress(), which is worrying
+                transportId = "http://schemas.xmlsoap.org/wsdl/soap/";                
+            } else {
+                transportId = "http://schemas.xmlsoap.org/wsdl/http/";
+            }
+        }
+        
         service.getServiceInfos().get(0).addBinding(bindingInfo);
 
         setTransportId(transportId);



Mime
View raw message