From c556bbc37d8704b2e2b3dc3cd44835ad88a145bf Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 6 May 2009 00:42:16 +0000 Subject: TUSCANY-2968 - Fixing NPE with pure http binding git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@772022 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/provider/HTTPServiceBindingProvider.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'branches/sca-java-1.x/modules') diff --git a/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java b/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java index 9d474e6d71..3a3428268c 100644 --- a/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java +++ b/branches/sca-java-1.x/modules/binding-http-new-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java @@ -91,17 +91,23 @@ public class HTTPServiceBindingProvider implements ServiceBindingProviderRRB { 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 -- cgit v1.2.3