480 Patterns: Implementing Self-Service in an SOA Environment
Example: A-5 Name space mappings
http\://www.ibm.com/websphere/sib/webservices/cell/bus/Service=com.ibm.patterns.delivery
http\://www.ibm.com/websphere/sib/webservices/cell/bus/HomeDeliveryInboundService/Binding=com.i
bm.patterns.delivery
c. Use the process outlined in “Generate the Web service clients” on
page 348 to regenerate the client to use the bus.
7. To test the service, follow these steps:
a. Enable the Web Services Explorer tool, by selecting Windows
Preferences Workbench Capabilities. Enable all the features
listed under Web Services Developer.
b. Create a simple project and a simple folder under it. Unzip the WSDL zip
file, and import it into the folder. Right-click the service WSDL and select
Web Services Test with Web Services Explorer.
8. Install and configure the router mediation application, for the incoming
request for HomeDelivery using the process outlined in 10.7.8, “Configure the
router mediation” on page 350. In this step you will:
a. Install the RoutingMediationsEJBEAR application
b. Define the DeliveryRequestMediation mediation on the bus
c. Mediate the port for the HomeDelivery destination.
9. Install and configure the aggregator mediation application, for the incoming
responses to the for HomeDelivery and BusinessDelivery services using the
process outlined in 10.7.9, “Configure the aggregator mediation” on
page 351. In this step you will:
a. Create two queue destinations on the bus, DeliveryResponseDestination
and TempDestination
b. Install the AggregatorEJBEAR mediation application.
c. Define the DeliveryResponseMediation mediation on the bus.
d. Mediate the DeliveryResponseDestination queue.
10.Save the configuration.
Processor application
If you are going to run with the MailService or JCAModule applications, you will
need to modify Processor.Java to uncomment the lines that activate these calls.
You will find Processor.java in the ProcessorEJB module at
com.ibm.patterns.serialProcess.Processor.java class.
Appendix A. Sample application install summary 481
The lines of code to be uncommented are found in the following three methods in
Example A-6:
Example: A-6 Uncommenting MailService and JCAModule
private void createCustomer() {
//Call to CreditRating application
String creditRating = new
ProcessorWebService().getCreditRating(customerDetails);
if (isCreditSatisfactory(creditRating)) {
//Credit is Satisfactory
//Create customer in CRM and send Acceptance Mail
//Uncomment if you have the JCA service configured
//ProcessorJCA.storeCustomerDetails_CICS(customerDetails);
//Uncomment if you have the Mail service configured
//new MailService().sendActivationMail(customerDetails);
System.out.println("Customer created successfully....");
}
else {
//Credit rating is not satisfactory
//Delete customer from Db2 and send rejection E-mail
deleteCustomerfromDB();
//Uncomment if you have the Mail service configured
//new MailService().sendRejectionEmail(customerDetails);
System.out.println("The customer does not have satisfactory credit
and will not be created...");
}
}
private void deleteCustomer() {
//Uncomment if you have the JCA service configured
//ProcessorJCA.deleteCustomerDetails_CICS(pkey);
deleteCustomerfromDB();
//Uncomment if you have the Mail service configured
//new MailService().sendDeletionEmail(pkey);
System.out.println("Customer deleted successfully...");
}
private void updateCustomer() {
//Uncomment if you have the JCA service configured
//ProcessorJCA.updateCustomerDetails_CICS(pkey);
//Uncomment if you have the Mail service configured
//new MailService().sendUpdationEmail(customerDetails);
System.out.println("Customer details updated successfully...");

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.