Thanks a lot, it works now.
2009/3/12 Karthick Sankarachary <[email protected]>: > Hi Rafal, > > Your scenario involves an <assign> activity that contains a variable variant > of the from-spec, where the variable is defined using XML Schema types > (simple or complex) or element, in which case the part attribute is and must > not be set. Apparently, the BPEL compiler did not handle this particular use > case as it ought to have, but that has been resolved now (see revision > 753011). > > On top of that, there were a number of problems in the process itself that > you still need to correct, as described below: > a) The from-specs of the two <assign> activities should create the wrapper > <test:content> element so as to match the to-spec type, like so: > > <from > expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0"> > <![CDATA[ > for $loopOnce in (1) > return > <test:content> > <test:test1> > <test8:test9>abc</test8:test9> > </test:test1> > </test:content> > ]]> > </from> > > b) The path used to select the text node value "abc" must end with a text() > step, like so: > > <copy> > <bpws:from variable="tempVar1"> > <bpws:query > queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xquery1.0"> > <![CDATA[ > for $loopOnce in (1) > return > <test:content> > <test:test1> > > <test:test2>{//test:test1/test8:test9/text()}</test:test2> > </test:test1> > </test:content> > ]]> > </bpws:query> > </bpws:from> > <to variable="myVar" part="TestPart"/> > </copy> > > c) The type of the <test:content> is defined to an xsd:string, when truly it > should be an xsd:anyType (because you are trying to insert children inside > of it), like so: > > <xsd:complexType name="ContentCT"> > <xsd:sequence> > <xsd:element name="content" type="xsd:anyType"/> > </xsd:sequence> > </xsd:complexType> > > After all that, the following input message... > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:unit="http://ode/bpel/unit-test.wsdl"> > <soapenv:Header/> > <soapenv:Body> > <unit:HelloXQuery> > <TestPart> > <unit:content>asdgasdg</unit:content> > </TestPart> > </unit:HelloXQuery> > </soapenv:Body> > </soapenv:Envelope> > > ... results in the desired output message ... > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > <soapenv:Body> > <odens:HelloXQueryResponse > xmlns:odens="http://ode/bpel/unit-test.wsdl"> > <TestPart xmlns:unit="http://ode/bpel/unit-test.wsdl"> > <test:test1 xmlns:test="http://ode/bpel/unit-test.wsdl"> > <test:test2>abc</test:test2> > </test:test1> > </TestPart> > </odens:HelloXQueryResponse> > </soapenv:Body> > </soapenv:Envelope> > > Regards, > Karthick > > On 3/12/09, Rafal Rusin <[email protected]> wrote: >> >> Hello, >> I tried following xquery: >> >> for $loopOnce in (1) >> return >> <test:test1> >> >> <test:test2>{//test:test1/test8:test9}</test:test2> >> </test:test1> >> And I got in Servicemix 3.3: >> >> <test:test1> >> <test8:test9 >> xmlns:test8="http://ode/bpel/unit-test8.wsdl">abc</test8:test9> >> </test:test1> >> >> But it supposed to be >> <test:test1> >> <test:test2>abc</test:test2> >> </test:test1> >> >> I'm attaching SA + soapui project for reproduction. >> Is this internal xquery assign implemented somewhere in ODE? >> >> Regards, >> >> -- >> Rafał Rusin >> www.touk.pl >> www.mimuw.edu.pl/~rrusin > -- Rafał Rusin http://www.touk.pl http://www.mimuw.edu.pl/~rrusin
