tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1182279 - /tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java
Date Wed, 12 Oct 2011 09:16:55 GMT
Author: antelder
Date: Wed Oct 12 09:16:54 2011
New Revision: 1182279

URL: http://svn.apache.org/viewvc?rev=1182279&view=rev
Log:
Update with some guards to avoid NPEs

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java?rev=1182279&r1=1182278&r2=1182279&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java
Wed Oct 12 09:16:54 2011
@@ -114,16 +114,19 @@ public class JAXWSBindingInvoker impleme
     protected Dispatch<SOAPMessage> createDispatch(WebServiceBinding wsBinding) {
         URL wsdlLocation = null;
         try {
-            wsdlLocation = new URL(wsBinding.getGeneratedWSDLDocument().getDocumentBaseURI());
+            if (wsBinding.getGeneratedWSDLDocument() != null && wsBinding.getGeneratedWSDLDocument().getDocumentBaseURI()
!= null) {
+                wsdlLocation = new URL(wsBinding.getGeneratedWSDLDocument().getDocumentBaseURI());
+            }
         } catch (Exception e) {
-            try {
-                if (wsBinding.getUserSpecifiedWSDLDefinition().getLocation() != null) {
-                    wsdlLocation = wsBinding.getUserSpecifiedWSDLDefinition().getLocation().toURL();
-                }
-            } catch (MalformedURLException e1) {
-                // TODO Auto-generated catch block
-                e1.printStackTrace();
+            // ignore and try getting the location from the other places 
+        }
+        try {
+            if (wsBinding.getUserSpecifiedWSDLDefinition().getLocation() != null) {
+                wsdlLocation = wsBinding.getUserSpecifiedWSDLDefinition().getLocation().toURL();
             }
+        } catch (MalformedURLException e1) {
+            // TODO Auto-generated catch block
+            e1.printStackTrace();
         }
 
         QName serviceName = null;



Mime
View raw message