Author: boisvert Date: Tue Jan 16 12:15:43 2007 New Revision: 496846 URL: http://svn.apache.org/viewvc?view=rev&rev=496846 Log: Better error reporting if missing service
Modified: incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java Modified: incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java?view=diff&rev=496846&r1=496845&r2=496846 ============================================================================== --- incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java (original) +++ incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java Tue Jan 16 12:15:43 2007 @@ -30,6 +30,7 @@ import javax.wsdl.Operation; import javax.wsdl.Part; import javax.wsdl.Port; +import javax.wsdl.Service; import javax.wsdl.extensions.soap.SOAPAddress; import javax.xml.namespace.QName; import java.util.Collection; @@ -91,7 +92,11 @@ private static String extractServiceName(Definition wsdlDefinition, QName wsdlServiceName, String portName) throws AxisFault { String url = null; - Port port = wsdlDefinition.getService(wsdlServiceName).getPort(portName); + Service service = wsdlDefinition.getService(wsdlServiceName); + if (service == null) { + throw new AxisFault("Unable to find service " + wsdlServiceName + " from service WSDL definition " + wsdlDefinition.getDocumentBaseURI()); + } + Port port = service.getPort(portName); for (Object oext : port.getExtensibilityElements()) { if (oext instanceof SOAPAddress) url = ((SOAPAddress)oext).getLocationURI();