diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-bpel-ode/src')
2 files changed, 21 insertions, 3 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java index 15e9229601..6ce6a727af 100644 --- a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java +++ b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java @@ -30,11 +30,13 @@ import org.apache.ode.bpel.iapi.MessageExchange; import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange; import org.apache.ode.bpel.iapi.Scheduler; import org.apache.ode.utils.DOMUtils; +import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.osoa.sca.ServiceRuntimeException; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -86,8 +88,21 @@ public class ODEExternalService { TuscanyPRC channel = (TuscanyPRC) partnerRoleMessageExchange.getChannel(); RuntimeComponent tuscanyRuntimeComponent = _server.getTuscanyRuntimeComponent(channel.getProcessName()); - RuntimeComponentReference runtimeComponentReference = - (RuntimeComponentReference)tuscanyRuntimeComponent.getReferences().get(0); + // get the right reference based on the partner link name + String referenceName = channel.getEndpoint().serviceName.getLocalPart(); + RuntimeComponentReference runtimeComponentReference = null; + + for (ComponentReference reference : tuscanyRuntimeComponent.getReferences()){ + if (reference.getName().equals(referenceName)){ + runtimeComponentReference = (RuntimeComponentReference)reference; + break; + } + } + + if (runtimeComponentReference == null){ + throw new ServiceRuntimeException("Can't find component reference for partner link " + referenceName); + } + RuntimeWire runtimeWire = runtimeComponentReference.getRuntimeWire(runtimeComponentReference.getBindings().get(0)); @@ -95,7 +110,6 @@ public class ODEExternalService { Operation operation = findOperation(partnerRoleMessageExchange.getOperation().getName(), runtimeComponentReference); - /* This is how a request looks like (payload is wrapped with extra info) <?xml version="1.0" encoding="UTF-8"?> diff --git a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java index 8f8f608217..c2c16a24ca 100644 --- a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java +++ b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java @@ -50,6 +50,10 @@ public class TuscanyPRC implements PartnerRoleChannel { public QName getProcessName() { return this.processName; } + + public Endpoint getEndpoint() { + return endpoint; + } public void close() { |