Sample Dynamic Xquery Example in OSB

Hi, can any body please provide Sample Dynamic Xquery Example in OSB......or jar file plzzz

or this one :
http://blogs.oracle.com/christomkins/entry/dynamic_transformations_using_1
basically it's the same as a normal xquery
only this time the xquery you want to execute comes from an to be executed expression
so look at the path at which your xquery exists
for example <YOUR_OSB_PROJECT>/sharedresource/xqueries/your_xquery
assign this to the expression field of the dynamic xquery
and after that bind all the parameters like you also do with a normal xquery

Similar Messages

  • OSB: Dynamic XQuery & Dynamic Validate against resource

    Hi all,
    I've a proxy where I select a dynamic XQuery and I would like to validate the result against a given schema that is different depending on the selected dynamic xquery. The result of the dynamic XQuery is an xml resource that is valid against its own schema but I have different schemas.
    My routing table (a simple xquery resource) contains the dynamic XQuery to select and the schema to be used for validating the result from the xquery.
    I noticed that the validate action doesn't support the dynamic selection of a resource to use in a validate action.
    Before osb 10.3 (alsb 3.0) the dynamic XQuery selection was implemented putting each XQuery execution (along with the related validate action) in a given proxy and then I used the dynamic routing concept. Now I can 'remove' this extra 'proxy wrapping layer' for dynamic XQuery execution but not for the validation part ... having at the end a mixed approach that I don't like ...
    Do you have any suggestion ?
    regards
    ferp

    Another option is to have IF-ELSE conditions in the message flow but this would be very difficult to maintain, however it can be an effective solution if you have very limiited number (say 10-15) of XSD's/WSDL's. For large number of XSD's/WSDL's, java callout is the best option.
    Regards,
    Anuj

  • XQuery transformation in OSB

    Hi
    can any body tell how to make xquery transformation for the requirement like source as xml and target as schema,please provide related links if any
    Thanks
    Mani

    http://docs.oracle.com/cd/E13160_01/wli/docs10gr3/dtguide/
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/userguide/xquery.html
    Already a thread is available.
    sample examples for doing XQuery transformation within OSB
    Hope this helps.
    Thanks,
    Vijay

  • Problem with Xquery transformation in OSB

    hi,
    My scenario is that I have to break the data in a single tag of xml A, to populate multiple tags of xml B.I am using Xquery transformation and substring function to achieve this. The problem comes when i import the xquery resource in OSB and try to do the transformation in a proxy service it gives the following error
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-382510</con:errorCode>
    <con:reason>
    *OSB Assign action failed updating variable "message": com.bea.wli.common.xquery.XQueryException: Error parsing XML: {err}XP0006: "element {http://schemas.xmlsoap.org/soap/envelope/}Body { {http://www.w3.org/2004/07/xpath-datatypes}untypedAny }": bad value for type element {http://www.example.org/data}data { {http://www.w3.org/2001/XMLSchema}anyType }*
    </con:reason>
    <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>
    the configuration i have done in the proxy service is this::_
    Assign: [XQuery resource..] to [message]
    Delete: [.] in [body]
    Insert [$message] [as first child of][.] in [body]
    The Xquery resource is the .xq file that i have generated for Xquery transformation.
    and i m routing this proxy service to a business service that wud take the XML and dump it to my D drive using file protocol.
    Edited by: rahulc on Oct 12, 2010 12:40 AM
    Edited by: rahulc on Oct 12, 2010 12:41 AM

    My Xquery is this::
    (:: pragma bea:global-element-parameter parameter="$data1" element="ns0:data" location="data.xsd" ::)
    (:: pragma bea:global-element-return element="note" location="note.xsd" ::)
    declare namespace ns0 = "http://www.example.org/data";
    declare namespace xf = "http://tempuri.org/OSB_Try/tag_break/";
    declare function xf:tag_break($data1 as element(ns0:data))
    as element(note) {
    <note>
    <to>
    fn:substring(data($data1),
    1 ,
    6)
    </to>
    <from>
    fn:substring(data($data1),
    7 ,
    6)
    </from>
    <heading>
    fn:substring(data($data1),
    13 ,
    6)
    </heading>
    <body>
    fn:substring(data($data1),
    19 ,
    11)
    </body>
    </note>
    declare variable $data1 as element(ns0:data) external;
    xf:tag_break($data1)
    and my data is this::
    <?xml version="1.0"?>
    <ns0:data xmlns:ns0="http://www.example.org/data">DON'T FORGET ME THIS WEEKEND!</ns0:data>
    and i have tested this zquery for the above data and this is the transformation its doing::
    <note>
    <to>DON'T </to>
    <from>FORGET</from>
    <heading> ME TH</heading>
    <body>IS WEEKEND!</body>
    </note>
    Edited by: rahulc on Oct 12, 2010 1:57 AM

  • How to set the condition for dynamic Xquery in OSB11g

    Hi to all,
    I have a requirement like three different requests all are converted in to standard format.For this scenario I use dyamic X-query transformation.For Example RequestA,RequestB and RequesrC what ever request it should be converted into one standard format say Response.For this I create three X-Query transformations,and proxy service.If i get the request from RequestA related XQuery will execute (RequstA to Response transformation).
    RequestA------Response
    RequestB------Response
    RequestC------Response
    Actually my idea is based on requset schema name (like RequestA) it will convert,for this scenario how can I set condition in dynamicXquery.
    Thanks in advance.

    Hi,
    Can u plz tel how make the x-query for an XML file,basically i follow the below link
    http://beatechnologies.wordpress.com/2010/12/01/dynamic-xquery-in-oracle-service-bus/
    In this example I'm creating the routing rulesXML file in Eclipse,I'm unable to assigning this xml file to an variable.I create a Xquery for this XML with any type,And I create GetRouting.XQ.can u pls tel which is correct method to Xquery with any type for this XML or else i send my jar file,tell me any modifications are required.
    Thanks in advance

  • Dynamic Service Invocation from OSB

    Hi,
         I have around 50 services in SOA Suite.  I have to invoke these 50 services dynamically from OSB service based on the input parameters.
         For example, The OSB proxy service will receive the input in the below format
                           <ServiceName>POService</ServiceName>
                          <OperationName>CreatePO</OperationName>
                           <ServiceURL>http://hostA:8011/PO/POService</POService>
                            <Payload>{XML Payload}</Payload>
         Based on the input, it will invoke the  POService using the ServiceURL, OperationName and the XML Payload.
         To implement this, i created proxy based on WSDL for the above message structure. I also created one BS based on Any SOAP.  The proxy will do the below activity
                         1) Extract all the details (url, payload, operation name) from the input
                         2) Replace the XMLpayload with $body
                         3) Use Route action to route it to BS. In the Route Request, i'm doing the below
                                  a) Using Routing Option to Set the URI using <ServiceURL>
                                  b) Using Insert Action setting the OperationName in $outbound/service/operation
    When i tested the service, i'm able to dynamically invoke the target BPEL services whichever has only one operation in the WSDL. But it is failing when i invoke the services which has multiple operation in the wsdl. The request is going to BPEL service and failing with "Operation Unknown" error though i could see in the trace the operation is set correctly in the $outbound
    Pls. let me know if anybody has done this or any idea on what is the issue here
    Thanks!
    Suresh

    $operation is mapped into HTTP SOAPAction header (for SOAP 1.1) in business services. Biz service uses the associated WSDL to do the mapping.
    Hence, if the $operation contains something that is not in the Biz WSDL, the SOAPAction header is not formed, and the backend service cannot figure our the operation.
    The backends that have only one operation, may not check the SOAPAction header, hence those do work.
    You'll have to form SOAPAction HTTP header manually, based on some mapping table that you'll have to create for those services.
    Vlad @ genericparallel.com

  • Convertion of String to XML node using Xquery transformation in OSB

    How to convert string to XML node elementusing a built in function using Xquery transformation in OSB?

    check this out - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html
    if in SOA (BPEL & Mediator) you can use oraext:parseXML.
    you should thoroughly analyse where to implement your requirement as some good practices advise to implement more complex logic in SOA and leave OSB to only connect to the services' endpoints.
    Hope this helps,
    A.

  • How to call business service from xquery transformation in OSB ??

    Hi All,
    How to call business service from xquery transformation in OSB ??
    I need to assign the response variable of Business Service to a target element in XQuery Transformation Mapper file.
    It's urgent.
    Regards,
    Jyoti Nayak

    Transformation is to mapping the source and target of 2 different schemas.
    In your case you should have a XQuery transformation between, your Business Service output schema and the target schema.
    Thanks,
    Vijay

  • Need sample ALSB project migration to OSB 11g environment

    Hi
    I'm looking for sample ALSB project migration to OSB 11g environment and as well as steps to automate deployment of OSB 11g projects by using WLST
    Can some one please help me out in regards to the same
    Thanks
    Ram.S

    Please find the build.xml
    <?xml version="1.0" encoding="windows-1252" ?>
    <project name="ConfigExport">
    <property file="./build.properties"/>
    <property name="metadata.dir" value="${workspace.dir}/.metadata"/>
    <property name="domain.export.script" value="export.py" />
    <property name="domain.import.script" value="import.py" />
    <path id="library.osb">
    <fileset dir="${osb.home}/modules">
    <include name="com.bea.common.configfwk_1.6.0.0.jar"/>
    <include name="com.bea.core.xml.xmlbeans_2.2.0.0_2-5-1.jar"/>
    </fileset>
    <fileset dir="${weblogic.home}/server/lib">
    <include name="weblogic.jar"/>
    </fileset>
    <fileset dir="${osb.home}/lib">
    <include name="alsb.jar"/>
    </fileset>
    </path>
    <taskdef name="wlst"
    classpathref="library.osb"
    classname="weblogic.ant.taskdefs.management.WLSTTask"/>
    <target name="exportFromOSB">
    <wlst fileName="${domain.export.script}" debug="true" failOnError="false" classpathref="library.osb"
    arguments="${wls.username} ${wls.password} ${wls.server} ${export.project} ${export.jar} ${export.customFile}">
    <script>
    adminUser=sys.argv[1]
    adminPassword=sys.argv[2]
    adminUrl=sys.argv[3]
    exportJar = sys.argv[5]
    customFile = sys.argv[6]
    passphrase = "osb"
    project = sys.argv[4]
    connect(adminUser,adminPassword,adminUrl)
    domainRuntime()
    </script>
    </wlst>
    </target>
    <target name="importToOSB">
    <wlst fileName="${domain.import.script}" debug="true" failOnError="false" classpathref="library.osb"
    arguments="${wls.username} ${wls.password} ${wls.server} ${import.project} ${import.jar} ${import.customFile}">
    <script>
    adminUser=sys.argv[1]
    adminPassword=sys.argv[2]
    adminUrl=sys.argv[3]
    passphrase = "osb"
    project=sys.argv[4]
    importJar=sys.argv[5]
    customFile=sys.argv[6]
    connect(adminUser,adminPassword,adminUrl)
    domainRuntime()
    </script>
    </wlst>
    </target>
    <target name="exportFromWorkspace">
    <!--delete failonerror="false" includeemptydirs="true"
    dir="${metadata.dir}"/-->
    <java dir="${osb.home}/lib" classpathref="library.osb"
    jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar"
    fork="true" failonerror="true" maxmemory="768m">
    <jvmarg line="-XX:MaxPermSize=256m"/>
    <arg line="-data ${workspace.dir}"/>
    <arg line="-application com.bea.alsb.core.ConfigExport"/>
    <arg line="-configProject ${config.project}"/>
    <arg line="-configJar ${config.jar}"/>
    <arg line="-configSubProjects ${config.subprojects}"/>
    <arg line="-includeDependencies ${config.includeDependencies}"/>
    <sysproperty key="weblogic.home" value="${weblogic.home}"/>
    <sysproperty key="osb.home" value="${osb.home}"/>
    <sysproperty key="osgi.bundlefile.limit" value="500"/>
    <sysproperty key="harvester.home" value="${osb.home}/harvester"/>
    <sysproperty key="osgi.nl" value="en_US"/>
    <sysproperty key="sun.lang.ClassLoader.allowArraySyntax" value="true"/>
    <sysproperty key="osgi.bundlefile.limit" value="750"/>
    <sysproperty key="middleware.home" value="${fmw.home}"/>
    </java>
    </target>
    </project>
    With the target:importToOSB,I was able to successfully import into OSB11g environment
    but with target:exportFromOSB or exportFromWorkspace I'm unable to export from OSB11g environment
    to my local directory
    So my intention is to get the OSB11g exported into my local directory
    Can you please help me out in getting this resolved
    Thanks
    RS

  • Convertion of XML node to string using Xquery transformation in OSB

    How to convert XML node to string using a built in function using Xquery transformation in OSB? In BPEL we have the Xpath extension function ora:getContentAsString() to do the same.

    fn:bea-serialize() function converts xml node to string. but it assigns namespace prefix in every xml node during the conversion. So is there any function to remove the namespace prefix from XML node using Xquery built in function?

  • Jdev10.1.3 - error in the last step of Sample Databound cuecard example

    Hello
    I am trying to execute the last step in Sample Databound cuecard example i,e 'Add a Field for the parameter value'. in the output browser when i am entering the 'sh' in to the input text field and when i click the 'FindContactsByName' button i am not getting the names containig 'sh'in the table component of the same page.
    If any of you are the aware of this error ..Please help me how to overcome this error.
    I appriciate all your time and patience.
    Thanks

    Hello
    I am trying to execute the last step in Sample Databound cuecard example i,e 'Add a Field for the parameter value'. in the output browser when i am entering the 'sh' in to the input text field and when i click the 'FindContactsByName' button i am not getting the names containig 'sh'in the table component of the same page.
    If any of you are the aware of this error ..Please help me how to overcome this error.
    I appriciate all your time and patience.
    Thanks

  • Dynamic XQuery Where clause

    I have the following schema:
    <?xml version="1.0"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="CountryRiskService"
    targetNamespace="CountryRiskService"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="CountryRiskParameters">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="countryId" type="xs:int" minOccurs="1" maxOccurs="unbounded"/>
    <xs:element name="catA" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I am passing this into my Logical Data Service, what I want to do is create a dynamic XQuery where clause if the catA field is populated, ignore it if it isn’t, so basically, I want to be able to create a dynamic query based on the parameters requested, so I have the following XQUERY:
    declare function tns:getCountries($countryRiskInput as element(ns7:CountryRiskParameters)) as element(ns0:CountryRiskInfo)* {
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA
    I really thought that DSP would be able to handle this on the fly since the element is optional but if I don’t populate it, I get nothing back, the idea is I want to increase the number of elements in my schema so my consumers have the ability to filter the results they want, so above, I don’t want the second where clause if catA isn't specified, any ideas how to accomplish this?

    Simply add the disjunction of the input being empty.
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where ( $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA or empty( $countryRiskInput/ns4:catA )
    But suppose you have 27 different elements that you might want to filter on - the xquery gets long and ugly. You might want to looking into using FilterXQuery. Visit http://edocs.bea.com/aldsp/docs25/, search on FilterXQuery, look for the tutorial.
    If your queries get more complicated, you would do well to look into generating ad hoc queries. (edocs as well).

  • Typo/error in dynamic table example

    I'm talking about the on-line copy of the Spry dynamic table
    example:
    http://labs.adobe.com/technologies/spry/articles/dynamic_table/
    In the last two code blocks, in the TR element that uses
    spry:repeat, the value of spry:repeat is set to "spry:repeat"
    instead of "dsEmployees". If someone copies one of those code
    blocks and tweaks it to use it for their own datasets, they'll get
    a tokenizeData error.

    Thanks for catching that!
    The fixed version is now live on Labs.
    Thanks,
    Don

  • Failed to get schema from the dynamic feed (example.php).

    Hi,
    I've been trying to get the schema from an exported xml file
    ex. example.php
    (using Developer Toolbox).
    But it keeps saying "
    Failed to get schema from the dynamic feed (example.php)."
    Any help?
    Thanks
    Wald

    Here's the file:
    data.php, I can see it
    correctly in the browser except of the style information that are
    missing.
    Code:
    <?php require_once('../Connections/example.php'); ?>
    <?php
    // Load the XML classes
    require_once('../includes/XMLExport/XMLExport.php');
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "", $theNotDefinedValue = "")
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
    : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ?
    mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) .
    "'" : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    break;
    return $theValue;
    mysql_select_db($database_example, $example);
    $query_data = "SELECT * FROM example";
    $data = mysql_query($query_data, $example) or
    die(mysql_error());
    $row_data = mysql_fetch_assoc($data);
    $totalRows_data = mysql_num_rows($data);
    // Begin XMLExport data
    $xmlExportObj = new XMLExport();
    $xmlExportObj->setRecordset($data);
    $xmlExportObj->addColumn("Name", "Name");
    $xmlExportObj->addColumn("Damage", "Damage");
    $xmlExportObj->addColumn("Speed", "Speed");
    $xmlExportObj->addColumn("Level", "Level");
    $xmlExportObj->addColumn("Details", "Details");
    $xmlExportObj->addColumn("Type", "Type");
    $xmlExportObj->addColumn("Source", "Source");
    $xmlExportObj->addColumn("Location", "Location");
    $xmlExportObj->addColumn("Date", "Date");
    $xmlExportObj->addColumn("Price", "Price");
    $xmlExportObj->addColumn("Skill", "Skill");
    $xmlExportObj->addColumn("Constitution", "Constitution");
    $xmlExportObj->addColumn("Intelligence", "Intelligence");
    $xmlExportObj->addColumn("Wisdom", "Wisdom");
    $xmlExportObj->addColumn("Strength", "Strength");
    $xmlExportObj->addColumn("Member", "Member");
    $xmlExportObj->addColumn("Image", "Image");
    $xmlExportObj->setMaxRecords("ALL");
    $xmlExportObj->setDBEncoding("ISO-8859-1");
    $xmlExportObj->setXMLEncoding("ISO-8859-1");
    $xmlExportObj->setXMLFormat("NODES");
    $xmlExportObj->setRootNode("Category");
    $xmlExportObj->setRowNode("Type");
    $xmlExportObj->Execute();
    // End XMLExport data
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>example</title>
    <link href="css.css" rel="stylesheet" type="text/css"
    />
    </head>
    <body>
    </body>
    </html>
    <?php
    mysql_free_result($data);
    ?>
    Thanks again

  • For each sample example  in OSB without Split join

    Hi,
    Any body have sample example for For each in OSB without Split join......Thanks in advance

    I know this is an old thread, but I just ran into this same problem. Wow! That's a crappy 'feature'. I wasted 4 hours this morning on this thinking it was me doing something wrong in my xpath, but nope, you need to cast the counter to an int .......
    I hope they fix things like this in the next major release.
    Thanks for the solution.

Maybe you are looking for

  • Is there a different way to open a cursor for a ref cursor procedure?

    hello everybody i have two cursors, cur_a and cur_b, declared somewhere else in my application. These two cursors have the same fields, in the same order, and i have to treat both in the same way. So i wrote a routine that gets as input a ref cursor

  • Query failing as the size increases (11.1.0.7.0)

    Below is the query: SELECT DISTINCT product1 tag , product3 suppliername , product6 peerreview_score , product9 externalreview_score , product10 shoppingcategory , product11 leadtime , product14 manufacturerrating_score , product17 supplierrating_sco

  • BPEL Workflow Tasks - Assignees and how BPEL handles rejection of tasks.

    (JDeveloper 10.1.3.1.0) So I am curious about the following: 1) When rejecting a task, can it go to the person that initiated the task? Or do we need to handle this through new tasks? Like in a while loop? 2) Can we specify users and groups when sele

  • Freight Conditions and Commission Rate - New Requirement

    Hi All, There is new requirement about Freight condition and Commission Rate. Please see below for details: I got the requirement lets say: They want 3 different types of freight like 1st Freight - based on unit/qty, 2nd freight - Fixed Amount, and 3

  • Macbook not access work or home networks with wep key

    I have just purchased a Macbook. It is to be used for work and home purposes. The work network is a given, and can not be changed. It requires a wep key that is 26 charcters long. When I input this via the Network instructions on my Macbook, it is no