On Wed, Jul 1, 2009 at 4:57 PM, Mike
Edwards<[email protected]> wrote:
>
> 2) The BPEL process commits a sin by treating what is actually an XML
> element data structure as if it were a String. This results in the returned
> data having a String ("Hello World") in place of what should be an XML data
> structure containing that String.
>
> Basically the input message should be like:
>
> <hello>
> <message>
> Hello
> </message>
> </hello>
>
> However, the BPEL code copies out the message contents into something that
> is declared a string:
>
> <variable name="myVar" messageType="test:HelloMessage"/>
> <variable name="tmpVar" type="xsd:string"/>
>
> ...
>
> <copy>
> <from variable="myVar" part="TestPart"/>
> <to variable="tmpVar"/>
> </copy>
>
> and then concatenates it with another string before putting it back into the
> message variable:
>
> <copy>
> <from>concat($tmpVar,' World')</from>
> <to variable="myVar" part="TestPart"/>
> </copy>
>
> The effect of this is that the <message/> element wrapper for the string
> disappears in the return version of the message. This now causes a failure
> in the data mapping phase of the response handling. How it ever worked
> before I have no idea.
>
> To clean this up, I believe that the BPEL code should change to something
> like this:
>
> <copy>
> <from>$myVar.TestPart/hello/message</from>
> <to variable="tmpVar"/>
> </copy>
>
> <copy>
> <from>concat($tmpVar,' World')</from>
> <to>$myVar.TestPart/hello/message</to>
> </copy>
>
> ... although this will require some namespace stuff too.
>
>
> Or I have I completely misunderstood??
>
> Comments welcome.
>
If i revert implementation-bpel-runtime to back before the Ode upgrade
and run the helloworld sample with printout of the message in the
BPELINvoker just before invoking Ode then i see the XML as:
<hello
xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">
<message xmlns:ns2="http://helloworld/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string">Hello</message>
</hello>
so with the bpel script having:
<variable name="myVar" messageType="test:HelloMessage"/>
<variable name="tmpVar" type="xsd:string"/>
and
<copy>
<from variable="myVar" part="TestPart"/>
<to variable="tmpVar"/>
and the wsdl having:
<element name="hello">
<complexType>
<sequence>
<element name="message" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="HelloMessage">
<wsdl:part element="tns:hello" name="TestPart"/>
</wsdl:message>
then isn't that all correct and "tmpVar" should be a string containing
"Hello"? I'm wondering if there's a tuscany databinding problem
causing what you're seeing.
...ant