Wednesday, September 21, 2011

Registering a Web Service with Oracle Enterprise Gateway (OEG)

Simple sanity test for OEG install.

I have created and deployed a simple creditCardValidation service to


The impl is as follows -

package validatecc;

public class ValidateCC {
public ValidateCC() {
public CreditCardValidation validateCard(String cardType, String cardNr){
CreditCardValidation ccv = new CreditCardValidation();

if (cardType.equalsIgnoreCase("AMEX")){

if (cardType.equalsIgnoreCase("VISA")){

return ccv;

package validatecc;

public class CreditCardValidation {
String validFrom;
String validUntil;
String custName;
String status;
int limit;

public CreditCardValidation() {

public void setValidFrom(String validFrom) {
this.validFrom = validFrom;

public String getValidFrom() {
return validFrom;

public void setValidUntil(String validUntil) {
this.validUntil = validUntil;

public String getValidUntil() {
return validUntil;

public void setCustName(String custName) {
this.custName = custName;

public String getCustName() {
return custName;

public void setLimit(int limit) {
this.limit = limit;

public int getLimit() {
return limit;

public void setStatus(String status) {
this.status = status;

public String getStatus() {
return status;

Simple enough!


Start up the Gateway & Policy Studio

Gateway startup --> \OEG\Gateway\enterprisegateway\Win32\bin\enterprisegateway.bat
Policy Studio Startup --> \OEG\PolicyStudio\oegpolicystudio\policystudio.exe

Click on the Edit Active Configuration link
This loads the current Gateway configuration into Policy Studio.

Click on Policies
Click on Register Web Service

This is just a simple pass through example so de-select teh "secure" checkbox.

Check the routing settings

As you can see, this is simple pass-thru processing.

Now deploy the changes from Policy Studio to the Gateway.

Review what has been generated -

Right Click on the Service Handler --> Edit

Click on the Validation tab

Test using Service Explorer

I didn't cover the install of Service Explorer in my "OEG Install" blog post.
It is just a case of unzipping the file - to a directory of your choice.

Start -

You are presented with an empty page - ready for exploring!

Menu --> File --> Load WSDL

Here we load our original WSDL.

Change the Request, adding valid cardType etc.

Click on the drop down list beside the green icon

Change to point to OEG
The default port for OEG is 8080, however I changed this to 8082, as I had a DB service running on 8080.

Validate the response

Monitor the Gateway

Click on View Reports

No comments: