Wednesday, April 24, 2013

Passing two variables to Xquery Transformation

Using Xquery Transformation wizard in OEPE we can create a Xquery transformation with multiple input source variable types.  But sometimes when we want to add an extra parameter to the source to an existing Xquery transformation do the below:
suppose we have an existing xquery transformation as below: (Removed the mappings to be clear)

 ========================================================================

declare function xf:sample($orcl2FoodlinVendorOutputCollection1 as element(ns0:Orcl2FoodlinVendorOutputCollection))
    as element(ns1:VendorList) {
       
};
                             
declare variable $orcl2FoodlinVendorOutputCollection1 as element(ns0:Orcl2FoodlinVendorOutputCollection) external;


xf:sample($orcl2FoodlinVendorOutputCollection1)

 ========================================================================
And I would like to add another variable, "runId" which is a string as an input to the above Xquery Transformation:

declare function xf:sample($orcl2FoodlinVendorOutputCollection1 as element(ns0:Orcl2FoodlinVendorOutputCollection),$runId as xs:string)
    as element(ns1:VendorList) {
       
};

declare variable $orcl2FoodlinVendorOutputCollection1 as element(ns0:Orcl2FoodlinVendorOutputCollection) external;
declare variable $runId as xs:string external;

xf:sample($orcl2FoodlinVendorOutputCollection1, $runId)


========================================================================
The variable "runId" should be declared and assigned prior to this xquery transformation in the proxy service message flow (or in the split join flow)

Monday, April 22, 2013

Setting space as constant in Xquery Transformation

Add below to the prolog and set the space to the xml tag.

declare xmlspace preserve;



Thursday, April 4, 2013

JAXB JAXBElement XJC @XmlRootElement




C:\orderXSDs>xjc -d  C:\src -p com.cswg.soa.ebs.otc.outbound.exe.orders.dcinfo F
ileTypeByDCInfo_table.xsd


FileTypeByDCInfo_table.xsd is located under orderXSDs directory.  The generated clases will be under C:\src directory

if you are getting the exception,
java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast
look @
http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html

http://stackoverflow.com/questions/707084/class-cast-exception-when-trying-to-unmarshall-xml