From 6b2492ecc25117702608cedf876ae48efb824e0e Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 12 Oct 2011 09:16:54 +0000 Subject: Update with some guards to avoid NPEs git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1182279 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/ws/jaxws/JAXWSBindingInvoker.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src') diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java index 6266920a27..0f37b1adb0 100644 --- a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java @@ -114,16 +114,19 @@ public class JAXWSBindingInvoker implements Invoker, DataExchangeSemantics { protected Dispatch 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; -- cgit v1.2.3