Skip to main content

Posts

Showing posts from June, 2018

Dynamic XML element processing & Dynamic JSON generation from XML

xquery version "1.0" encoding "utf-8"; (:: OracleAnnotationVersion "1.0" ::) declare namespace www="http://www.inc.teamshare.gems.com"; (:: import schema at "../Schemas/GemsTeamshareData.xsd" ::) declare namespace pul="http://xmlns.oracle.com/pcbpel/adapter/db/top/Pull_GEMS_INCREMENTAL_DATA"; (:: import schema at "../Schemas/Pull_GEMS_INCREMENTAL_DATA_table.xsd" ::) declare variable $inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::) external; declare variable $TempListExtractData as element() (:: schema-element(www:TeamShareData) ::) external; declare function local:funcJsonteamshare($inputVariable.GemsIncrementalDataCollection as element() (:: schema-element(pul:GemsIncrementalDataCollection) ::),                                          $TempListExtractData as element() (:: schema-element(www:TeamShareData) ::))                        

PFX Certificate key based secured REST API Invocation in OSB with JAVA

Hello, Today we are going to see how we can invoke a REST API which is secured with private key & certificate which requires two way SSL for successful invocation. Before starting development what we need: Certificate.pfx file This PFX file contain a CERTIFICATE AND KEY, which will be used for two way SSL REST API URL like "https://SERVERURL/URL/connect/token" JAVA implementation: We need to use below external JAR's for making HTTP Call. Below is sample JAVA code for same: package com.api.client; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.URL; import java.security.KeyStore; import java.security.SecureRandom; import java.util.logging.Logger; import javax.net.ssl.HttpsURLConn

Oracle SOA XSLT Date difference

Hello everyone, Recently i came up with a requirement where i need to calculate date difference between current date and some old date, For same i wrote a XSLT which will help you to do same. One main thing, You need to use "version="2.0"" version for XSLT because we are going to use some advance functions which are not available in 1.0.  <xsl:template match="/">     <ns0:cacheData>       <ns0:differenceTime>         <xsl:call-template name=" timeDifference ">           <xsl:with-param name="date1" select="xp20:current-dateTime()"/>           <xsl:with-param name="date2" select="/ns0:cacheData/ns0:inserDateTime"/>         </xsl:call-template>       </ns0:differenceTime>     </ns0:cacheData>   </xsl:template>   <xsl:template name=" timeDifference ">     <xsl:param name="date1"/>     <xsl:param n