You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Anuj Bhatia <an...@adobe.com> on 2011/06/10 09:02:30 UTC
Problem mapping BPEL response to Java Variable
Hello,
I'm trying to use a Tuscany component implemented in BPEL but facing a problem when trying to map the response value from the BPEL process to the corresponding Java type. I'm using Tuscany Java 1.6.1, JDK 1.6.0_13 and Maven 2.2.1
I've modified the "helloworld-bpel" sample that's included with Tuscany Java 1.6.1 to demonstrate the problem. The modified version of the sample is attached. The problem is the response returned from the BPEL process is not mapped correctly to the Java String variable. To the calling Java code the String value returned is blank even though the XML printed in the logs contains the correct data.
The only significant difference from the sample code is that the BPEL process echoes back the incoming SOAP request as the response, instead of concatenating a string to the request and then returning that concatenated text as the response. It looks like somehow the concatenation operation in the BPEL process is changing the structure of the returned SOAP message and that allows the sample code to work.
After a little debugging I found that replacing the following code in org.apache.tuscany.sca.implementation.bpel.ode.provider.BPELInvoker
private Element processResponse(Element response) {
return (Element) DOMUtils.findChildByName(response, new QName("",bpelOperationOutputPart.getName()));
}
with
private Element processResponse(Element response) {
return (Element) DOMUtils.findChildByName(response, new QName("",bpelOperationOutputPart.getName())).getFirstChild();
}
will make the attached code work, but this change will break the Tuscany sample.
Does anybody have any insight into how this is supposed to work?
Thanks
Anuj