Possibly silly question about variable initialization. When you want to
populate a variable with data do you first need to initialize the variable
with an empty/skeleton xml structure? An example of what I mean is below.
If I don't assign a skeleton xml structure to the "output" variable using an
additional "copy"/" from literal" activity, I get the following from Ode
upon execution:
Error:
ERROR [ASSIGN]: Assignment Fault: {
http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=19
org.apache.axis2.AxisFault: {
http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure No
results for expression: {OXPath10Expression /tns:result}
The error makes sense since it's trying to execute an XPath against a
document that doesn't exist. However I was thinking the BPEL engine would
automatically create the blank xml output document for me. Seems like this
isn't the case.
Sorry, I realize this isn't Ode specific. On an additional note, can
anyone suggest a good online forum for questions regarding the WSBPEL 2.0spec?
BPEL:
<?xml version="1.0" encoding="UTF-8"?>
<bpws:process exitOnStandardFault="yes" name="echo"
suppressJoinFailure="yes"
targetNamespace="urn:xmlns:test:composite-services"
xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="urn:xmlns:test:composite-services">
<bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="echo.wsdl" namespace="urn:xmlns:test:composite-services"/>
<bpws:partnerLinks>
<bpws:partnerLink myRole="echoProvider" name="client"
partnerLinkType="tns:echo"/>
</bpws:partnerLinks>
<bpws:variables>
<bpws:variable messageType="tns:echoRequestMessage" name="input"/>
<bpws:variable messageType="tns:echoResponseMessage" name="output"/>
</bpws:variables>
<bpws:sequence name="main">
<bpws:receive createInstance="yes" name="receiveInput"
operation="process" partnerLink="client" portType="tns:echo"
variable="input"/>
<bpws:assign name="Assign" validate="no">
<bpws:copy>
<bpws:from><![CDATA["asdf"]]></bpws:from>
<bpws:to part="payload" variable="output">
<bpws:query ><![CDATA[/tns:result]]></bpws:query>
</bpws:to>
</bpws:copy>
</bpws:assign>
<bpws:reply name="replyOutput" operation="process"
partnerLink="client" portType="tns:echo" variable="output"/>
</bpws:sequence>
</bpws:process>
Section from WSDL:
<types>
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="urn:xmlns:test:composite-services"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="echoRequest">
<complexType>
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
</element>
<element name="echoResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="echoRequestMessage">
<part name="payload" element="tns:echoRequest"/>
</message>
<message name="echoResponseMessage">
<part name="payload" element="tns:echoResponse"/>
</message>