Tuesday, June 23, 2015

Creating a Business Service to Access a Database Table in OSB

There are several steps that need to be completed before you can create a business service in OSB to access/modify data in a database table.  At a high level you will need to create the JCA Adapter files in JDeveloper, create the data source/connection pools in Weblogic and then import the JCA Adapter files into OSB.  Below are the detailed steps.


1.   Create JCA Adapter in JDeveloper        
2.  Create a zip file with the JCA Adapter files that you need for the import.  It needs to be in a zip file to import into OSB.  Note: You can get the location of these files by clicking on them in JDeveloper.
         a. Add the following to the zip file
                  i. <Project>.wsdl
                  ii. <Project>_db.jca
                  iii. <Project>_db-or-mappings.xml
                  iv. <Project>_table.xsd
3. Create a New Data Source in  Weblogic       
4. Link DB Adapter outbound connection pool to a data source         
5.  Import JCA Adapter files
         a. Log into the OSB Console
         b. Navigate to the project you are working on
         c. Create a directory to hold the JCA Adapter files (<Project>/Resources/jca)
         d. In the Create Resource menu, select Bulk -> Zipped Resources





         e. Select the zip file created in step 2.




         f. Select Next
         g. All of the files that you added to your zip file in step 2 should now be displayed on the Review Loaded Resources page.


         h. Select Import.
         i . Fix Conflicts.   

Note: You will need to fix any path conflicts caused by moving all of the files into the same area. In JDev the schema files are in a different directory.

                  i. Click on View Conflicts.



                   ii. Start by fixing the wsdl conflict as this should resolve all of the conflicts. This can be fixed by changing the schemaLocation.



                  iii. Activate Changes.

4. Create Business Service
         a.  Create WSDL that will be used by the Business Service. This WSDL will have the operations that you specified when you were creating the JCA Database Adapter in step 1.
                  i.  Navigate to the *.jca file that was imported in Step 3 (<Project>/Resources/jca)
                  ii. In the Actions column next to the JCA Binding file imported click on the Generate WSDL and Service from this JCA binding resource button.


                  iii.  Specify the new WSDL Name and New Service Name. Also, choose a location for the new WSDL file. To avoid confusion, we put it in the BuisnessServices folder.


                  iv. Select Generate


Creating XSD from XML document using JDeveloper 11g

JDeveloper 11g gives you the ability to quickly and easily create an XML schema document (XSD) from an XML document.   Below are the steps needed.


1) In JDeveloper, go to File -> New
2) In the New Gallery window be sure the All Technologies tab is select.  Scroll down and select the XML category and then select XML Schema from XML Document.


















3) A Create XML Schema from XML Document window will come up.  In this window you will need to fill in information on the schema file you want to create and you will need to select the XML file you want to use to generate the XSD.














Here is some additional information from the help menu on options on the Create XML Schema from XML Document page.

XML Schema
Enter a name for the new file. By default, the filename that JDeveloper creates for new files appears. The extension .XSD is displayed.

Directory
Enter a directory for the file. By default, the directory that JDeveloper creates to store your files appears. To store the files outside of JDeveloper's directory structure, or to redefine what the file directory is called, enter your changes.

Target Namespace
Enter a URI reference of the namespace of this schema.

Prefix
Enter an identifier for a namespace. For example, you don't need to specify an entire namespage in an XML document when referring to its types. You can instread use the the prefix.

XML Document
Choose the XML file to use to generate the schema.

Generate Enumerations
Select to use all current values in the XML data set as enumerated values for each element/attribute in the generated XML schema.

Choosing Between Route, Service Callout and Publish

When you are first starting with OSB it can be a little tricky to determine when to use a Route, Service Callout or a Publish node.  All three can be used to call either a Business service or a local Proxy service.  You can use the following lists to determine which will best fit your needs.


Route
  1. Last node in request processing.  It can be thought of as a bridge between request pipeline processing and the response pipeline processing.
  2. You can only execute one route in your Proxy Service.
  3. Can only be created in a route node.
  4. OSB will wait for the Route call to finish before continuing to process.
    1. If you are calling a Business service and you specify Best Effort for QoS (Quality of Service), then OSB will release the thread it is holding while the business service executes.
    2. If you are calling a Business service and you specify Exactly Once or At Least Once for QoS, then OSB will hold onto the thread while the business service executes.
    3. If you are calling a local Proxy service, then OSB will hold onto the thread until the Proxy service finishes executing.
Service Callout
  1. Can have multiple Service Callout nodes in a Proxy service.
  2. Pipeline processing will continue after a Service Callout.
  3. Can be invoked from the request and/or response pipelines.
  4. Used to enrich the incoming request or outgoing response. For example, a call to get a country code.
  5. Used for real time request/response calls (Synchronous calls).
  6. OSB will hold a thread and not continue until the Service Callout completes.
  7. Can tie up resources and degrade performance under heavy loads.
Publish
  1. Can be synchronous or asynchronous
    1. If you are calling a business service with a Quality of Service of Best Effort , then it will be an asynchronous call.
    2. If you call a business service with a Quality of Service of Exactly Once or At Least Once, OSB will wait until the processing completes in the business service completes before proceeding and it is effectively a synchronous call.
    3. If you are calling a local proxy service, OSB will wait until the processing in the local proxy service completes and it is effectively a synchronous call.
  2. Can be invoked from the request and/or response pipelines.
  3. Best to use when you do not need to wait for a response from the process you are calling (Fire and Forget.... Asynchronous Calls)

Monday, June 22, 2015

Understanding Data Sources and Connection Pool in Weblogic

Terms like datasources and connection pools are very familiar to weblogic developers and admins.

Most of the times developer ask for datasource creation on weblogic servers. Developers or admins who have worked on Oracle Application server also will be familiar with these terms. Newbies often get confused about these and the difference between the two.


In simple terms Applications deployed on weblogic servers(managed servers) use the datasources( created on Weblogic server level) to connect to the databases.


Though the connection can be made at the deployed code level(JDBC connect strings) Data sources and their connection pools provide connection management processes that help keep your system running and performant.You can set options in the data source to suit your applications and your environment.


I explain the concepts in more details below:




Data Sources


In WebLogic Server, you configure database connectivity by adding data sources to your WebLogic domain. WebLogic JDBC data sources provide database access and database connection management. Each data source contains a pool of database connections that are created when the data source is created and at server startup. Applications reserve a database connection from the data source by looking up the data source on the JNDI tree or in the local application context and

then calling getConnection(). When finished with the connection, the application should call connection.close() as early as possible, which returns the database connection to the pool for other applications to use.


Connection Pool


Each JDBC data source has a pool of JDBC connections that are created when the data source is deployed or at server startup. Applications use a connection from the pool then return it when

finished using the connection. Connection pooling enhances performance of the application server or deployed application response time by eliminating the costly task of creating database connections for the application.


Hope the above post helps. In future posts I would write on how to create connection pools in Weblogic and more importantly tuning them.

Tuesday, June 16, 2015

OSB BEST PRACTICES.

Strive to have a single message representation for as much of the pipeline as possible. This makes it easy to insert things at various points since you don’t have to think about what the current document format is.

Always configure the service-level error handler. For non-SOAP services the built-in error handler only returns a transport error code since there is no standard error response document like a SOAP fault that it can auto generate.

When publishing or routing to multiple services use the table version of those actions. A table is typically more efficient than a chained if/then/else.

If a proxy service has a WSDL with multiple operations, it is generally recommended to use operational branching to handle messages separately for each operation.

Update Actions like Delete, Insert, Replace, Rename are more efficient for minor fixes to a document than using Assign with an 

XQuery that regenerates the entire document, especially if the document is large.

XQuery Transformation:

§ XQuery mapper may be more productive (faster) to use than coding a sequence of low level actions.

§ An XQuery subroutine may be less efficient than using the low level built in transformation actions such as Rename, Delete, etc

Recommendation: Use whatever tooling you are comfortable with. If performance is an issue use action level performance metrics to identify the actions to refactor.

If the document is small doing a dozen update actions instead of a single Assign might be more expensive.
Batch file processing: For large but low priority jobs that arrive over immediate transports like HTTP, consider configuring an HTTP proxy to accept incoming documents and publish them to a local directory using a file-based business service. Separately configure a file-based proxy that polls the directory after-hours and processes the files.
The default (unconditional) routing configuration has the best performance as the message is streamed without interruption.
Users with console write access should never share a userid because console sessions are managed per userid. For example, if two users that use the same userid make changes in the console, each could affect the changes the other is making.

ALSB service bus leverages the High Availability features of Weblogic service. The service bus uses the same cluster configuration and provides high availability through the cluster configuration.

In addition one may configure the services on the bus using high availability option so that the service may be exposed in multiple URIs and if one is not available the others will be accessed automatically. Finally, data dependent routing feature of the service bus will help users to route the messages to various end points achieving high availability.

If a proxy service is of type Any SOAP or Any XML, you can use a stage action to determine what the message type is, and use a conditional branching node in the flow to separate processing for each message type received.

Conditional branching can be used to expose the routing alternatives at the top level flow view. For example if you invoke service A or service B based on a condition, instead of configuring this conditional branching within the route node, you can expose or highlight this branching in the message flow itself, and use simple route nodes as the subflows for each of the branches. This is a style decision that you must make. Note that the approach of configuring the route node within each of the branches can get awkward if the fanout of messages from the branch is large.

A single stage in a pipeline is often sufficient for most use cases you configure. However there are cases for which you might consider multiple stages.

§ Multiple stages provide a natural modularity compared to configuring all the actions in a single stage.

§ Each stage in a request or response pipeline can have a separate error handling pipeline. If you design your pipeline with multiple stages, you can avoid writing a single error handler that must handle all errors by all actions in a single stage.

§ If you use the resume action (in an error handler) or the skip action, the behaviour is to resume processing at the next stage in the request or response pipeline. Therefore, depending on the logic you want to enforce, it can be a good design principle to put actions subsequent to a resume or skip action in subsequent stages.

Tuesday, June 9, 2015

List Of XQuery functions supported by OSB

NAMESPACES
------------------------------------------------------------------------
xml=http://www.w3.org/XML/1998/namespace
fn=http://www.w3.org/2004/07/xpath-functions
op=http://www.w3.org/2004/07/xpath-operators
err=http://www.w3.org/2004/07/xqt-errors
fn-bea=http://www.bea.com/xquery/xquery-functions
op-bea=http://www.bea.com/xquery/xquery-operators
dt-bea=http://www.bea.com/xquery/xquery-datatypes
var-bea=http://www.bea.com/xquery/xquery-variables
xf-aug02=http://www.w3.org/2002/08/xquery-function
op-aug02=http://www.w3.org/2002/08/xquery-operators
xs=http://www.w3.org/2001/XMLSchema
xsd=http://www.w3.org/2001/XMLSchema
xdt=http://www.w3.org/2004/07/xpath-datatypes
local=http://www.w3.org/2004/07/xquery-local-functions
declare default function namespace "http://www.w3.org/2004/07/xpath-functions



XQUERY FUNCTIONS
------------------------------------------------------------------------
fn:node-name($arg as node()?) as xs:QName?
fn:nilled($arg as node()?) as xs:boolean?
fn:string($arg as item()?) as xs:string
fn:data($arg as item()*) as xdt:anyAtomicType*
fn:base-uri() as xs:anyURI?
fn:base-uri($arg as node()?) as xs:anyURI?
fn:document-uri($arg as node()?) as xs:anyURI?
fn:error() as none
fn:error($error as xs:QName) as none
fn:error($error as xs:QName?, $description as xs:string) as none
fn:error($error as xs:QName?, $description as xs:string, $error-object as item()*) as none
fn-bea:inlinedXML($arg as xs:string) as node()*
fn-bea:serialize($arg as item()*) as xs:string
xs:string($arg as xdt:anyAtomicType?) as xs:string?
xs:boolean($arg as xdt:anyAtomicType?) as xs:boolean?
xs:decimal($arg as xdt:anyAtomicType?) as xs:decimal?
xs:float($arg as xdt:anyAtomicType?) as xs:float?
xs:double($arg as xdt:anyAtomicType?) as xs:double?
xs:long($arg as xdt:anyAtomicType?) as xs:long?
xs:unsignedLong($arg as xdt:anyAtomicType?) as xs:unsignedLong?
xs:int($arg as xdt:anyAtomicType?) as xs:int?
xs:unsignedInt($arg as xdt:anyAtomicType?) as xs:unsignedInt?
xs:short($arg as xdt:anyAtomicType?) as xs:short?
xs:unsignedShort($arg as xdt:anyAtomicType?) as xs:unsignedShort?
xs:byte($arg as xdt:anyAtomicType?) as xs:byte?
xs:unsignedByte($arg as xdt:anyAtomicType?) as xs:unsignedByte?
xs:integer($arg as xdt:anyAtomicType?) as xs:integer?
xs:positiveInteger($arg as xdt:anyAtomicType?) as xs:positiveInteger?
xs:nonPositiveInteger($arg as xdt:anyAtomicType?) as xs:nonPositiveInteger?
xs:negativeInteger($arg as xdt:anyAtomicType?) as xs:negativeInteger?
xs:nonNegativeInteger($arg as xdt:anyAtomicType?) as xs:nonNegativeInteger?
xs:anyURI($arg as xdt:anyAtomicType?) as xs:anyURI?
xs:QName($arg as xs:string?) as xs:QName?
xs:Name($arg as xdt:anyAtomicType?) as xs:Name?
xs:NCName($arg as xdt:anyAtomicType?) as xs:NCName?
xs:duration($arg as xdt:anyAtomicType?) as xs:duration?
xs:dateTime($arg as xdt:anyAtomicType?) as xs:dateTime?
xs:date($arg as xdt:anyAtomicType?) as xs:date?
xs:time($arg as xdt:anyAtomicType?) as xs:time?
xs:gYearMonth($arg as xdt:anyAtomicType?) as xs:gYearMonth?
xs:gYear($arg as xdt:anyAtomicType?) as xs:gYear?
xs:gMonthDay($arg as xdt:anyAtomicType?) as xs:gMonthDay?
xs:gMonth($arg as xdt:anyAtomicType?) as xs:gMonth?
xs:gDay($arg as xdt:anyAtomicType?) as xs:gDay?
xdt:yearMonthDuration($arg as xdt:anyAtomicType?) as xdt:yearMonthDuration?
xdt:dayTimeDuration($arg as xdt:anyAtomicType?) as xdt:dayTimeDuration?
xs:normalizedString($arg as xdt:anyAtomicType?) as xs:normalizedString?
xs:hexBinary($arg as xdt:anyAtomicType?) as xs:hexBinary?
xs:base64Binary($arg as xdt:anyAtomicType?) as xs:base64Binary?
xdt:untypedAtomic($arg as xdt:anyAtomicType?) as xdt:untypedAtomic?
xs:token($arg as xdt:anyAtomicType?) as xs:token?
xs:language($arg as xdt:anyAtomicType?) as xs:language?
xs:NMTOKEN($arg as xdt:anyAtomicType?) as xs:NMTOKEN?
xs:ID($arg as xdt:anyAtomicType?) as xs:ID?
xs:IDREF($arg as xdt:anyAtomicType?) as xs:IDREF?
xs:ENTITY($arg as xdt:anyAtomicType?) as xs:ENTITY?
fn:abs($arg as numeric?) as numeric?
fn:ceiling($arg as numeric?) as numeric?
fn:floor($arg as numeric?) as numeric?
fn:round($arg as numeric?) as numeric?
fn:round-half-to-even($arg as numeric?) as numeric?
fn:round-half-to-even($arg as numeric?, $precision as xs:integer) as numeric?
fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?) as xs:integer?
fn:compare($comparand1 as xs:string?, $comparand2 as xs:string?, $collation as xs:string) as xs:integer?
fn:concat($arg1 as xdt:anyAtomicType?, $arg2 as xdt:anyAtomicType?, ...) as xs:string
fn:string-join($arg1 as xs:string*, $arg2 as xs:string) as xs:string
fn-bea:trim($string as xs:string) as xs:string
fn-bea:trim-left($string as xs:string) as xs:string
fn-bea:trim-right($string as xs:string) as xs:string
fn:substring($sourceString as xs:string?, $startingLoc as xs:double) as xs:string
fn:substring($sourceString as xs:string?, $startingLoc as xs:double, $length as xs:double) as xs:string
fn:string-length($arg as xs:string?) as xs:integer
fn:normalize-space($arg as xs:string?) as xs:string
fn:normalize-unicode($arg as xs:string?) as xs:string
fn:normalize-unicode($arg as xs:string?, $normalizationForm as xs:string) as xs:string
fn:upper-case($arg as xs:string?) as xs:string
fn:lower-case($arg as xs:string?) as xs:string
fn:translate($arg as xs:string?, $mapString as xs:string, $transString as xs:string) as xs:string
fn:escape-uri($uri-part as xs:string?, $escape-reserved as xs:boolean) as xs:string
fn-bea:format-number($number as xs:double, $pattern as xs:string) as xs:string
fn:contains($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:contains($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:starts-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?) as xs:boolean
fn:ends-with($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:boolean
fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
fn:substring-before($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?) as xs:string
fn:substring-after($arg1 as xs:string?, $arg2 as xs:string?, $collation as xs:string) as xs:string
fn:matches($input as xs:string?, $pattern as xs:string) as xs:boolean
fn:matches($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:boolean
fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string) as xs:string
fn:replace($input as xs:string?, $pattern as xs:string, $replacement as xs:string, $flags as xs:string) as xs:string
fn:tokenize($input as xs:string?, $pattern as xs:string) as xs:string?
fn:tokenize($input as xs:string?, $pattern as xs:string, $flags as xs:string) as xs:string?
fn:codepoints-to-string($arg as xs:integer*) as xs:string
fn:string-to-codepoints($arg as xs:string?) as xs:integer*
fn:resolve-uri($relative as xs:string?) as xs:anyURI?
fn:resolve-uri($relative as xs:string?, $base as xs:string) as xs:anyURI?
fn:true() as xs:boolean
fn:false() as xs:boolean
fn:not($arg as item()*) as xs:boolean
fn:years-from-duration($arg as xdt:yearMonthDuration?) as xs:integer?
fn:months-from-duration($arg as xdt:yearMonthDuration?) as xs:integer?
fn:days-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:hours-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:minutes-from-duration($arg as xdt:dayTimeDuration?) as xs:integer?
fn:seconds-from-duration($arg as xdt:dayTimeDuration?) as xs:decimal?
fn:year-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:hours-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?
fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal?
fn:year-from-date($arg as xs:date?) as xs:integer?
fn:month-from-date($arg as xs:date?) as xs:integer?
fn:day-from-date($arg as xs:date?) as xs:integer?
fn:hours-from-time($arg as xs:time?) as xs:integer?
fn:minutes-from-time($arg as xs:time?) as xs:integer?
fn:seconds-from-time($arg as xs:time?) as xs:decimal?
fn:timezone-from-time($arg as xs:time?) as xdt:dayTimeDuration?
fn:timezone-from-date($arg as xs:date?) as xdt:dayTimeDuration?
fn:timezone-from-dateTime($arg as xs:dateTime?) as xdt:dayTimeDuration?
fn:adjust-dateTime-to-timezone($arg as xs:dateTime?) as xs:dateTime?
fn:adjust-dateTime-to-timezone($arg as xs:dateTime?, $timezone as xdt:dayTimeDuration?) as xs:dateTime?
fn:adjust-date-to-timezone($arg as xs:date?) as xs:date?
fn:adjust-date-to-timezone($arg as xs:date?, $timezone as xdt:dayTimeDuration?) as xs:date?
fn:adjust-time-to-timezone($arg as xs:time?) as xs:time?
fn:adjust-time-to-timezone($arg as xs:time?, $timezone as xdt:dayTimeDuration?) as xs:time?
fn-bea:add-timezone-to-dateTime($arg as xs:dateTime) as xs:dateTime
fn-bea:add-timezone-to-dateTime($arg as xs:dateTime, $duration as xs:dayTimeDuration) as xs:dateTime
fn-bea:remove-timezone-from-dateTime($arg as xs:dateTime) as xs:dateTime
fn-bea:remove-timezone-from-dateTime($arg as xs:dateTime, $duration as xs:dayTimeDuration) as xs:dateTime
fn-bea:add-timezone-to-date($arg as xs:date) as xs:date
fn-bea:add-timezone-to-date($arg as xs:date, $duration as xs:dayTimeDuration) as xs:date
fn-bea:add-timezone-to-time($arg as xs:time) as xs:time
fn-bea:add-timezone-to-time($arg as xs:time, $duration as xs:dayTimeDuration) as xs:time
fn-bea:remove-timezone-from-time($arg as xs:time) as xs:time
fn-bea:remove-timezone-from-time($arg as xs:time, $duration as xs:dayTimeDuration) as xs:time
fn:resolve-QName($qname as xs:string?, $element as element()) as xs:QName?
fn:expanded-QName($paramURI as xs:string?, $paramQName as xs:string) as xs:QName
fn:local-name-from-QName($arg as xs:QName?) as xs:NCNAME?
fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
fn:namespace-uri-for-prefix($prefix as xs:string, $element as element()) as xs:anyURI?
fn:in-scope-prefixes($element as element()) as xs:string*
fn:name($arg as node()?) as xs:string
fn:local-name($arg as node()?) as xs:string
fn:namespace-uri($arg as node()?) as xs:anyURI
fn:number($arg as xdt:anyAtomicType?) as xs:double
fn:lang($testlang as xs:string?, $node as node()) as xs:boolean
fn:root($arg as node()?) as node()?
fn:boolean($arg as item()*) as xs:boolean
op:concatenate($seq1 as item()*, $seq2 as item()*) as item()*
fn:index-of($seqParam as xdt:anyAtomicType*, $srchParam as xdt:anyAtomicType) as xs:integer*
fn:index-of($seqParam as xdt:anyAtomicType*, $srchParam as xdt:anyAtomicType, $collation as xs:string) as xs:integer*
fn:empty($arg as item()*) as xs:boolean
fn:exists($arg as item()*) as xs:boolean
fn:distinct-values($arg as xdt:anyAtomicType*) as xdt:anyAtomicType*
fn:distinct-values($arg as xdt:anyAtomicType*, $collation as xs:string) as xdt:anyAtomicType*
fn:insert-before($target as item()*, $position as xs:integer, $inserts as item()*) as item()*
fn:remove($target as item()*, $position as xs:integer) as item()*
fn:reverse($arg as item()*) as item()*
fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double) as item()*
fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()*
fn:zero-or-one($arg as item()*) as item()?
fn:one-or-more($arg as item()*) as item()+
fn:exactly-one($arg as item()*) as item()
fn:deep-equal($parameter1 as item()*, $parameter2 as item()*) as xs:boolean
fn:deep-equal($parameter1 as item()*, $parameter2 as item()*, $collation as string) as xs:boolean
fn:count($arg as item()*) as xs:integer
fn:avg($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:max($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:max($arg as xdt:anyAtomicType*, $collation as string) as xdt:anyAtomicType?
fn:min($arg as xdt:anyAtomicType*) as xdt:anyAtomicType?
fn:min($arg as xdt:anyAtomicType*, $collation as string) as xdt:anyAtomicType?
fn:sum($arg as xdt:anyAtomicType*) as xdt:anyAtomicType
fn:sum($arg as xdt:anyAtomicType*, $zero as xdt:anyAtomicType?) as xdt:anyAtomicType?
fn-bea:integer-sequence($seq as node()*) as integer*
fn:doc($uri as xs:string?) as document-node()?
fn:position() as xs:integer
fn:last() as xs:integer
fn:current-dateTime() as xs:dateTime
fn:current-date() as xs:date
fn:current-time() as xs:time
fn:implicit-timezone() as xdt:dayTimeDuration
fn:default-collation() as xs:string
fn-bea:execute-sql($datasource as xs:string, $rowElemName as xdt:anyAtomicType, $sql as xs:string, $params...) as element()*

Wednesday, June 3, 2015

Adding Java Libraries to Oracle JDeveloper 11g

Oracle JDeveloper includes a rich set of Java libraries for developing Java applications. However you will find that you will need to add libraries that are not included or you may want to try updated libraries of those included in JDeveloper.

This document will detail the steps to add the Oracle TimesTen In-Memory Database 11g JDBC drivers to JDeveloper.
Under the Tools menu you will find Manage Libraries…
The Manage Libraries dialog is where you can add Libraries, Java SE versions and JSP Tag Libraries. For this document we will be adding a Library. Click the New… button to add a library.
On the Create Library dialog add a display name for the library in the Library Name field. The Location drop down only has the value of User. If you were performing these steps in the context of a project the drop down would have Project and User.
To add the jar file for the Oracle TimesTen JDBC driver select the Class Path node and click the Add Entry… button.
A file browser dialog box will appear. Browse to the location of the jar file. Once you get to the location be sure to select the actual jar file. After selecting the jar file click the Select button to close this dialog.
If the library added includes source you can add the source file or URL to the source in the Source Path node. The same can be done for the Documentation.
Now with the Oracle TimesTen 11gR1 JDBC library added it can be added to any project that might need it.
These same steps can be done in the context of a project. When done in a project you can limit the accessibility of the library to only the project in which it is defined.

Setup MetaData Store (MDS) for Weblogic 11g in Jdeveloper

SOA Suite 11g has a provision for sharing SOA artifacts through MDS – Meta Data Store. This facilitates greater re-use of SOA artifacts such as XML Schemas, EBMs, WSDLs, Fault Policies, Rule repositories and Service Data Objects (SDOs) among others. MDS can be file-based or database-based. Here are the steps to create and use Databased and file-based MDS in JDeveloper.
MDS is created under <jdeveloper-home>/integration/seed directory. Default folder “soa” is used to store common system soa artifacts. All custom artifacts are supposed to be stored under a folder called “apps”, since this folder already exists in server.
Create directory structure under apps folder. In my case, I’ve created folder structure ../apps/cosdeaia/ApplicationConnectorServiceLibrary to store XML schema files. This ideally should match your schema structure.
1. First you go to your local 11g Jdeveloper installation folder. In my case it isC:\JDEV_HOME11.1.1.3\jdeveloper\integration\ folder (if you have already applied third party plugin patch provided by oracle then you will see seed folder by default with all previous configuration done). If not create a seed folder under integration folder.
2. Now create folder with name apps under seed (remember to create folder with name apps else you might face issue this oracle documents say i didn’t try out).
3. Under apps you can create your folder structure to place all your XSD, WSDL files.
4. We can create a SOA_MDS connection in Jdeveloper as below –
New  Connections — > SOA-MDS Connection
5. The SOA-MDS connection can be created in two ways. One is File Based MDS and other is Data Based MDS.
MDS Setup
6. In Create SOA_MDS Connection window, select File Based MDS as Connection              Type for file based MDS connection, we will point to the local folder in our system               where all the WSDL and XSD files are placed as shown below. So when we use the wsdl         and xsd files in the  project, they will be referred from the local system.
MDS Setup
7. Click OK. Now the File Based MDS connection is created.
8. Lets see how to create DB based MDS connection. In Create SOA_MDS Connection window, select DB Based MDS as Connection Type for file based MDS connection.
9. For DB Based MDS connection, we should have created all the schema for the weblogic in the database by running the Repository Creation Utility (RCU) wizard. After RCU execution, the DEV_MDS schema will get created in the database. We need to use the DEV_MDS schema connection and soa-infra as MDS Partition while creating the DB Based MDS connection as shown in the above screen shot.
10. Click OK. Now the DB Based MDS connection is created.
11. So when we use the wsdl and xsd files in the project, they will be referred from the local system. But when we deploy the application into Weblogic server, the wsdl and xsd file references will be missing. To avoid this we need to use an Ant script and import all the WSDL and XSD files into Weblogic server.
12. You use common sca tool (common-sca-tools.xml) to do it and use Ant target nameimportCommonServiceArtifactsIntoMds from class files provided by oracle (MDSImportTask).
13. So whenever we made modifications or additions to the WSDL or XSD files, we need to update the Weblogic server. While update, by using an Ant script first delete all the files from Weblogic server and execute re-import Ant script the latest files into Weblogic server.
14. After Import into Weblogic server, you can use the wsdl and xsd files in your project by referring to the Weblogic server through SOA-MDS (Data Based MDS) connection type.But never Copy these files into your project while referring from Weblogic serverBy copying this creates a mess in run time. For example while working you do some modifications in the local WSDL and XSD files and you will forgot to update these changes in to Weblogic server.
15. Whenever we refer the WSDL or XSD files from SOA-MDS (Data Based MDS) connection type, the location URL looks like oramds:/apps/cosdeaia/… (In my case the cosdeaia folder contains all my files…)
16. The new connection appears under the “Resource Pallette” window on right side of the Jdeveloper as shown below
Now you have created the MDS connection in Jdeveloper. You can use in in your SOA Composites.