Wednesday, September 18, 2019

SOA 12c ESS - Schedule SOA composite and OSB Proxy Services

Description:
ESS out of the box feature is used to schedule SOA Suite composites and Service Bus proxy services. Composites can be scheduled in two ways. One is to have a composite with a web service interface be executed at the scheduled time by ESS. The second is for a composite with an inbound polling adapter to be scheduled to process messages only between scheduled times. Also Service Bus proxy services with a web service interface can be executed at the scheduled time by ESS. We can schedule Asynchronous/Synchronous/Onaway web services in once, 30 minutes interval, hourly, daily, and weekly and so on.

Below job types are included in the Enterprise Service Scheduler.
  1. Java
  2. Web Service
  3. EJB
  4. PL/SQL
  5. Process job type for executing a command-line command.
Schedule SOA Composite Web Service using ESS:
Here scheduling an Asynchronous SOA Composite per 30 minutes basis. 
We need to setup following 3 steps.
  1. Define the job
  2. Schedule the job
  3. Run the job
First I just created an Asynchronous SOA Composite AsyncESSProject.
WSDL:
http://hostname:8001/soa-infra/services/POC/AsyncESSProject/asyncbpelprocess_client_ep?WSDL

Step1: Define the Job
Go to Target Navigation⇾Scheduling Services⇾ESSAPP
Scheduling Services⇾Job Meta Data ⇾ Job Definitions
Click on create to define new job.
Enter the Job Name and display Name, also choose the Job type. 
AsyncESSTest composite is Asynchronous SOA composite which we need to schedule so we choose “ASyncWebserviceJobType” from drop down.
Note: We can also choose SynchronousWebServiceJobType and OneWayWebServiceType depending on our web service type.

Click on select web service button, this will open the pop-up box. Provide Composite WSDL URL and choose SOA as WebService Type
Provide WSDL URL and click Go button

Note: Here we can see Service Bus option that means we can also schedule Service BUS web Service.

Click on Services and choose port type. Choose Operation and modify the payload content as per your requirement.
Press Ok


Step2: Define the Schedule
Once we defined the job, next step is to define the schedule. To define the schedules go to ESSAPP⇾Job Requests⇾Define Schedules

Click on create to define new schedule.
Click Create button.
Fill schedule name and define frequency of the schedule.
Note: here we can select the scheduling frequency like once, Hourly/Minute/Daily/Weekly etc.
Note: Generally we will not use Use End Date. We will uncheck this option.
Press ok.

Step3: Submit Job Request
Once you define the Job and Schedule, next step is to submit the job request. To submit the job request go to ESSAPP⇾Job Requests⇾Submit Job Requests
Choose the Job which you want to schedule. Choose the job which we defined in first step.


Choose the existing schedule. Choose the schedule which we define is second step.



Scheduling completed for this Service. Now we can see in below screenshot that this scheduler is waiting for 30 minutes to run.

Open the composite instance and we can see that the defined scheduler triggered this service 30 minutes interval.


Schedule OSB Service Web Service using ESS:
Here we are scheduling Synchronous OSB Service Hourly basis.
We need to setup following 3 steps.
  1. Define the job
  2. Schedule the job
  3. Run the job
First I just created a Synchronous OSB Service ESSPOCSBProject.
WSDL:
http://hostname:2001//ESSPOCSBProject/ESSTestHelloWorldProxyService?wsdl

Step1: Define the Job
Target Navigation⇾Scheduling Services⇾ESSAPP
This is the first step that we need to perform when we schedule any job through ESS. To define the job right click on ESSAPP⇾Job Metadata⇾Job Definitions

Click on create to define the new job.

Enter the Job Name and display Name, also choose the Job type. ESSPOCSBProject OSB Service is synchronous SOA composite which we need to schedule so we choose “SyncWebserviceJobType” from drop down.

Click on select web service button, this will open the pop-up box. Provide ESSPOCSBProject WSDL URL and choose Service Bus as Web service Type and press Go button.


Click on Services and choose port type.

Modify the payload content as per your requirement.

Press ok.


Step2: Define the Schedule
Once we defined the job, next step is to define the schedule. To define the schedules go to ESSAPP ⇾Job Requests⇾Define Schedules

Click on create to define new schedule.
Fill schedule name and define frequency of the schedule.
Note: Don’t use End date. Make this field “Use End date” unchecked.
Press OK.

Step3: Submit Job Request
Once you define the Job and Schedule, next step is to submit the job request. To submit the job request go to ESSAPP ⇾Job Requests ⇾Submit Job Requests

Choose the Job which you want to schedule. Choose the job which we defined in first step.
Press Go button
Select the required Job and press ok.

 Choose the existing schedule. Choose the schedule which we define is second step.
Select the Schedule and press ok.


All the three steps completed successfully.

Tuesday, September 17, 2019

12c SOA - Composite, MDS artifacts and configuration plan deploy using WLST

Here I will show you how to deploy Composite, MDS artifacts and configuration plan components to SOA server using WLST script and a python file.

Step1: Create SAR files of your SOA projects from Jdeveloper




Step2: Create config plan file from Jdevloper tool. Click here create-configuration-plan for steps to generate the config plan.
Step3: Create a apps zip folder containing all the artifacts to be deployed in a proper folder structure.
For instance, here i will deploy a dvm file kept in this structure apps/soa/dvm/Country.dvm.
Step4: Create a deploy.py file to execute the commands to deploy

#First it will connect to the server
connect('user','password','t3://host:7001')

#Import the artifacts to MDS
importMetadata(application='soa-infra',server='soa_server1',
               fromLocation='/soashare/wlsttest',
               docs='/apps/**')

#Deploy composite without config plan    
sca_deployComposite("http://host:8001", "/soashare/wlsttest/sca_EMPProviderProject.jar",
user="weblogic",password="password",partition ="POC",forceDefault=true, 
overwrite=false) 

#Deploy composite with config plan
sca_deployComposite("http://uadcd-elmweb01:8001", "/soashare/wlsttest/sca_DVMTestProject.jar",
user="weblogic",password="password",partition ="POC",forceDefault=true, 
overwrite=false,
configplan="/soashare/wlsttest/DVMTestProject_cfgplan.xml") 

Step5: Place all the SAR, Config.plan and DVM or other artifacts in unix/aix box directory.
Step6: Unzip the apps.zip folder executing the command (unzip apps.zip)
Step7: Go to Oracle_SOA_Home/oracle_common/common/bin and run the deploy.py file

cd /app/Oracle/Middleware/Oracle_Home/oracle_common/common/bin
.wlst.sh /soashare/wlsttest/deploy.py





12c SOA - Use of Configuration plan

Introduction:
  • A configuration plan is an XML file which help you to modify environment-specific values, such as JDBC connection strings, host names of various servers, and etc. on SOA composite deployment time.
  • Practically, the configuration plan contains a set of search and replace rules, that help you to edit host names, JNDI Names, composite properties etc, for services exposed and references consumed in your SOA composite.
  • For each specific environment and composite, there should have one configuration plan.
Create Configuration plan:
Open JDeveloper⇾In the application pane, find your SOA project and right click on the composite.xml⇾Click on Generate Config Plan.
Now that you have created the configuration plan, it should appear under the Resources folder.



Modify Configuration Plan:
Now modify the created config plan as per the environment to be deployed.

Below you will find sections that edit a service exposed and service consumed:
Serviced exposed:
      <service name="dvmtestbpelprocess_client_ep">
         <binding type="ws">
            <attribute name="port">  <replace>http://xmlns.oracle.com/SOAApplication/DVMTestProject/DVMTestBPELProcess#wsdl.endpoint(dvmtestbpelprocess_client_ep/DVMTestBPELProcess_pt)</replace>
            </attribute>
         </binding>
      </service>
Service Consumed:
      <reference name="ProviderEMPService">
         <!--Add search and replace rules for the binding properties-->
         <binding type="ws">
            <attribute name="port">
<replace>http://xmlns.oracle.com/SOAApplication/EMPProviderProject/ProviderBPELProcess#wsdl.endpoint(providerbpelprocess_client_ep/ProviderBPELProcess_pt)</replace>
            </attribute>
            <attribute name="location">
               <replace>http://hostname:8001/soa-infra/services/POC/EMPProviderProject/providerbpelprocess_client_ep?WSDL</replace>
            </attribute>
            <property name="weblogic.wsee.wsat.transaction.flowOption">
               <replace>WSDLDriven</replace>
            </property>
         </binding>
      </reference>

You can modify the <replace> tag values with the desired values and those will be applied to your composite as post deploy changes.

Here is another important section at last part of the config plan where you can search and replace the host-names and different attributes.

   <wsdlAndSchema name="Schemas/Employee.xsd|WSDLs/DVMTestBPELProcess.wsdl">
       <searchReplace>
         <search>http://DEV_HostName</search>
         <replace>http://QA_HostName</replace>
      </searchReplace>
      <searchReplace>
         <search>...</search>
         <replace>...</replace>
      </searchReplace>
   </wsdlAndSchema>

Deploy the config plan:
There are several ways you can deploy the config plan while deploying the composites to server:
  1. Deploy the config plan from EM console
  2. Deploy from Jdeveloper connecting the integrated app server
  3. Deploy using WLST or ant script files.
Click here composite-deploy-with-config-plan  to deploy config plan file using WLST

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...