Friday 5 February 2016

Integration using Oracle ICS - Source ( Webservice ) to Target (Webservice)

Lets Start with Oracle ICS

The High Level Steps are :
1. Create Target Connection
2. Create Source Connection
3. Create Integration using Source and Target Connection, Create Mapping.
4. Activate your Integration.

Login to Your ICS account at using your ICS credentials

https://ics-ur-comapany-name.integration.us2.oraclecloud.com/ics/faces/global

Once you have successfully Logged In, Below screen will be shown



Create a Target Connection :


Step 1 :
Click on "Create Connections", You will see next Screen as Below 



Step 2 :
Now Click on 'Create New Connection' at Right Hand Side of Page, This will take you to Connection creation Wizard.



Step 3 :
Select SOAP, since we are creating a connection to Target Service which is a SOAP Web service 

Step 4 :
Provide name of this Connection, then click on Create button



Step 5 :
A screen like below will be visible. 



Step 6 :
Now Click on 'Configure Connectivity'. 



Step 7 :
New screen will ask you for WSDL file. Either upload a WSDL file from your Local machine or Provide a WSDL URL available on web.Then Click OK.


Step 8 :
Now Click on 'Configure Credentials' If you Target service is Secured then Provide Credentials. For this Demo, Target Service is not Secured hence I will choose 'No Security Policy' Then Click on OK.



Step 9 :
Now click on Save .



Step 10 :
Now Click on Test button, to test your target connection. If you have provided all details correctly. You will see a screen as below :



Step 11 :
Now Save all changes, and exit from connection. Your connection to Target is created.
Target Connection Name for this Demo is Demo_Airport_001.
A Screen Similar to below will be shown.


Create a Source Connection :


Now follow Same Step1 to Step 10, to Create a Connection for Source. 
Only with a change at Step 4 - Give Different Name 
E.g Demo_Airport_001_ Source

A screen similar to below should be seen.





Continue reading the Steps of this Post in Part 2 at below location

Integration using Oracle ICS - Source ( Webservice ) to Target (Webservice) Part 2

http://osb-dheeraj.blogspot.in/2016/02/integration-using-oracle-ics-source_17.html

XSLT - Transform Date format (YYYYMMDD to DD-MMM-YYYY)

Date Format Transformation Using XSLT



Sometimes in we may require to Transform date from one format to another format. Because, Source is sending date in a format which target does not accepts.

So here is an simple XSLT code which transforms Date from YYYYMMDD to DD-MMM-YYYY.
Actually this can be modified to suit your needs of any other format as well.

This XSLT can be used in SOA 11g, OSB 11g, SOA 12c, OSB 12c and could be used in any other application which supports XSL transform.

Code Snippet :


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0">
  <xsl:template match="/">
  <Root>
    <Values>            
            
            <Value AttributeID="Description">              
                <xsl:value-of select="/Header/Description"/>              
            </Value>
           
           <xsl:choose>
            <xsl:when test="string-length(/Header/StartDateActive) = 8" >
                 <Value AttributeID="Introduction Date">
                      <xsl:call-template name="date">
                           <xsl:with-param name="yyyymmdd" select="/Header/StartDateActive"/>
                      </xsl:call-template>
                  </Value>
              </xsl:when>
          <xsl:otherwise>
                  <Value AttributeID="Introduction Date"></Value>
              </xsl:otherwise>
          </xsl:choose>    
            

            
     </Values>
    </Root>
  </xsl:template>
  
  <xsl:template name="date">
    <xsl:param name="yyyymmdd"/>
    <xsl:variable name="yyyy" select="substring($yyyymmdd, 1, 4)"/>       
    <xsl:variable name="mm" select="substring($yyyymmdd, 5, 2)"/>
    <xsl:variable name="dd" select="substring($yyyymmdd, 7, 2)"/>
   

  <xsl:value-of select=" concat($dd,'-') "/>
    <xsl:choose>
      <xsl:when test="$mm = '01'">Jan</xsl:when>
      <xsl:when test="$mm = '02'">Feb</xsl:when>
      <xsl:when test="$mm = '03'">Mar</xsl:when>
      <xsl:when test="$mm = '04'">Apr</xsl:when>
      <xsl:when test="$mm = '05'">May</xsl:when>
      <xsl:when test="$mm = '06'">Jun</xsl:when>
      <xsl:when test="$mm = '07'">Jul</xsl:when>
      <xsl:when test="$mm = '08'">Aug</xsl:when>
      <xsl:when test="$mm = '09'">Sep</xsl:when>
      <xsl:when test="$mm = '10'">Oct</xsl:when>
      <xsl:when test="$mm = '11'">Nov</xsl:when>
      <xsl:when test="$mm = '12'">Dec</xsl:when>
    </xsl:choose>
    <xsl:value-of select=" concat ('-', $yyyy) "/>
</xsl:template>

</xsl:stylesheet>



Testing the XSLT :

Input :

<Header>   <Description>My Description</Description>   <StartDateActive>20160206</StartDateActive></Header>

Output :


<Root>

  <Values>
<Value AttributeID="Description">My Description</Value>
<Value AttributeID="Introduction Date">06-FEB-2016</Value>  
  </Values>
</Root>