OSB: How to recreate reusable XQuery functions

OSB's XQuery implementation does not support the XQuery "module" which allows the creation of a function library so how can OSB provide function re-use?
I know you can create XQuery transformations that can be called but these always need a "body" that makes a specific call so I'm finiding I have to copy useful XQuery functions from one transformation to another. Ideally I should be able to call an XQuery function external to the transformation.
Does anyone have any pointers on this or is it a fundamental limitation of the OSB XQuery implementation?
regards

What we did is creating a seperate project in which we use most of XQuery stuff, using SaxonSA library to run and validate the queries.
This project adds the following possibilities for xqueries:
- Schema validation of XPath used in XQueries (including namespaces)
- XQuery syntax validation (with errors at the exact line and position where it fails.
- Allows the use of modules
- Reqression testing XQueries
Regrettably we can not do Java callout's from XQueries as this is not supported on the ESB.
We also build a simple 'flattener' that takes a module based, schema enriched XQuery and then generates the XQuery that can be used on the ESB itself. The flattened query is also regression tested.
Although it was quite some work to make it, it already has paid back the initial costs of the project in the second or third project we did. We since then have enhanced the project so it also can do regression message flow validation on the OSB (we already had valid input and output messages).
The tool also greatly improves the stability of the code on the OSB, and reduces development time as we can build the XQuery from a unit test environment that will point out typos and other xpath related problems.
We do have some fairly complex xqueries on the OSB, the number of xqueries in the project at the moment is 187 with 250 unittests.
So, if Oracle is not going to include it in the OSB itself (which seems lilkely at the moment), you can build such a system yourself !
Wim Veldhuis,
PharmaPartners BV

Similar Messages

  • Including customized xquery functions in XQuery/XSLT expression Editor-OSB

    Hi,
    I have written a customized xquery function. I want this to be included in the List of Xquery Functions which is displayed by Oracle Service Bus in the XQuery/XSLT
    Expression Editor. OSB displays the built in xquery functions in the XSLT/Xquey Expression Editor. Is there any way to add the customised xquery to this list, so that it can be dragged and dropped later?
    Thanks,
    Balaji.

    I doubt if that is exposed out side of Oracle Engineering (Not public/documented). Please raise a support ticket for enhancement. If PM should concur you might get the steps that need to be performed for this feature.
    Thanks
    Manoj
    Edited by: Manoj Neelapu on Jun 8, 2010 8:37 AM

  • OSB: Calling XQuery from XQuery function

    Hi,
    In OSB, is it possible to call XQuery functions from an XQuery. I have a number of XQuery files (.xq) and I want to call them from another xquery file, is that possible. I tried calling directly but it didn't work. Is there a way?
    Thank you
    Matt

    Matt,
    To use custom XPATH/XQuery functions, you need to register them into OSB runtime. Please refer -
    http://docs.oracle.com/cd/E21764_01/doc.1111/e15866/custom_xpath.htm#OSBDV1725
    http://eelzinga.wordpress.com/2010/05/10/oracle-service-bus-11g-using-custom-xpath-functions/
    Regards,
    Anuj

  • How I can create new XQuery functions in AQSB?

    Hi,
    I need create XQuery functions in AQSB to use them in proxy services. Is that posible?
    Thanks for your help!!! :-)

    Hi,
    Have you activated the IC in the last dialog box of the wizard. Expand the root Account and see if you were able to see your sample BC. If you found that check the box and it will be available in the IC.
    Regards,
    Joseph

  • Retrieving Principal Name (=User Id) via XQuery Function

    I'm using a custom identity asserter within my WLS to create the security context.
    The OSB documentation states, that there is a XQuery function to read the user id from the security context: fn-bea:userid (see XQuery Implementation - 11g Release 1 (11.1.1.7)). Note: I have noticed that Oracle makes a distinction between Function Extensions from Oracle Service Bus and Supported Function Extensions from Oracle a.k.a Oracle’s XQuery Implementation).
    When using this XPath function in my OSB installation I receive the following error: {bea-err}SYS001: This functionality has not been implemented (sorry) operator [QName {http://www.bea.com/xquery/xquery-functions}userid]
    My questions:
    - Is this the correct function to read the user id/user name/principal information from the security context?
    - If it is, how can I make that function run in my OSB Domain? Is there a component I need to include/reference?
    - If not, what other options do I have? What is best practice? (e.g. Java Callout & accessing the HttpServletRequest object via Java?)
    Many thanks in advance.

    In OSB you can use fn-bea:lookupBasicCredentials($arg-string) function for the same.
    Here is the referece: XQuery Implementation - 11g Release 1 (11.1.1.6.3)

  • Xquery function in pl sql

    Hi all.
    Is some body know can XQuery functions be used/declared in pl sql? More deep, can I cover XQuery function by pl sql function or procedure? And how to input parameters/variables to Xquery function from pl sql?
    Any links to manual will be helpful.
    Best regards,
    Anton.

    Something like that?:
    SQL> create or replace procedure index_scan (index_name varchar2, name varchar2)
    as
       xml   xmltype;
    begin
       select xmlquery (
    if ("article-by-title" = $index_name) then doc("/wiki")/root/page[title=$name]
    else if ("article-by-id" = $index_name) then doc("/wiki")/root/page[id=$name]
    else if ("link-by-target" = $index_name) then doc("/wiki")/root/page/links/link[@target = $name]
    else if ("article-by-cat" = $index_name) then doc("/wiki")/root/page/catlinks/catlink[@target=$name]
    else error(fn:QName("http://www.w3.org/2005/xqt-errors",  $index_name) , "Some error occured") '
                 passing index_name as "index_name", name as "name"
                 returning content)
         into xml
         from dual;
    end index_scan;
    Procedure created.
    SQL> exec index_scan('My Index Name','My Name')
    BEGIN index_scan('My Index Name','My Name'); END;
    Error at line 20
    ORA-19112: error raised during evaluation: :My Index Name
    Detail: Some error occured
    ORA-06512: at "MICHAEL.INDEX_SCAN", line 5
    ORA-06512: at line 1Don't have your resources - therefore the error!

  • XQuery function : Adding day to current date

    I have a requirement to add 1 day to the current date during the Xquery transformation.
    Does anyone know if there is any xquery function that does that?
    From this link,
    http://download.oracle.com/docs/cd/E13214_01/wli/docs92/xref/xqdtopref.html#wp1162860
    it seems like there is a function, op: add-yearMonthDuration-to-dateTime, that serve this purpose, but I don't find it in OSB console IDE nor OEPE.

    You can use the below expression for adding 1 day (24 hrs) to a given current date:
    fn:current-dateTime() + xdt:dayTimeDuration("PT24H")
    Thanks,
    Patrick

  • OSB: xpath as result of Xquery output ?

    Hi
    I have a non-schema bound XML as input. It will have "KEYWORD" as value of one of the tags.
    I want dynamic text "hello" in place of KEYWORD.
    As of now I convert XML in string with fn-bea:serialize() and then do a fn:replace.
    viz:
    let $received_input :=<C><D>KEYWORD</D></C>
    let $convertedXML:= fn-serialize($received_input)
    let $temp_string:= fn:replace($convertedXML,"KEYWORD","hello")
    let $final_output:=fn-bea:inlinedXML($temp_string)
    return $final_output
    Now note that input xml will always vary, like *<Z>KEYWORD</Z>* or <B><C><D>KEYWORD</D><E>KEYWORD</E></C></B> or anything, only "KEYWORD" will be present for sure.
    Since input xml varies, i don't have a schema. What if I want to use replace action with node contents in variable received_input? I would need to compute xpath of node which has value=KEYWORD. This is dynamic calculation of xpath.
    I wonder if there is a xquery function that I could use in OSB for this? Basically idea is to give input a value and function returns xpath of the node which conntains the value.
    Thanks and Regards
    Swapnil Kharwadkar

    Hi Swapnil Kharwadkar,
    You can do what you want using plain xpath...
    $input =
    <a>
    <b>b</b>
    <c>keyword</c>
    <d>d</d>
    <e>keyword</e>
    </a>$value = 'hello'
    Replace Xpath = //*[. = 'keyword'] in variable = $input expression = $value (replace node contents) will give you...
    <a>
    <b>b</b>
    <c>hello</c>
    <d>d</d>
    <e>hello</e>
    </a>This will work for any schema as the xpath expression is searching by content only...
    Hope this helps...
    Cheers,
    Vlad

  • How to recreate the relation?

    Help me. How to recreate?
    kanish

    Help me. How to recreate?Seriously, this is all the information you are going to give us! Perhaps you should review Grant Ronald's thread Before posting on this forum please read.
    There are a number of ways to create a relationship between data blocks. You can use the Data Block Wizard or you can open the block node in the Object Navigator - select the "Relationship" sub-node and then click on (+) to open the Relationship Wizard. If you have a data block situation where a standard relationship object doesn't work, then you have to recreate - through code - the functionality of a relationship.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Precompiled xquery functions

    I'm trying to find the way to prepare and reuse queries thought the life of application.
    I have a bunch of functions that call each other; all of them accept one string parameter and will be called frequently.
    What I'm doing is:
    1. Prepare following query for each function call (declarations of all and call of one of them):
    declare function pg:fun1 ( $t as xs:string )
    return "some_node"
    declare function pg:fun2 ( $t as xs:string )
    return ns:fun1 ( $local_var )
    declare variable $p as xs:string external;
    return ns:fun1 ( $p )
    2. Call function this way:
    self.__qe [ function ].setVariableValue ( "p", XmlValue ( XmlValue.STRING, str ( arg ) ) )
    return self.__qe [ function ].execute ( self.__dc.qc )
    If it would work that would serve my needs, but preparing (step 1) falls with error:
    _dbxml.XmlQueryParserError: (6, "Error: Unrecognized character 'p' (0x70) [err:XPST0003], <query>:26:9")
    that error on actual function call "return ns:fun1 ( $p )", so it's not sufficient to just declare external variable before query preparation
    Maybe I'm taking completely wrong approach, but I couldn't find any tips on how to do that proper way. If somebody can tell me how to prepare bunch of functions and than just call them passing different parameter values, I would be much appreciated.

    Hi Philippe,
    You would be doing things in a correct manner if you were using XQuery syntax in your query. After unmangling what I think you mean from what you posted, you might want to try something like this:
    declare function local:fun1 ( $t as xs:string )
    "some_node"
    declare function local:fun2 ( $t as xs:string )
    local:fun1 ( $t )
    declare variable $p as xs:string external;
    local:fun1 ( $p )John

  • I updated to Firefox 4.0.1 and can no longer use the thumb/finger spreading feature on the trackpad of my Mac Powerbook (Mac OSX 10.6.7) to enlarge text on websites. How do I restore this function?

    I updated to Firefox 4.0.1 and can no longer use the thumb/finger spreading feature on the trackpad of my Mac Powerbook (Mac OSX 10.6.7) to enlarge text on websites. How do I restore this function?

    * [/questions/777886]
    Some gestures have been removed in Firefox 4.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in -> <b>cmd_fullZoomReduce</b>
    browser.gesture.pinch.in.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.out -> <b>cmd_fullZoomEnlarge</b>
    browser.gesture.pinch.out.shift -> <b>cmd_fullZoomReset</b>
    browser.gesture.pinch.latched -> <b>false</b>
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    You can use the Filter bar at to top of the about:config page to locate a pref more easily.

  • How to create a callback function module

    Hi all,
    I am working in a requirement where we need to call a function module at a 'after change' event. So how to create a callback function module and register it with the crmvevent ?_
    I created a sample function module and try to create entries in table crmv_event_cust, but i got an error message saying that the function module name I provided is not in table CRMC_FUNC_ASSIGN. When I try to create entry there, I got a message that function module is not in CRMC_OBJ_FUNC and that table is a standard table with no maintanance options !!
    looks like i am going in wrong way ... can any one please help ??

    Looking at my system all you need to do is create the entry for the callback function in maint view: CRMV_FUNC_ASSIGN.
    Your entry should be as simple as Z-function name Object Function - <same as others in the segment you are assigning>
    IE for the partner it would be CRM_PARTNER as object function, for general order processing CRM_ORDER
    Take care,
    Stephen

  • How to check for a function module with its description and functionality

    Hi all,
    How to check for a function module,with its description and its functionality,in detail how can I know the purpose of a particular function module,how to search for a function module which suits my requirement .

    Hi,
    You can search a FM of your requirement by putting in the Key words and searching for a FM. Like * KEYWORD * and then pressing F4.
    Say for example you need to search something regarding converstion.
    Search for * CONVERT * and press F4.
    If there is something specfic like converting date to something you can give
    DATE * CONVERT *
    OR
    CONVERT * DATE *  and press F4.
    Once you narrow down your search you will have a Function module documentation inside the Function module. Please note that all the FMs willl not have documentation.
    Regards,
    Pramod

  • How to go into a function module through SE80 t - code

    Hi All , 
                 How to go into a function module through SE80 t - code.
    Thanks in advance.

    >
    Balaji Krishnamoorthy wrote:
    > Hi All , 
    >              How to go into a function module through SE80 t - code.
    >
    > Thanks in advance.
    Hi,
    With  help of  function group
    Thanks & Regards
    Edited by: Always Learner on Oct 16, 2008 2:31 PM

  • How to config Check Digits function module for Student Number Validation

    Hi SLCM Experts,
    In the SAP-SLCM, How to use check digits function module for validate student number.  Just only config it or need to customizing program.
    *Any idea to student number validation in SLCM?*
    Best Regards,
    Suvatchai K.

    Hi ,
    Can you expalin it further ?
    You configure the St. no in piq_matr . And set it  as external or internal no. range which suits your business .
    What is the validation you are looking for ?
    Regards
    Gajalakshmi

Maybe you are looking for

  • Getting music off my Micro

    Well get this.. I have my Creative Zen Micro (M/N DAP-MD0004)(P/N MAPF08054500843V) that I got a year or so and I cannot remove songs that I have put on it to put onto my computer. I am assuming this is because of the software provided from Creative'

  • Firewire 400/800 problem

    Hi all, I just bought a new MacBook Pro 15" 2.2GHz. I have been happily using my Firewire 800 on a Mirrored Raid drive that is partitioned into two drives: one for backup, one for media. When I plug my DV video camera into my FW400 port, nothing happ

  • Screen Exit: desiable to Enable mode

    Hi, In HUPAST Tcode , on Standard screen there is disable field VEMEH i.e UOM unit of Measurment filed. I want it should be in enable mode .  input and output fields. how to change it ?

  • Weblogic/security/service/SubjectManagerImpl

    In which library/jar this class can be found weblogic/security/service/SubjectManagerImpl ????

  • Loaking games and themes on my 8330

    I've been told that you can load games on your blackberry by putting the Jar file on a media card and starting it from there. When I browse to the folder I put the Jar file and select it, I'm asked if I want to download it. What does this mean? Will