Wednesday, June 13, 2012

Create/add Custom Xpath to OSB/osb eclipse
1.       Create java project with point 2 and 3 (it should have .properties and xml file).
2.       Create your java class and method to perform your operation.
3.       Add properties and xml
Create common-functions.Properties file with below two lines.
%OSB_FUNCTIONS%=Service Bus Functions
%FUNC_COMMON_COMMENT%=Utility function methods
Create common-functions.xml as,
xml version="1.0" encoding="UTF-8"?>
<xpf:xpathFunctions xmlns:xpf="http://www.bea.com/wli/sb/xpath/config">
    <xpf:category id="%OSB_FUNCTIONS%">     
        
         <xpf:function>
                <xpf:name>retrunStrxpf:name>
                <xpf:comment>%FUNC_COMMON_COMMENT%xpf:comment>
                <xpf:namespaceURI>http://www.test.com/xquery/Common-functions/testxpathxpf:namespaceURI>
                <xpf:className>com.service.util.TestCustomXpathxpf:className>
                <xpf:method>java.lang.String retrunStr(java.lang.String)xpf:method>
                <xpf:isDeterministic>falsexpf:isDeterministic>
                <xpf:scope>Pipelinexpf:scope>
                <xpf:scope>SplitJoinxpf:scope>
         xpf:function>
        
    xpf:category>
xpf:xpathFunctions>

4.       Export the above java project as jar file.
5.       Copy the jar, common-functions.Properties and common-functions.xml files into


\Oracle\Middleware\Oracle_OSB1\config\xpath-functions
6.       Restart the eclipse, now your custom function is ready to use it in OSB (xquery).
7.       In OSP add the name space, http://www.test.com/xquery/Common-functions/testxpath which is given in common-functions.xml and call your custom function as, tst:returnStr("test”)
8.       Done.



No comments:

Post a Comment