Author: dkulp
Date: Wed Feb 11 19:29:19 2009
New Revision: 743459

URL: http://svn.apache.org/viewvc?rev=743459&view=rev
Log:
Fix creation of clients if DestFactory not found.  ConduitInitiator should be 
usable as well.

Modified:
    
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java

Modified: 
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java?rev=743459&r1=743458&r2=743459&view=diff
==============================================================================
--- 
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
 (original)
+++ 
cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
 Wed Feb 11 19:29:19 2009
@@ -279,15 +279,30 @@
 
         setTransportId(transportId);
         
+        WSDLEndpointFactory wsdlEndpointFactory = null;
         if (destinationFactory == null) {
-            DestinationFactoryManager dfm = 
getBus().getExtension(DestinationFactoryManager.class);
-            destinationFactory = dfm.getDestinationFactory(transportId);
+            try {
+                destinationFactory = 
getBus().getExtension(DestinationFactoryManager.class)
+                    .getDestinationFactory(transportId);
+            } catch (Throwable t) {
+                try {
+                    Object o = 
getBus().getExtension(ConduitInitiatorManager.class)
+                        .getConduitInitiator(transportId);
+                    if (o instanceof WSDLEndpointFactory) {
+                        wsdlEndpointFactory = (WSDLEndpointFactory)o;
+                    }
+                } catch (Throwable th) {
+                    //ignore
+                }
+            }
+        } 
+        if (destinationFactory instanceof WSDLEndpointFactory) {
+            wsdlEndpointFactory = (WSDLEndpointFactory)destinationFactory;
         }
         
         EndpointInfo ei;
-        if (destinationFactory instanceof WSDLEndpointFactory) {
-            ei = ((WSDLEndpointFactory)destinationFactory)
-                .createEndpointInfo(service.getServiceInfos().get(0), 
bindingInfo, null);
+        if (wsdlEndpointFactory != null) {
+            ei = 
wsdlEndpointFactory.createEndpointInfo(service.getServiceInfos().get(0), 
bindingInfo, null);
             ei.setTransportId(transportId);
         } else {
             ei = new EndpointInfo(service.getServiceInfos().get(0), 
transportId);
@@ -306,12 +321,8 @@
             ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
         }
 
-        if (destinationFactory instanceof WSDLEndpointFactory) {
-            WSDLEndpointFactory we = (WSDLEndpointFactory) destinationFactory;
-            
-            we.createPortExtensors(ei, service);
-        } else {
-            // ?
+        if (wsdlEndpointFactory != null) {
+            wsdlEndpointFactory.createPortExtensors(ei, service);
         }
         service.getServiceInfos().get(0).addEndpoint(ei);
         return ei;


Reply via email to