Friday, September 30, 2011

Cobol on the Bus Part 3

This time I have a somewhat more complex payload -

01 XXX.
05 XXX-STRUCT.
10 XXX-USER PIC X(04).
10 XXX-CODE PIC 9(08).

05 YYY-TAB.
07 YYY-DETAIL OCCURS 2 TIMES.
10 YYY-A PIC X(01).
10 YYY-B PIC S9(16)v9(2).
10 YYY-C PIC S9(16)v9(2).
10 YYY-D PIC S9(16)v9(2).
10 YYY-E PIC S9(3)v99.
05 YYY-END PIC 9(04).

I create a new OSB project in OEPE and import this copybook via MFL.






Test




Normally one would generate the non-XML data first -




and lo and behold - we get the following error.



The error - Too many digits - is understandable once we do the following -

Generate XML data






yyy-e has been defined as PIC S9(3)v99 e.g. 433.30
The generated XML value is 4333

Change this to 433.3 (the 2 occurances) and transform xml to non-xml






I change the non-xml value of user and click transform
Now I get the error -



yyy-b is defined as follows -
YYY-B PIC S9(16)v9(2).


MFL wise - It is defined as follows -




Change it (and the other signed fields) as follows -



Re-test - Generate XML

Change yyy-e values to include decimal point.



Transform XML to non-XML

Change the xxx-user value and Transform non-XML to XML



Naturally all these settings are contingent on the Mainframe sending the Cobol on to the bus. This could be over TCP-IP so you could use the Socket adapter, or maybe MQ is being used. Also one needs test data from the mainframe to see how the sign is being handled etc.

However, in the context of a POC...

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

http://localhost:7001/ValidateCC/ValidateCCPort?WSDL

The impl is as follows -

package validatecc;

public class ValidateCC {
public ValidateCC() {
super();
}
public CreditCardValidation validateCard(String cardType, String cardNr){
CreditCardValidation ccv = new CreditCardValidation();
ccv.setStatus("INVALID");

if (cardType.equalsIgnoreCase("AMEX")){
ccv.setValidFrom("20110101");
ccv.setValidUntil("20150101");
ccv.setCustName("NiallC");
ccv.setLimit(10000);
ccv.setStatus("VALID");

}
if (cardType.equalsIgnoreCase("VISA")){
ccv.setValidFrom("20070101");
ccv.setValidUntil("20110101");
ccv.setCustName("NiallC");
ccv.setLimit(7000);
ccv.setStatus("VALID");

}
return ccv;
}
}

package validatecc;

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

public CreditCardValidation() {
super();
}

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!

Steps

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 - Oracle_Enterprise_Gateway_11_1_1_5_0_Win32_Service_Explorer.zip 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
http://8082/ValidateCC/ValidateCCPort
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





admin/changeme
Click on View Reports

Friday, September 16, 2011

Installing/Configuring Oracle Enterprise Gateway on Windows

The software is available on OTN, just click on the download link at -
http://www.oracle.com/technetwork/middleware/id-mgmt/oeg-300773.html

Then simply follow my doc -

https://docs.google.com/leaf?id=1D0Z0KfgFdvqGHIcpG_7B32mWImGGCRkWhO882KyRVJFYAx94QK9yf6vVTjQP&hl=en

Wednesday, September 14, 2011

OEG - Oracle Enterprise Gateway

I'm currently in Santa Clara skilling up on OEG, which can secure access to your services etc. from the outside world. It works in conjunction with WSM. Think of it as taking care of security in the DMZ, working in concert with WSM which takes care of the last mile security.

To quote from OTN -

Oracle Enterprise Gateway provides DMZ-class security and a comprehensive threat defense system at the service perimeter to SOA and Cloud environments, thus providing critical protection needed between un-trusted and trusted zones.


A very compelling addition to our stack -

So I strongly suggest you check out the many resources available on OTN -
http://www.oracle.com/technetwork/middleware/id-mgmt/oeg-300773.html