Showing posts with label OSB. Show all posts
Showing posts with label OSB. Show all posts

Sunday, April 19, 2020

Oracle Service Bus 12C REST Example from Scratch – PART 2

In the previous part we understood how to set up OSB environment. In this Demo I will explain how to create a REST OSB Proxy Service and Business Service.

Now as the JDEVELOPER Studio Edition Version 12.2.1.4.0 and OSB Version 12.2.1.4.0 has been setup, I will first create a Business Service. For this DEMO I am not using any WADL, instead I will try to consume a REST API already available – http://dummy.restapiexample.com/create

 Step1: Click FileàNew ApplicationàService Bus TieràService Bus Application with Service Bus Project (I have provide the name of Application as Practice and Project as RestDemo)



Step2: Open the composite. Drag the REST Adapter to the External Services. Give name as DummyRESTBS. Follow the screenshots below





Step3: Generate a pipeline to connect to BusinessService. From the image above you can find a WADL was already generated by OSB while creating the Business Service. Follow the steps below and ensure that the pipeline is exposed as a Proxy Service














Step4: Connect Pipeline with the BusinessService











Step5: Right Click on the ProxyService and click RUN. This will open the Test Console for the proxy in the OSB integrated server. From the API the following use the below payload for testing
{"name":"test","salary":"123","age":"23"}



Thursday, March 26, 2020

Oracle Service Bus 12C REST Example from Scratch – PART 1


SETTING UP LOCAL OSB 12C ENVIRONMENT VIA JDEVELOPER INSTALLATION
Step 1: Download SOA Suite from here
Step 2: Download Java SE Development Kit 8u241 from here
Step 3: Install Java
Step 4: Run cmd as Administrator
à cd to Jdk bin location à C:\Program Files\Java\jdk1.8.0_241\bin>java -jar C:\swdownloads\fmw_12.2.1.4.0_soa_quickstart.jar
Follow instructions and keep clicking Next. Jdeveloper will be installed with SOA SUITE 12C and OSB 12C


Step 5: Follow the sub steps below to Start Integrated Server

  1. Open JDeveloper Console click RUNàClick Start Server Instance
  2. Provide username and password. Keep weblogic and welcome1. Don’t change any port and Click Next
  3. You will start seeing the below messages -  
    #################################################[Waiting for the domain to finish building...]
    [12:35:36 PM] Creating IntegratedWebLogicServer Domain...
    [12:38:11 PM] Extending IntegratedWebLogicServer Domain...
    [12:39:51 PM] Extending IntegratedWebLogicServer Domain...
    [12:41:06 PM] Extending IntegratedWebLogicServer Domain...
    [12:42:55 PM] IntegratedWebLogicServer Domain processing completed successfully.
    *** Using HTTP port 7101 ***
    *** SSL port conflict detected.  The SSL port will be reassigned to port 7104. ***
    C:\Users\dhiresh.kavi\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\DefaultDomain\bin\startWebLogic.cmd
    [Starting IntegratedWebLogicServer.]
    [waiting for the server to complete its initialization...] Depending on the system specifications, you will something like this
    [IntegratedWebLogicServer startup time: 420989 ms.
    [IntegratedWebLogicServer started.]
    **** Due to port conflicts, the server is configured at Listen port 7101, SSL port 7104.]#############
  4. You can open the EM Console using this URL: http://127.0.0.1:7101/em/
    Weblogic Console using this URL: http://127.0.0.1:7101/console/
    Service Bus Console using this URL:
    http://127.0.0.1:7101/servicebus/

Tuesday, February 11, 2020

Create Service Now ticket using OSB 12C


Service Now is a SAS service to support IT Service Management for Helpdesk and workflows. This post will help you create a Service Now incident using OSB using Email. I am using JDEV Studio Edition Version 12.2.1.1.0 for the post.

1.       Step1: Create a Business Service in OSB. Set Transport as ‘email’
a.       Service Type: Any XML
b.       Provide your email to the Endpoint URI (this will be overwritten later)
c.       Once saved, Provide SMTP server to the Email Transport Configuration.

2.       Create a WSDL from the below schema-
<xsd:sequence>
            <element name="to" type="string" minOccurs="1"/>
            <element name="subject" type="string" minOccurs="1"/>
            <element name="from" type="string" minOccurs="1"/>
            <element name="body" type="string" minOccurs="1"/>
            <element name="type" type="string" minOccurs="1"/>
            <element name="cc" type="string" minOccurs="0" nillable="true"/>
            <element name="name" type="string" minOccurs="0" nillable="true"/>
            <element name="content" type="base64Binary" minOccurs="0" nillable="true"/>
   </xsd:sequence>

3.       Create a Proxy using the created WSDL. In the route node call the Business Service created in Step 1. Update the transport headers.


4.       Insert into the attachment, if an attachment is needed to be passed -
<con:attachment xmlns:con="http://www.bea.com/wli/sb/context">
<con:Content-Type>{$body/sen:sendEmailRequest//*[local-name()='type']/text()}</con:Content-Type>
<con:Content-Transfer-Encoding>base64</con:Content-Transfer-Encoding>
<con:body>{$decodedContent}</con:body>
</con:attachment>

5.       Finally changes with respect to service now. Verify with Service Now team the email format and the parameters that needs to be sent to have a Service Now ticket created. You can use the below concat to format the request going to Business Service and this will create ticket using the Email API of Service Now.

//constructing the email. needs to be in this order
concat('^',  $ticket.group   ,
fn:codepoints-to-string(10)  ,
'^',  $ticket.userId     ,
fn:codepoints-to-string(10),
'^',  $ticket.impact    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.affectedci    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.area     ,
 fn:codepoints-to-string(10),
 '^',  $ticket.subarea    ,
 fn:codepoints-to-string(10),
 '^',  $ticket.urgency     ,
 fn:codepoints-to-string(10),
 '^',  $ticket.operatorId     ,
 fn:codepoints-to-string(10),
 '^',  'incident'    ,
 fn:codepoints-to-string(10),
 '^' , $ticket.nonci,
 '^', + $ticket.title  ,
  fn:codepoints-to-string(10), '^',   $ticket.description ,
 fn:codepoints-to-string(10)  )

FBDI Introduction

FBDI  stands for File Based Data Import. It is a pattern provided by Oracle to have the data loaded into Oracle ERP Cloud. Its usually u...