I have created the following BPEL script.
<?xml version="1.0" encoding="utf-8" ?>
<process name="ProcessInvoice"
targetNamespace="http://invoiceregistry.me.cz/"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:invrwsdl="http://invoiceregistry.me.cz/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
<import
location="InvoiceRegistryWS.wsdl"
namespace="http://invoiceregistry.me.cz/"
importType="http://schemas.xmlsoap.org/wsdl/" />
<partnerLinks>
<partnerLink
name="InvoiceRegistryPartnerLink"
partnerLinkType="invrwsdl:InvoiceRegistryPartnerLinkType"
partnerRole="InvoiceRegistryServiceRole" />
</partnerLinks>
<variables>
<variable name="newInvoice" messageType="invrwsdl:insertNewInvoice" />
<variable name="response" messageType="invrwsdl:insertNewInvoiceResponse" />
</variables>
<sequence>
<assign name="PrepareInsertNewInvoiceRequest">
<copy>
<from>
<literal>
<invoice>
<buyerId>entity-02</buyerId>
<sellerId>entity-03</sellerId>
<price>
<currency>CZK</currency>
<value>1000000</value>
</price>
</invoice>
</literal>
</from>
<to variable="newInvoice" part="parameters" />
</copy>
</assign>
<invoke
name="InsertNewInvoice"
partnerLink="InvoiceRegistryPartnerLink"
operation="insertNewInvoice"
inputVariable="newInvoice"
outputVariable="response" />
</sequence>
</process>
I have finally managed to successfully deploy in into my local Apache ODE (running on Tomcat) installation.
Now I'm wondering how to make the process start. The following URL address:
http://localhost:8080/ode/processes/ProcessInvoice?wsdl
returns the following error message:
Requested resource not found!
Where do I find the WSDL file? Is there s way to start the process other than to manually send a SOAP message to it?
Is there s way to start the process other than to manually send a SOAP message to it?
No, there is not. Every process needs a starting activity. I wonder why ODE deploy's your process in the first place, but it is propably the reason, why there is no WSDL. To quote the BPEL spec., section 5.5:
The creation of a process instance in WS-BPEL is always implicit; activities that receive messages (that is,
<receive>
activities and<pick>
activities) can be annotated to indicate that the occurrence of that activity causes a new instance of the business process to be created. This is done by setting thecreateInstance
attribute of such an activity to "yes".... A start activity is a<receive>
or a<pick>
activity annotated with acreateInstance="yes"
attribute. [SA00015] Each executable business process MUST contain at least one start activity...
So, you should include for example a receive
activity right before your assign
. To make this work, you also need an inbound (myRole
) partnerLink
. This is the interface your process is implementing. It should look somehow like this:
<partnerLinks>
<partnerLink
name="InvoiceRegistryPartnerLink" ... />
<partnerLink
name="MyRolePartnerLink"
partnerLinkType="invrwsdl:MyRolePartnerLinkType"
myRole="BPELServiceRole" />
</partnerLinks>
...
<receive partnerLink="MyRolePartnerLink" portType="MyPortType" operation="SomeStartingOperation" createInstance="yes" />
...
If you already have a WSDL your process is implementing, then just subsitute portType
and operation
names, etc. You perhaps also need to define a partnerLink
, if you haven't already done that.