You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/01/24 01:51:44 UTC

svn commit: r1235092 - /cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java

Author: dkulp
Date: Tue Jan 24 00:51:43 2012
New Revision: 1235092

URL: http://svn.apache.org/viewvc?rev=1235092&view=rev
Log:
Fix issue with JAX-RS tests after package moves

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java?rev=1235092&r1=1235091&r2=1235092&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java Tue Jan 24 00:51:43 2012
@@ -162,25 +162,28 @@ public class ChainInitiationObserver imp
 
             EndpointInfo endpointInfo = endpoint.getEndpointInfo();
 
-            QName serviceQName = endpointInfo.getService().getName();
-            exchange.put(Message.WSDL_SERVICE, serviceQName);
+            if (endpointInfo.getService() != null)  {
+                QName serviceQName = endpointInfo.getService().getName();
+                exchange.put(Message.WSDL_SERVICE, serviceQName);
 
-            QName interfaceQName = endpointInfo.getService().getInterface().getName();
-            exchange.put(Message.WSDL_INTERFACE, interfaceQName);
+                QName interfaceQName = endpointInfo.getService().getInterface().getName();
+                exchange.put(Message.WSDL_INTERFACE, interfaceQName);
 
-            QName portQName = endpointInfo.getName();
-            exchange.put(Message.WSDL_PORT, portQName);
-            URI wsdlDescription = endpointInfo.getProperty("URI", URI.class);
-            if (wsdlDescription == null) {
-                String address = endpointInfo.getAddress();
-                try {
-                    wsdlDescription = new URI(address + "?wsdl");
-                } catch (URISyntaxException e) {
-                    // do nothing
+
+                QName portQName = endpointInfo.getName();
+                exchange.put(Message.WSDL_PORT, portQName);
+                URI wsdlDescription = endpointInfo.getProperty("URI", URI.class);
+                if (wsdlDescription == null && !endpointInfo.hasProperty("URI")) {
+                    String address = endpointInfo.getAddress();
+                    try {
+                        wsdlDescription = new URI(address + "?wsdl");
+                    } catch (URISyntaxException e) {
+                        // do nothing
+                    }
+                    endpointInfo.setProperty("URI", wsdlDescription);
                 }
-                endpointInfo.setProperty("URI", wsdlDescription);
+                exchange.put(Message.WSDL_DESCRIPTION, wsdlDescription);
             }
-            exchange.put(Message.WSDL_DESCRIPTION, wsdlDescription);
         }  
     }