Hello again. I have a question about using the inline from-spec for
variable initialization
(http://cwiki.apache.org/confluence/display/ODExSITE/WS-BPEL+2.0+Specifi
cation+Compliance#WS-BPEL2.0SpecificationCompliance-Initialization).
It's not working for me and I was hoping someone could tell me if I'm
doing something wrong. Here is a very simple example in which I try to
assign data to and from a variable that has an inline initializer. I
get a selectionFailure at runtime.
--------------- Begin TestInlineInitialization.wsdl ---------------
<?xml version="1.0"?>
<definitions name="TestInlineInitialization"
targetNamespace="mynamespace"
xmlns:tns="mynamespace"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
>
<types>
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="mynamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Input" type="string" />
<element name="Output" type="string" />
<complexType name="StructureType">
<sequence>
<element name="Element1" type="string"></element>
<element name="Element2" type="string"></element>
<element name="Element3" type="string"></element>
</sequence>
</complexType>
<element name="Structure" type="tns:StructureType"></element>
</schema>
</types>
<message name="InputMessage">
<part name="payload" element="tns:Input"/>
</message>
<message name="OutputMessage">
<part name="payload" element="tns:Output"/>
</message>
<portType name="ServicePortType">
<operation name="process">
<input message="tns:InputMessage" />
<output message="tns:OutputMessage"/>
</operation>
</portType>
<plnk:partnerLinkType name="ServicePartnerLinkType">
<plnk:role name="ServiceProvider" portType="tns:ServicePortType"/>
</plnk:partnerLinkType>
<binding name="ServiceBinding" type="tns:ServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="process">
<soap:operation soapAction="mynamespace/process" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="TestInlineInitializationService">
<port name="TestInlineInitializationPort"
binding="tns:ServiceBinding">
<soap:address
location="http://[server]:[port]/processes/TestInlineInitialization" />
</port>
</service>
</definitions>
--------------- End TestInlineInitialization.wsdl ---------------
--------------- Begin TestInlineInitialization.bpel ---------------
<?xml version="1.0" encoding="UTF-8"?>
<bpel:process exitOnStandardFault="yes"
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
name="TestInlineInitialization"
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
suppressJoinFailure="yes" targetNamespace="mynamespace"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ode="http://www.apache.org/ode/type/extension"
xmlns:tns="mynamespace" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<bpel:import importType="http://schemas.xmlsoap.org/wsdl/"
location="TestInlineInitialization.wsdl"
namespace="mynamespace"/>
<bpel:partnerLinks>
<bpel:partnerLink myRole="ServiceProvider" name="client"
partnerLinkType="tns:ServicePartnerLinkType"/>
</bpel:partnerLinks>
<bpel:variables>
<bpel:variable messageType="tns:InputMessage" name="input"/>
<bpel:variable messageType="tns:OutputMessage" name="output"/>
<bpel:variable element="tns:Structure" name="StructureVariable">
<bpel:from>
<bpel:literal>
<tns:Structure xmlns:tns="mynamespace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="mynamespace
TestInlineInitialization.wsdl ">
<tns:Element1 />
<tns:Element2 />
<tns:Element3 />
</tns:Structure>
</bpel:literal>
</bpel:from>
</bpel:variable>
</bpel:variables>
<bpel:sequence name="process">
<bpel:receive createInstance="yes" name="ReceiveInput"
operation="process" partnerLink="client"
portType="tns:ServicePortType" variable="input"/>
<bpel:assign name="AssignInputToStructure" validate="no">
<bpel:copy>
<bpel:from part="payload" variable="input"/>
<bpel:to variable="StructureVariable">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[
tns:Element2]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:assign name="AssignFromStructureToOutput" validate="no">
<bpel:copy>
<bpel:from variable="StructureVariable">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[
tns:Element2]]></bpel:query>
</bpel:from>
<bpel:to part="payload" variable="output"/>
</bpel:copy>
</bpel:assign>
<bpel:reply name="ReplyWithOutput" operation="process"
partnerLink="client" portType="tns:ServicePortType"
variable="output"/>
</bpel:sequence>
</bpel:process>
--------------- End TestInlineInitialization.bpel ---------------
This is the selectionFailure I get:
Assignment Fault:
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailu
re,lineNo=38,faultExplanation=No results for expression:
{OXPath10Expression tns:Element2}
Thank you.
-Jon