Show Table of Contents
2.5. Consuming a Service from a BPEL Process
To enable a BPEL process to invoke other services, you need to define the WSDL interface representing the service to be consumed, using an invoke element within the deployment descriptor. For example, in the
deploy.xml file:
<process name="ls:loanApprovalProcess">
<active>true</active>
<process-events generate="all"/>
<provide partnerLink="customer">
<service name="ls:loanService" port="loanService_Port"/>
</provide>
<invoke partnerLink="assessor" usePeer2Peer="false">
<service name="ra:riskAssessor" port="riskAssessor_Port"/>
</invoke>
</process>
Here, the
usePeer2Peer property informs the BPEL engine not to use internal communications for sending messages between BPEL processes that may be executing within the same engine, and instead pass messages through the SwitchYard infrastructure.
For each consumed service, you can then create a reference element within the SwitchYard configuration to locate the WSDL file and identify the port type associated with the required WSDL service or port, as shown in the
switchyard.xml file below:
<sca:component name="loanService">
<bpel:implementation.bpel process="ls:loanApprovalProcess" />
<sca:service name="loanService">
<sca:interface.wsdl interface="loanServicePT.wsdl#wsdl.porttype(loanServicePT)"/>
</sca:service>
<sca:reference name="riskAssessor">
<sca:interface.wsdl interface="riskAssessmentPT.wsdl#wsdl.porttype(riskAssessmentPT)"/>
</sca:reference>
</sca:component>

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.