SOAP FAQ
Test
Test
Here is an interesting solution for passing content of BPEL variables into XSL Transformations as XSL Parameters.
XSL is executed using the XPath Extension Function ora:processXSLT. The two arguments for this extension function are as follows.
1) The XSL File Name
2) The source variable to be transformed [bpws:getVariableData(...)]
But there is one more argument that this XPath function can accept - 'properties'.
Note the signature of this function specified in xpath-functions.xml
Signature: ora:processXSLT('template','input','properties'?).
These properties translate to XSL Parameters that can be accessed within the XSL Map using the construct
<xsl:param name="<paramName>"/>
You can retrieve the value of this parameter within your XSLT in a way similar to the way used to extract data from XSL variables.
For e.g. <Name><xsl:value-of select="$param1"/></Name>
The "properties" argument of the XPath function is expected to be an XML Element that has the following structure.
Illustrated below is an example of such a properties XML.
<parameters xmlns:ns2="http://schemas.oracle.com/service/bpel/common" xmlns="http://schemas.oracle.com/service/bpel/common">
<ns2:item>
<ns2:name>userName</ns2:name>
<ns2:value>ramkmeno</ns2:value>
</ns2:item>
<ns2:item>
<ns2:name>location</ns2:name>
<ns2:value>CA</ns2:value>
</ns2:item>
</parameters>
Within the XSLT, the parameters are accessible through their names. [in this case, the parameter names are "userName" and "location", and their values are "ramkmeno" and "CA" respectively.
Approach
1) Declare a variable that is of the abovementioned dataType [see XML above.]
2) Populate the variable with the contents of the BPEL variable you wish to pass into the XSLT
3) Invoke processXSLT() with the XSL File, source variable, and the parameters variable.
4) Access the parameter contents within the XSLT
Example
BPEL Snippet
<!--Step 1: initialize the parameters variable from whatever BPEL variable whose information you need to access from within XSLT -->
<assign name="initializeXSLParameters">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:processXSLT('SetParams.xsl',
bpws:getVariableData('inputVariable','payload'))"/>
<to variable="propertiesXMLVar"/>
</copy>
</assign>
<!--Step 2: Invoke the XSLT with the parameters as the third argument -->
<assign name="executeXSLT">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:processXSLT('TestXSLParams.xsl',
bpws:getVariableData('inputVariable','payload'),
bpws:getVariableData('propertiesXMLVar'))"/>
<to variable="outputVariable" part="payload"/>
</copy>
</assign>
XSLT Snippet
<xsl:stylesheet version="1.0" ....>
<xsl:param name="userName"/>
<xsl:param name="location"/>
<xsl:template match="/">
<ns1:TestXSLParamsProcessResponse>
<ns1:result>
<xsl:value-of select="concat('User : ', $userName, ' Location : ',$location)"/>
</ns1:result>
</ns1:TestXSLParamsProcessResponse>
</xsl:template>
</xsl:stylesheet>
Output
<TestXSLParamsProcessResponse xmlns:ns1="http://xmlns.oracle.com/TestXSLParams" xmlns="http://xmlns.oracle.com/TestXSLParams">
<ns1:result>User : ramkmeno Location : CA</ns1:result>
</TestXSLParamsProcessResponse>
Just in case you did not know this already -
I was able to execute XSLT 2.0 transformations on ORABPEL 10.1.3.1 runtime.
Even though the graphical modeler does not support this, I could actually design and develop XSLT 2.0 transformation code.
XSLT 2.0 has significant advantages over 1.0 .
Five XSLT 2.0 Features that simplify XML Document transformations - http://www.oracle.com/technology/pub/articles/wang_xslt.html
Whats new in XSLT 2.0 - http://www.xml.com/pub/a/2002/04/10/xslt2.html
XSLT 2.0 Specification - http://www.w3.org/TR/xslt20/
XQuery 1.0 and XPath Functions and Operators - http://www.w3.org/TR/xpath-functions/
XPath 2.0 Specification - http://www.w3.org/TR/xpath20/
You need to ensure that the version attribute on your stylesheet element in the XSLT has the value "2.0" to ensure that the XSLT 2.0 processor executes your transformation code.
The default title of a BPEL Process Instance that you can see in the BPEL Console is "Instance <instanceId> of <processName>.
You can configure this to include key message data in the Title.
For this, you can use the bpelx:exec within your BPEL Process.
<bpelx:exec name="setTitle" language="java" version="1.4">
<![CDATA[
String orderNum = ((String)getVariableData("orderNumber"));
String woId = ((String)getVariableData("workOrderId"));
System.err.println("Title is " + (orderNum));
setTitle("Order [" + orderNum + "][" + woId + "]");]]>
</bpelx:exec>
If a BPEL process invokes a servlet through HTTP POST,
then the servlet can retrieve the request parameters through
request.getReader() or request.getInputStream(). request.getParameter() wont work for parameters posted through HTTP POST.
I found this interesting article on onjava.com.
http://www.onjava.com/pub/a/onjava/2005/07/27/axis2.html
After nearly 5 years of toil, WSDL 2.0 has reached Proposed Recommendation.
All the document deliverables are available at the WG home page.
http://www.w3.org/2002/ws/desc/
Here is a technote explaining the Error management features of Oracle AS Adapters.
Click here to access the technote.
These are the questions that the technote answers.
This page contains all entries posted to Ramkumar Menon's Blog in May 2007. They are listed from oldest to newest.
June 2007 is the next archive.
Many more can be found on the main index page or by looking through the archives.