Thursday, March 29, 2012

Managed Weblogic Server as a Windows Service

Create a cmd file using the text below,
change the settings to suit your environment.

-----------------------------------------------------
echo off
SETLOCAL

set DOMAIN_NAME=niall_domain
set USERDOMAIN_HOME=D:\Work\envs\WLS11g\user_projects\domains\niall_domain
set SERVER_NAME=mgd_1
set PRODUCTION_MODE=false

set WL_HOME=D:\Work\envs\WLS11g\wlserver_10.3
set WLS_USER=weblogic
set WLS_PW=welcome1

set ADMIN_URL=http://localhost:7001

set MEM_ARGS=-Xms40m -Xmx250m

call %WL_HOME%\server\bin\installSvc.cmd

-------------------------------------------------------
This will install your managed server as a windows service.

Complete example from me is available HERE

Tuesday, March 20, 2012

Wednesday, March 14, 2012

Installing SOA Suite Health Care Integration on Win7 64 bit



Excellent supplement to SOA Suite PS5.



To quote
"Oracle SOA Suite for healthcare integration helps healthcare entities (payer and providers) to securely exchange HL7 and HIPAA standard documents. It utilizes several features of SOA Suite to design, create and manage applications that process healthcare standard documents."

I installed Health Care Integration, which is available as a patch from Oracle Support on top of the developer install of SOA/BPM on Windows 7 64 bit.

The software required is as follows -

HealthCare -
http://www.oracle.com/technetwork/middleware/healthcare/downloads/index.html

SOA Suite 11.1.1.6 from OTN or edelivery

Full details
HERE

According to OTN,
To ensure access to the healthcare adapter in JDeveloper, start JDeveloper in preview mode. For example: ./jdev -J"-DPREVIEW_MODE=true" .



Monday, March 5, 2012

Exposing Java via EJB transport on OSB

You have server side Java resources you need to service enable. I have the following Java class I need to expose as a service over OSB.



Now you could simply expose this as a web service ala -



This will generate the required artifacts, WSDL etc. which I can then deploy to WLS. Later I can create a business service based on the WSDL.

Another approach is to wrap the Java in an EJB and call the EJB from OSB.
The broad steps are as follows -

1. JDev: write the EJB wrapper for the business methods you want to expose.
2. JDev: deploy the EJB to WLS
3. JDev: Create a client to test the EJB
4. JDev: Create a client jar
5. JDev: Deploy the client jar to a file

6. OSB: Import the JAR into OSB
7. OSB: Create a new JNDI Provider
8. OSB: Create a new business service based on EJB transport
9. OSB: Specify the business service details -



10. Test the Business Service




Full lab doc HERE!

Thanks to Edwin Biemond's post
http://biemond.blogspot.com/2010/05/jejb-and-ejb30-transport-in-oracle.html

OSB enabling PLSQL packages

Scenario: I want to OSB enable the following plsql



Essentially the same procedure as per the previous post.

Full lab
HERE!

REST enabling DB operations via Oracle Service Bus (OSB)

Scenario - I have a DB table - Patient - and I want to provide a REST interface via OSB to CRUD operations.

A very big thanks to Jeff Davies and his post here -
https://blogs.oracle.com/jeffdavies/entry/restful_services_with_oracle_s_1

The table is defined as follows -

CREATE TABLE PATIENT
(
PAT_ID NUMBER NOT NULL
, PAT_NAME VARCHAR2(20) NOT NULL
, PAT_SURNAME VARCHAR2(20) NOT NULL
, PAT_AGE NUMBER(3) NOT NULL
, PAT_SEX VARCHAR2(1) NOT NULL
, PAT_NATIONALITY VARCHAR2(20)
, PAT_COMMENTS VARCHAR2(255)
, CONSTRAINT PATIENT_PK PRIMARY KEY
(
PAT_ID
)
ENABLE
);

Essentially I create 4 services in JDeveloper using the DB adapter to expose SELECT, INSERT, UPDATE and DELETE functionality.



I then import the JCA artifacts into OSB



and generate Business Services from them.

I then create a Proxy that branches on the HTTP Methods - GET (Select), POST(Insert), PUT (Update) and DELETE.



Full lab doc is available
HERE!

Thursday, March 1, 2012

Oracle Enterprise Gateway 11.1.1.6 --> Scripting

A big thank you to MartinM for his input here!

Scenario - I want to find out how long a web service call takes in OEG.



as you can see I have a Scripting filter before and after the WS call.

Pre-filter
---------------


Post Filter
----------------


I test the policy via Service Explorer and view the trace afterwards.



You notice that the script includes a check for response time > 10 secs and sets the boolean response accordingly.

However, we may also want to get the actual response time as a process instance attribute. That is very easily done, just add the following to the 2nd script.
Firstly, define the output variable,



then add the following to the script itself -
msg.put("v_totalTimeMs",totalTimeMs);




You can see I have also added a Trace filter at the end of the process.

Deploy and test