You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by jb...@apache.org on 2009/10/14 15:00:31 UTC

svn commit: r825121 - /servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java

Author: jbonofre
Date: Wed Oct 14 13:00:31 2009
New Revision: 825121

URL: http://svn.apache.org/viewvc?rev=825121&view=rev
Log:
Add a test to check if the target endpoint descriptor is not null.

Modified:
    servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java

Modified: servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java?rev=825121&r1=825120&r2=825121&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java (original)
+++ servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java Wed Oct 14 13:00:31 2009
@@ -210,12 +210,14 @@
     	}
     	// get the target endpoint descriptor
     	Document targetEndpointDescriptor = componentContext.getEndpointDescriptor(targetEndpoint);
-        // TODO: check for null
+        if (targetEndpointDescriptor == null) {
+            throw new JBIException("The target endpoint descriptor is null.");
+        }
     	// get the target endpoint definition (based on the descriptor)
     	Definition targetEndpointDefinition = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader().readWSDL(null, targetEndpointDescriptor);
     	// check if the WSDL is the target component as a WSDL definition
     	if (targetEndpointDefinition == null) {
-    		throw new JBIException("The target component has no WSDL definition.");
+    		throw new JBIException("The target endpoint has no WSDL definition.");
     	}
     	// get the targetService in the endpoint definition
     	Service targetServiceInDefinition = targetEndpointDefinition.getService(this.getTargetService());