You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by FredN <fr...@corp.earthlink.com> on 2011/06/29 19:00:54 UTC
bpel indexing issue
My bpel script makes a web service call and get the following packet back
<?xml version="1.0" encoding="UTF-8"?>
<message>
<parameters>
<ns2:getResponse xmlns:ns2="xxx" xmlns:ns3="yyy" xmlns:ns4="zzz" >
<return>
<ns3:New>
<ns3:DName>
<ns3:Name>SAM</ns3:Name>
</ns3D:Name>
<ns3:Info>
<ns3:Package>package1</ns3:Package>
</ns3:Info>
<ns3:ServItemID>10359283</ns3:ServItemID>
<ns3:OrderType>New</ns3:OrderType>
</ns3:New>
<ns3:New>
<ns3:DName>
<ns3:Name>BILL</ns3:Name>
</ns3:DName>
<ns3:Info>
<ns3:Package>package2</ns3:Package>
</ns3:Info>
<ns3:ServItemID>10359285</ns3:ServItemID>
<ns3:OrderType>New</ns3:OrderType>
</ns3:New>
</return>
</ns2:getResponse>
</parameters>
</message>
I want to be able to iterate through the New's
I use a ForEach, and that seems to iterate through OK.
But when I try to get the data out is when I have trouble.
If my bpel says:
<copy>
<from>$GetNewOut.parameters/return/ns1:New[1]/ns1:Name/ns1:Name
</from>
<to ... </to>
</copy>
I get the FIRST element out.
If my bpel says:
<copy>
<from>$GetNewOut.parameters/return/ns1:New[2]/ns1:Name/ns1:Name
</from>
<to ... </to>
</copy>
I still get the FIRST element out.
If I set the index to 0 or 3, I get an error saying: "did not select any
nodes."
If I use the counter for the ForEach like this:
<copy>
<from>$GetNewOut.parameters/return/ns1:New[$counter]/ns1:Name/ns1:Name
</from>
<to ... </to>
</copy>
or just a variable I created and initialized to 1 like this:
<copy>
<from>$GetNewOut.parameters/return/ns1:New[$var1]/ns1:Name/ns1:Name
</from>
<to ... </to>
</copy>
I get an error saying: "returned multiple nodes"
Any suggestions of how to fix this?
Thanks,
Fred
--
View this message in context: http://servicemix.396122.n5.nabble.com/bpel-indexing-issue-tp4535765p4535765.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: bpel indexing issue
Posted by Gert Vanthienen <ge...@gmail.com>.
Fred,
Unfortunately, I'm not that familiar with BPEL to be able to help you
out here. You might get lucky with someone else in this community,
but for this kind of question I think you have a much better chance of
getting an answer at the ODE user list (cfr.
http://ode.apache.org/mailing-lists.html)
Regards,
Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/
On Wed, Jun 29, 2011 at 7:00 PM, FredN <fr...@corp.earthlink.com> wrote:
>
> My bpel script makes a web service call and get the following packet back
>
> <?xml version="1.0" encoding="UTF-8"?>
> <message>
> <parameters>
> <ns2:getResponse xmlns:ns2="xxx" xmlns:ns3="yyy" xmlns:ns4="zzz" >
> <return>
> <ns3:New>
> <ns3:DName>
> <ns3:Name>SAM</ns3:Name>
> </ns3D:Name>
> <ns3:Info>
> <ns3:Package>package1</ns3:Package>
> </ns3:Info>
> <ns3:ServItemID>10359283</ns3:ServItemID>
> <ns3:OrderType>New</ns3:OrderType>
> </ns3:New>
> <ns3:New>
> <ns3:DName>
> <ns3:Name>BILL</ns3:Name>
> </ns3:DName>
> <ns3:Info>
> <ns3:Package>package2</ns3:Package>
> </ns3:Info>
> <ns3:ServItemID>10359285</ns3:ServItemID>
> <ns3:OrderType>New</ns3:OrderType>
> </ns3:New>
> </return>
> </ns2:getResponse>
> </parameters>
> </message>
>
>
> I want to be able to iterate through the New's
>
> I use a ForEach, and that seems to iterate through OK.
>
> But when I try to get the data out is when I have trouble.
>
> If my bpel says:
>
> <copy>
> <from>$GetNewOut.parameters/return/ns1:New[1]/ns1:Name/ns1:Name
> </from>
> <to ... </to>
> </copy>
>
> I get the FIRST element out.
>
> If my bpel says:
>
> <copy>
> <from>$GetNewOut.parameters/return/ns1:New[2]/ns1:Name/ns1:Name
> </from>
> <to ... </to>
> </copy>
>
> I still get the FIRST element out.
>
> If I set the index to 0 or 3, I get an error saying: "did not select any
> nodes."
>
> If I use the counter for the ForEach like this:
>
> <copy>
> <from>$GetNewOut.parameters/return/ns1:New[$counter]/ns1:Name/ns1:Name
> </from>
> <to ... </to>
> </copy>
>
> or just a variable I created and initialized to 1 like this:
>
> <copy>
> <from>$GetNewOut.parameters/return/ns1:New[$var1]/ns1:Name/ns1:Name
> </from>
> <to ... </to>
> </copy>
>
> I get an error saying: "returned multiple nodes"
>
>
> Any suggestions of how to fix this?
>
> Thanks,
> Fred
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/bpel-indexing-issue-tp4535765p4535765.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>