Author: lresende
Date: Wed May  6 00:42:16 2009
New Revision: 772022

URL: http://svn.apache.org/viewvc?rev=772022&view=rev
Log:
TUSCANY-2968 - Fixing NPE with pure http binding

Modified:
    
tuscany/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java

Modified: 
tuscany/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java?rev=772022&r1=772021&r2=772022&view=diff
==============================================================================
--- 
tuscany/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
 (original)
+++ 
tuscany/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
 Wed May  6 00:42:16 2009
@@ -91,17 +91,23 @@
         
         ProviderFactoryExtensionPoint  providerFactories = 
extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
 
-        // Configure the interceptors for operation selection
-        OperationSelectorProviderFactory osProviderFactory = 
(OperationSelectorProviderFactory) 
providerFactories.getProviderFactory(binding.getOperationSelector().getClass());
-        if (osProviderFactory != null) {
-            this.osProvider = 
osProviderFactory.createServiceOperationSelectorProvider(component, service, 
binding);
+        
+        if (binding.getOperationSelector() != null) {
+            // Configure the interceptors for operation selection
+            OperationSelectorProviderFactory osProviderFactory = 
(OperationSelectorProviderFactory) 
providerFactories.getProviderFactory(binding.getOperationSelector().getClass());
+            if (osProviderFactory != null) {
+                this.osProvider = 
osProviderFactory.createServiceOperationSelectorProvider(component, service, 
binding);
+            }            
         }
-
-        // Configure the interceptors for wire format
-        WireFormatProviderFactory wfProviderFactory = 
(WireFormatProviderFactory) 
providerFactories.getProviderFactory(binding.getRequestWireFormat().getClass());
-        if (wfProviderFactory != null) {
-            this.wfProvider = 
wfProviderFactory.createServiceWireFormatProvider(component, service, binding);
+        
+        if (binding.getRequestWireFormat() != null && 
binding.getResponseWireFormat() != null) {
+            // Configure the interceptors for wire format
+            WireFormatProviderFactory wfProviderFactory = 
(WireFormatProviderFactory) 
providerFactories.getProviderFactory(binding.getRequestWireFormat().getClass());
+            if (wfProviderFactory != null) {
+                this.wfProvider = 
wfProviderFactory.createServiceWireFormatProvider(component, service, binding);
+            }            
         }
+
         
         
         //clone the service contract to avoid databinding issues


Reply via email to