Author: boisvert Date: Fri Apr 20 08:23:22 2007 New Revision: 530833 URL: http://svn.apache.org/viewvc?view=rev&rev=530833 Log: Better exception reporting if WSDL definition is missing
Modified: incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java Modified: incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java?view=diff&rev=530833&r1=530832&r2=530833 ============================================================================== --- incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java (original) +++ incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java Fri Apr 20 08:23:22 2007 @@ -20,12 +20,18 @@ package org.apache.ode.axis2; -import org.apache.axis2.AxisFault; -import org.apache.ode.bpel.iapi.*; - +import javax.wsdl.Definition; import javax.wsdl.PortType; import javax.xml.namespace.QName; +import org.apache.axis2.AxisFault; +import org.apache.ode.bpel.iapi.BindingContext; +import org.apache.ode.bpel.iapi.ContextException; +import org.apache.ode.bpel.iapi.Endpoint; +import org.apache.ode.bpel.iapi.EndpointReference; +import org.apache.ode.bpel.iapi.PartnerRoleChannel; +import org.apache.ode.bpel.iapi.ProcessStore; + /** * AXIS2 implementation of the [EMAIL PROTECTED] org.apache.ode.bpel.iapi.BindingContext} * interface. Deals with the activation of endpoints. @@ -44,8 +50,11 @@ public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint) { try { - ODEService svc = _server.createService(_store.getProcessConfiguration(processId).getDefinitionForService(myRoleEndpoint.serviceName) - , myRoleEndpoint.serviceName, myRoleEndpoint.portName); + Definition wsdl = _store.getProcessConfiguration(processId).getDefinitionForService(myRoleEndpoint.serviceName); + if (wsdl == null) + throw new ContextException("Unable to access WSDL definition to activate MyRole endpoint for service " + myRoleEndpoint.serviceName + + " and port " + myRoleEndpoint.portName); + ODEService svc = _server.createService(wsdl, myRoleEndpoint.serviceName, myRoleEndpoint.portName); return svc.getMyServiceRef(); } catch (AxisFault axisFault) { throw new ContextException("Could not activate endpoint for service " + myRoleEndpoint.serviceName