Saturday, 24 September 2011

SOA10g to SOA11g Migration

Upgrading and Redeploying SOA 10g to SOA11g

This Document provides the step-by-step procedure for upgrading a complex Oracle SOA Suite (SOA) application from Oracle Application Server 10g Release 3 (10.1.3.x) to Oracle Fusion Middleware Release 11 (11.1.1.x).

This procedure is meant to serve as an overall example of the Oracle SOA Suite environment and application upgrade process. Specifically, this appendix contains the following topics:

  1. Verify That the SOA 10g ABC Application and Its External Partners are Up and Running
  2. Install and Upgrade the Oracle Fusion Middleware SOA Suite
  3. Use the Oracle Web Logic Suite Administration Console to Configure Required Resources
  4. Install Oracle JDeveloper 11g
  5. Set Up Connections in Oracle JDeveloper Release 11
  6. Open the SOA 10g ABC Application in Oracle JDeveloper 11g and Migrate the Application Projects.
  7. Compile and Deploy Each of the Application Projects on Oracle Fusion Middleware 11g
  8. Test the SOA 11g ABC Application in Fusion Middleware Control

1: Verify That the SOA ABC Application and Its External Partners are up and Running

Before you can migrate the SOA ABC Application to 11g, you must review the following prerequisites:

* Verify That the SOA ABC Application Is Successfully Deployed on Oracle Application Server 10g Release 3 (10.1.3.4).
* Verify That SOA ABC Application Is Currently Running on Oracle Application Server 10g Release 3 (10.1.3.4)
                * Verify That All External Partners Are Available

1.1: Verify That the SOA ABC Application Is Successfully Deployed on Oracle Application Server 10g Release 3 (10.1.3.4)

Before you can migrate the SOA ABC application to 11g, it is assumed that:
You have already installed and configured Oracle Application Server 10g Release 3
(10.1.3.1.0), and you have applied the 10g Release 3 (10.1.3.4) patch set.
You have already installed and configured Oracle JDeveloper 10g Release 3
(10.1.3.4).
You have downloaded the updated 10g Release 3 (10.1.3.4) version of the SOA
ABC application.


 1.2: Verify That SOA ABC Application Is Currently Running on Oracle Application Server 10g Release 3 (10.1.3.4)

Before you migrate the SOA ABC application to 11g, test the application on 10g Release 3 (10.1.3.4) and make sure that it is functioning properly. This ensures that the database where the SOA ABC Application schemas are installed is up and running and the external services and external partners are up and running.

For example, you should be able to log in to the application, browse the list of products, and place an order. You should also be able to monitor the BPEL processes using the BPEL Worklist Manager.

1.3: Verify That All External Partners Are Available

Before you can upgrade the SOA ABC application to 11g, you must ensure that the external partners (in the form remote Web services) are up and running and available.

Oracle JDeveloper 11g must be able to access these external partners, as well as the Oracle BPEL Process Manager and Oracle Enterprise Service Bus services deployed on 10g; otherwise, it can not properly migrate the projects in your application to 11g. To verify that the required Web services are available, you should review each of the projects in your Oracle SOA Suite applications before you migrate them to 11g. For example, you can review the Oracle BPEL Process Manager configuration files for each project and verify that the Web services URIs referenced in those configuration files are valid and working.

For example, in the SOA ABC application, you can review the contents of the SOAABC project, as follows:

1. Open the SOA Order Booking 10g Release 3 (10.1.3.4) application in Oracle JDeveloper 10g Release 3 (10.1.3).

2. Expand the SOAABC project, and then expand the Integration Content folder.

3. Expand the bpel folder and double-click the bpel.xml file.

4. Inside the bpel.xml file, search for the following entry:
<partnerLinkBinding name="OrderFulfillment">
<property name="wsdlLocation">
http://host.domain:port/esb/wsil/Fulfillment/OrderFulfillment?wsdl
</property>
<property name="preferredBindings">
http://www.oracle.com/esb/
</property>
</partnerLinkBinding>

5. Copy the URL in the wsdlLocation element to your browser and verify that the URL is valid and displays the output.

6. If the Web Services URL do not display correctly, troubleshoot and solve the problem before attempting to migrate the application to 11g. For example, make sure the database where the SOA ABC schemas are
Installed is up and running and that all components of the application have been deployed successfully.

7. Repeat this procedure for the other URLs in the bpel.xml file.

8. Perform a similar test for the WSDL URLs in the other PSR projects:






2. Install and Upgrade the Oracle Fusion Middleware SOA Suite

After you verify that the SOA ABC application is running successfully on your Oracle Application Server 10g Release 3 (10.1.3) environment, you can then install a new Oracle Fusion Middleware 11g nvironment and upgrade the environment. This task includes:

Installing and configuring the Oracle SOA g middle tiers
Suite 11
Upgrading the Oracle SOA Suite schemas to 11g

3. Use the Oracle WebLogic Suite Administration Console to Configure Required Resources

The SOA ABC application requires that a data source and a set of JMS resources be available on the Oracle WebLogic Server managed server where SOA ABC Applciation is deployed. Refer to the following sections for information on how to use the Oracle WebLogic Server Administration Console to create these resources:
1.        Create the SOAABC Data Source
2.        Configure the Db Adapter Application
3.        Create the SOA ABC Application JMS Resources

4. Install Oracle JDeveloper 11g

5. Set Up Connections in Oracle JDeveloper Release 11
In Oracle JDeveloper Release 11 (11.1.1.0.0), you set up connections to the database, to Oracle Application Server. These connections enable you to view the data in the SOAPSR schema, and to deploy the  applications to Oracle Fusion Middleware from JDeveloper. This task includes the following subtasks:

5.1 Start Oracle JDeveloper 11g
5.2 Verify That You Have the Required Oracle JDeveloper Extensions
5.3 Create a Connection to the SOAABC Schema
5.4 Create a Connection to Oracle WebLogic Server

5.1 Start Oracle JDeveloper 11g
To start Oracle JDeveloper Studio on Windows, use any of the following methods:
From your Start Menu, select All Programs, then select Oracle Fusion
Middleware 11.1.1.x.x, and then select Oracle JDeveloper Studio 11.1.1.x.x.
You can also start Oracle JDeveloper from the command line by running one of the
following commands:
install_dir\jdeveloper\jdeveloper.exe
install_dir\jdeveloper\jdev\bin\jdevw.exe
install_dir\jdeveloper\jdev\bin\jdev.exe (to display a console window
for internal diagnostic information)
To start Oracle JDeveloper on UNIX systems, run the file:
install_dir/jdeveloper/jdev/bin/jdev



5.2 Verify That You Have the Required Oracle JDeveloper Extensions

To upgrade your Oracle SOA Suite applications to 11g, you must have the Oracle SOA Composite Editor extension for Oracle JDeveloper 11g.

To verify that the extension is installed, select About from the Oracle JDeveloper Help menu, and click the Version tab. You should see an entry in the list of components called SOA Composite Editor.

If this component does not appear on the Version tab of the About dialog box, close the About dialog and select Check for Updates from the Help menu. Use the Check for Updates wizard to locate and install the latest version of the SOA Composite Editor extension.

5.3: Create a Connection to the SOA ABC Schema
In JDeveloper, create a database connection to the SOAABC schema:

1. In Oracle JDeveloper, select View > Database Navigator.

2. Right-click the IDE Connections node and select New Connection.

3. In the resulting dialog box, enter the following values:
Connection Name: enter SOAABC.
Connection Type: select Oracle (JDBC).
Username: enter SOAABC.
Password: enter soaabc.
Role: leave blank.
Save Password: select the check box.
Enter Custom JDBC URL: clear the check box.
Driver: select thin.
Host Name: enter the name of the machine running the database where you installed the SOADEMO schema.
JDBC Port: enter the port number for the database. The default value is 1521.
SID: enter the system identifier for the database. The default value is ORCL.
If you are unsure about the database connection values, check with your database
administrator.

4. Click Test Connection.
If the test is not successful, check that the database is available and that the connection values are correct.

5. Click Finish. The connection appears below the Database node in the Connection Navigator.

5.4. Create a Connection to Oracle WebLogic Server

In JDeveloper, create a connection to the Oracle WebLogic Server domain where you installed and configured Oracle SOA Suite 11g:

1. In Oracle JDeveloper, select View > Application Server Navigator.

2. Right-click the Application Servers folder under the Application Server node and select New Application Server.

3. Click Next on the Welcome page of the Application Server Connection Wizard.

4. Enter the following values:
Connection Name: enter SoademoApplicationServer.
Connection Type: select WebLogic 10.3.
Click Next.

5. In Step 2, Authentication, enter the following values:
Username: Enter weblogic. This is the name of the default Oracle WebLogic Server administration user.
Password: Enter the password for the weblogic user. This is the password that you set when you configured the Oracle SOA Suite 11g domain.

6. Click Next and enter the host, port, and name of the Oracle WebLogic Server domain you installed and configured in 1.2, Install and Upgrade the Oracle Fusion Middleware SOA Suite".

7. Click Next. The Test Connection page appears.

8. Click Test Connection.

9. Click Finish.
The connection appears below the Application Servers node in the Connection Navigator.

6: Open the SOA ABC Application in Oracle JDeveloper 11g and Migrate the Application Projects.

The following sections describe how you can open an application created in a previous version of Oracle JDeveloper and use the Migration Wizard to upgrade the application to Oracle Fusion Middleware 11g:
Opening and Migrating the Application
Viewing the Migration Log Files

6.1 Opening and Migrating the Application
To open and migrate the application to Oracle JDeveloper 11g:
1. Make a backup copy of the soaabc folder that contains the 10g Release 3 (10.1.3.4) SOA ABC application source files. The contents of the soapsr folder will be modified during the upgrade. The backup copy allows you to restore the original 10g Release 3 (10.1.3) version of the demo if necessary. Note that for this procedure, the working folder (the folder containing the files you will upgrade) is referred to as the SOAABC_HOME directory.
2. Review the contents of the SOAABC_HOME directory and remove the following file if it exists:

SOAABC_HOME/SOAABC/bpel/rules/com This includes the subdirectories under the bpel/rules/com/ directory.

3. Select Open from the File menu and select the Oracle JDeveloper 10g Release 3 (10.1.3.1.0) soapsr.jws file. Oracle JDeveloper displays Step 1, the Welcome page, of the Migration Wizard. Click Next.

Important: The SOA ABC application and its projects rely
upon external partners. These remote Web services must be up and
running and available to the SOA ABC application before
you migrate the application to Oracle Fusion Middleware 11g.
You cannot successfully open the application in Oracle JDeveloper 11g
if the external partner URI’s are not available. For more information,
see Task 1: Verify That the SOA ABC and Its External
Partners are Up and Running.

4. In Step 2 , select Yes to migrate the project files to Oracle JDeveloper Release 11 (11.1.1.0.0). Click Next.

5. In Step 3, clear the Migrate to Webapp 2.5 and Convert JSTL 1.0/1.1 to 1.2.
Click Next.

Note: Clearing the Migrate to WebApp 2.5 check box is important because the SOA Order Booking demo application uses Web services that you will upgrade manually later in this procedure. To be sure the
Migration wizard does not attempt to upgrade these automatically, be sure to clear the Migrate to WebApp 2.5 check box.

6. In Step 4, review the items on the page, accept the default selections, and click
Next .

7. In Step 5, review the setup options you selected, and click Finish to upgrade the application to Oracle JDeveloper 11g. JDeveloper displays a Migration Status dialog box that indicates the progress of the migration. In addition, information about the migration is displayed in the logging pane in the main Oracle JDeveloper window.

8. When the migration is complete, click Finish.

6.2 Viewing the Migration Log Files

After the migration, you can review the log files generated during the application migration. The log files describe the various changes that Oracle JDeveloper 11g makes to the projects as they are opened and migrated to Oracle JDeveloper 11g.  The log files are located in the following directory: JDEV_HOME\upgrade\logs\
You an identify the different log files for each application by viewing the date and time stamp in each log file name. For example:  SOAABC<date>.log In addition, the Messages tab in the Oracle JDeveloper main window displays links to the individual log files for each project that was migrated. Click any of the links to display a migration log file.

7: Compile and Deploy Each of the Application Projects on Oracle Fusion Middleware 11g

After you have opened the SOAABC application and migrated the projects to Oracle JDeveloper 11g, you can now recompile each of the projects and redeploy them one by one.
Review, compile, and redeploy each project in the defined order:

7.1 Asynchronous BPEL Process.

The ABP project is an asynchronous BPEL process. This means that it contains a receive activity to initiate the BPEL process flow and an invoke activity to call back the client asynchronously with the results (that is, the quote) at the end of the flow. To compile and redeploy the ABP project:

1. Right-click the project in the Application Navigator.

2. From the context-menu, select Make ABP.jpr. The project should compile successfully.

3. Right-click the project again and select Deploy > ABP > to > SoaPSRApplicationServer.
The project should deploy successfully.


7.2 ESB Service

The PSRESB project was created as an Oracle Enterprise Service Bus (ESB) service in Oracle Application Server 10g Release 3 (10.1.3). It should require no changes after opening the project in Oracle JDeveloper 11g. To compile and redeploy the PSRESB project:

1. Right-click the project in the Application Navigator.

2. From the context-menu, select Make PSRESB.jpr. The project should compile successfully.

3. Right-click the project again and select Deploy > PSRESB > to > SoaPSRApplicationServer.
The project should deploy successfully.

Modifying the FulfillmentESB Project in Oracle JDeveloper 11g
Compile and Deploy the FulfillmentESB Project

7.2.1 Modifying the FulfillmentESB Project in Oracle JDeveloper 11g
Make the following changes to the FulfillmentESB project:

1. Expand the FullfillmentESB project and double-click composite.xml.

2. Oracle JDeveloper displays the FulfillmentESB composite in the SOA Composite Editor.

3. Double-click the icon that represents the Fulfillment.FulfillmentBatch reference in the right swimlane.
This external reference represents the Fulfillment.FulfillmentBatch JMS adapter. When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.

4. Follow the instructions in the Adapter Configuration Wizard to reconfigure the JMS Adapter for your Oracle Fusion Middleware 11g environment.

You can accept all the default settings in the wizard, except for the following:
Select Oracle Weblogic JMS as the Oracle Enterprise Messaging service.
Select the Application Server connection that you created in  Create a
Connection to Oracle WebLogic Server".
Click the Browse button next to the queue name and select demoFulfillmentQueue.
This should cause jms/demoFullfillmentQueue to be entered into the Queue Name field.
Set the JNDI name to eis/demo/Queue.
5. When you return to the Composite Editor, double-click the icon that represents the  Fulfillment.FedexShipment reference in the right swimlane. This external reference represents a database adapter. When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.

6. Follow the instructions in the Adapter Configuration Wizard to reconfigure the database adapter for your Oracle Fusion Middleware 11g environment. You can accept all the defaults in the wizard, except for the following changes:
Select soademo as your database connection.
Set the JNDI name to eis/DB/soademoDS.

7. Update the Fulfillment.USPSShipment external reference (which represents a file
adapter), as follows:

a. Create a directory on disk for the file adapter; for example:
MW_HOME/Oracle_SOA1/soa/USPSShipment
b. Return to the Composite Editor for the FulfillmentESB project, and
double-click the FulfillmentUSPSShipment external reference.
Oracle JDeveloper displays the Adapter Configuration Wizard.
c. Follow the instructions on the screen until the File Configuration screen
appears.
d. In the Directory for Outgoing Files (physical path) field, enter the path to the
directory you created in Step 7a.
e. Click Next and follow the rest of the adapter configuration instructions.

7.2.2 Compile and Deploy the FulfillmentESB Project
To compile and redeploy the Fulfillment project:
1. Right-click the project in the Application Navigator.
2. From the context-menu, select Make FulfillmentESB.jpr. The project should compile successfully.
3. Right-click the project again and select Deploy > FulFillmentESB > to > SoademoApplicationServer. The project should deploy successfully.


7.3 CreditService
The CreditService project checks whether a customer's credit card is valid or not. In this SOA PSR application, the code simply checks the value of the credit card number. If the credit card number is less than 12345678, then the card is invalid. Otherwise, it is valid. This project is a Java EE Web services  project. Before you proceed, refer to  "About the CreditService, RapidService, and CustomerService Projects". Before you can compile and deploy this project, you must upgrade the Web service
from OC4J JAX-RPC to Oracle WebLogic Server JAX-RPC:
Upgrading the CreditService Web Services
Compiling and Deploying the CreditService Project


7.3.1 Upgrading the CreditService Web Services
To upgrade the OC4J JAX-RPC Web service to Oracle WebLogic Server JAX-RPC:

1. In the Application Navigator, expand the CreditService project, and select the following:

Application Sources > org.soapsr.creditservice > CreditService

2. Right-click the Credit Service Web service and select Upgrade Web Service to WLS JAX-RPC Configuration from the context menu. Oracle JDeveloper displays the Confirm Upgrade dialog box.

3. Click Yes to upgrade the CreditService Web service to Oracle WebLogic Server JAX-RPC.

4. When the upgrade is complete, save the project.

7.3.2 Compiling and Deploying the CreditService Project
To compile and redeploy the CreditService project:

1. Right-click the project in the Application Navigator.

2. From the context-menu, select Make CreditService.jpr. The project should compile successfully.

3. Right-click the project again and select Deploy > CreditService > to > SoademoApplicationServer.
The project should deploy successfully.




7.4.1 Upgrade the RapidService Web Service from OC4J JAX-RPC to Oracle
WebLogic Server JAX-WS
Before you can compile and deploy this project, you must upgrade the OC4J JAX-RPC Web services to Oracle WebLogic Server JAX-WS. The following procedure uses the "top-down" approach to regenerate the Web service using the existing WSDL:

1. Remove the existing JAX-RPC Web service files from the RapidService project:

a. In Oracle JDeveloper 11g application navigator pane, open the RapidService
project and expand following node: Application Sources > org.soapsr.rapidservice

b. Right-click the RapidService node and select Delete from the context menu.

c. In the Delete Web Service? dialog box, click Select All to select all the files shown in the dialog box.

d. Clear the check box for the RapidService.wsdl file, as shown in

e. Click OK.

f. Expand the contents of the Types node and delete Item.java, Quote.java.

g. Expand the contents of the Web Content > WEB-INF node, and then delete web.xml. shows the files under RapidService that you must select and then delete.


2. Remove JAX-RPC Web Services from the classpath:

a. Right-click the RapidService project and select Project Properties from the context menu.

Oracle JDeveloper displays the Project Properties window.
b. Select Libraries and Classpath, select JAX-RPC 10.1.3 Web Services, click Remove, and the click OK.

3. Generate the new JAX-WS Web service:

a. Right click the RapidService.wsdl file under the following location in the RapidService project:  Application Sources > org.soademo.rapidservice > RapidService

b. Select Create Web Service from the context menu.

Oracle JDeveloper displays the Create Java Web Service From WSDL wizard.

c. Follow the instructions on the screen to create the new JAX-WS Web service: Be sure to select Java EE 1.5, with support for JAX-WS Annotations on the Select Deployment Platform screen.

4. Modify the poItemsQuote method in the RequestQuoteImpl.java file as
follows:
public Quote poItemsQuote(@WebParam(name = "param0", targetNamespace =
"http://rapidservice.soademo.org/types/")
List<Item> param0) {
Long totalPrice = new Long(0);
for (int i = 0; i < param0.size(); i++) {
Item localItem = param0.get(i);
totalPrice += localItem.getQuantity() * 110;
}
Quote priceQuote = new Quote();
priceQuote.setSupplierName("RapidDistributors");
priceQuote.setSupplierPrice(totalPrice.toString());
return priceQuote;
}
5. Modify the orderQuote method in the RequestQuoteImpl.java file, as follows:
public Quote orderQuote(@WebParam(name = "param0", targetNamespace =
Task 7: Compile and Deploy Each of the Application Projects on Oracle Fusion Middleware 11g
A-24 Oracle Fusion Middleware Upgrade Guide for Oracle SOA Suite, WebCenter, and ADF
"http://rapidservice.soademo.org/types/")
String param0, @WebParam(name = "param1", targetNamespace =
"http://rapidservice.soademo.org/types/")
String param1, @WebParam(name = "param2", targetNamespace =
"http://rapidservice.soademo.org/types/")
String param2, @WebParam(name = "param3", targetNamespace =
"http://rapidservice.soademo.org/types/")
String param3, @WebParam(name = "param4", targetNamespace =
"http://rapidservice.soademo.org/types/")
String param4) {
Quote priceQuote = new Quote();
priceQuote.setSupplierName("RapidDistributors");
priceQuote.setSupplierPrice("5000");
return priceQuote;
}

6. Save your changes to the RapidService project.

7.4.2 Compiling and Deploying the RapidService Project
To compile and redeploy the Fulfillment project:
1. Right-click the project in the Application Navigator.
2. From the context-menu, select Make RapidService.jpr. The project should compile successfully.
3. Right-click the project again and select Deploy > RapidService > to > SoaPSRApplicationServer.
The project should deploy successfully.
7.5.1 Modifying Specific CustomerService Project Class Files
To modify the CustomerService project in Oracle JDeveloper 11g, you must modify the
following files in the /src/org/soademo/customerservice/ directory of the
project:
business/Customerservice.java:
Remove "throws RemoteException" from the finsCustomerById()method.
client/CustomerServiceClient.java and business/CustomerServiceClient.java

a. Locate the section of the class file and modify it so it reflects the changes.
b. Change the lookup to the following:
CustomerService customerService =
(CustomerService)context.lookup(
"CustomerService#org.soademo.customerservice.business.CustomerService");
business/CustomerserviceBean.java:
Modify this file so its contents reflects.
private static Context getInitialContext() throws NamingException {
Hashtable en = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY,
"oracle.j2ee.rmi.RMIInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "welcome1" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23791/CustomerService");
return new InitialContext( env );
Example A–2 Modified CustomerService.java File
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "weblogic" );
env.put( Context.SECURITY_CREDENTIALS, "weblogic" );
env.put(Context.PROVIDER_URL, "t3://edith:7101");
return new InitialContext( env );
}
Example A–3 Updated CustomerServiceBean.java Class File
package org.soademo.customerservice.business;
import javax.ejb.Remote;
import javax.ejb.RemoteHome;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.soademo.customerservice.persistence.Customer;
@Remote
@WebService(serviceName = "CustomerSvc",
targetNamespace = "http://www.globalcompany.com/ns/customer")
@Stateless(name="CustomerService", mappedName = "CustomerService")
public class CustomerServiceBean implements CustomerServiceLocal,
CustomerService {
@PersistenceContext(unitName = "customerServiceUnit" )
private EntityManager em;
public CustomerServiceBean() {
}
/**
* @param entity
* @return
*/
public Object mergeEntity(Object entity) {
return em.merge(entity);
}
public Object persistEntity(Object entity) {
em.persist(entity);
return entity;
}
public Object refreshEntity(Object entity) {
em.refresh(entity);
return entity;
}
public void removeEntity(Object entity) {
em.remove(em.merge(entity));
}
/** <code>select object(cust) from Customer cust
where cust.custid = :custid</code> */
@WebMethod
public Customer findCustomerById(@WebParam(name = "custid",
targetNamespace = "http://www.globalcompany.com/ns/customer")
String custid){
// public Customer findCustomerById(String custid) {
return
(Customer)em.createNamedQuery("Customer.findCustomerById").setParameter("custid",
custid).getSingleResult();
}
// public String getCustomerStatus(String CustomerID) {
@WebMethod
public String getCustomerStatus(@WebParam(name = "CustomerID",
targetNamespace = "http://www.globalcompany.com/ns/customer")
String CustomerID){return
findCustomerById(CustomerID).getStatus();
}
// public String addNewCustomer(Customer customer) {
@WebMethod
public String addNewCustomer(@WebParam(name = "customer",
targetNamespace ="http://www.globalcompany.com/ns/customer")
Customer customer){
em.persist(customer);
//making the change to return the customer id
// that client application can use to query orders
return customer.getCustid();
//return "New customer added sucessfully to customer database";
}
// public Customer findCustomerByEmail(String email, String password) {
@WebMethod
public Customer findCustomerByEmail(@WebParam(name = "email",
targetNamespace = "http://www.globalcompany.com/ns/customer")
String email, @WebParam(name = "password",
targetNamespace = "http://www.globalcompany.com/ns/customer")
String password){
return(Customer)em.createNamedQuery(
"Customer.findCustomerByEmail").setParameter("email",
email).setParameter("password",
password).getSingleResult();
}
}

7.6.2 Modifying the persistence.xml File in the CustomerService Project
Modify the src/META-INF/persistence.xml so it uses Kodo explicitly in Oracle Weblogic Server. Kodo an implementation of Sun Microsystem’s Java Persistence API (JPA) specification and Java Data Objects (JDO) specification for transparent data objects. Kodo is available as a stand-alone product and is integrated within WebLogic Server. Add the following entry inside the <persistence-unit> element in the persistence.xml file: <provider>kodo.persistence.PersistenceProviderImpl</provider>

7.6.3 Compiling and Deploying the CustomerService Project
To compile and redeploy the Fulfillment project:
1. Right-click the project in the Application Navigator.

2. From the context-menu, select Make CustomerService.jpr. The project should compile successfully.

3. Right-click the project again and select Deploy > CustomerService > to >SoapsrApplicationServer.
The project should deploy successfully.

7.7 SOAOrderBooking
The SOAOrderBooking project, which is a BPEL project, represents the main flow in the SOA Order Booking application. It sends the order information to the appropriate services at the appropriate times. For example, it contacts CreditService to check the customer's credit card, and if the credit card is acceptable, it contacts the suppliers (Select Manufacturer and Rapid Distributors) to get price quotes for the order.
Before you can compile and deploy this project from Oracle JDeveloper 11g, you must make some changes:
Modifying the SOAOrderBooking Project
Optionally, Changing SOAOrderBooking to Use Upgraded Web Services
Compiling and Deploying the SOAOrderBooking Project:
7.7.1 Modifying the SOAOrderBooking Project
Make the following changes to the SOAOrderBooking project in Oracle JDeveloper 11g:

1. Expand the SOAOrderBooking project, and open the SOA Content > ApproveOrder folder.

2. Double-click the ApproveOrder.task file, which defines the human approval task.

3. Double-click the Manager icon under the Assignment and Routing section, select User from the Identification Type drop-down menu, and enter weblogic in the associated field.

4. Open the SOA Content folder, and double-click composite.xml. Oracle JDeveloper displays the SOAOrderBooking composite in the SOA Composite Editor.

5. Double-click the icon that represents the Order reference. This external reference represents the Order database adapter. When you double-click this reference, Oracle JDeveloper displays the Adaper Configuration Wizard.

6. Follow the instructions in the wizard, and accept the default settings, except for
the following changes:
Select soademo as your database connection.
Set the JNDI name to eis/DB/soademoDS.

7. Perform Steps 5 and 6 for the OrderSequence reference and the OrderStatus external references, which both also represents database adapters that must connect to the soademo database and schema.

8. Double click the SelectService reference.Oracle JDeveloper displays the Update Reference dialog box.
Click on the WSDL icon next to the WSDL URL field to display the SOA Resource Browser.
Select Resource Palette from the drop-down menu, and then select SelectManufacturer in the Resource Palette.

9. Repeat Step 8 for the OrderFulfillment reference, but this time select the Fulfillment.OrderFulfillment_ep entry point in FulfillmentESB from the resource palette.

10. Save the change you made to the project.

7.7.2 Optionally, Changing SOAOrderBooking to Use Upgraded Web Services
If you upgraded and redeployed the RapidService, CreditService, and CustomerService projects earlier in this procedure, you can now modify the SOAOrderBooking project to use the new 11g Web services, rather than the ones that are deployed and still running in your Oracle Application Server 10g environment.
Alternatively, you can continue to reference the existing 10g Web services. For more information, see Section A.8.1, "About the CreditService, RapidService, and CustomerService Projects".
To modify the SOAOrderBooking project so it uses the newly upgraded RapidService, CreditService, and CustomerService Web services:

1. Locate the new WSDL URL for the upgraded Web services projects:

a. Open your Web browser and log in to the Fusion Middleware Control.
For example: host24.mycompany.com:7001/em
For more information, see "Getting Started Using Oracle Enterprise Manager
Fusion Middleware Control" in the Oracle Fusion Middleware Administrator's
Guide.

b. Open the Application Deployments folder in the Target Navigation Pane.

c. Click the SOADEMO-RAPIDSERVICE-RapidService-WS application in the
list of deployed applications. Fusion Middleware Control displays the Application Deployment page for the
application you selected.

d. Click the Test icon for the SOADEMO-RAPIDSERVICE-RapidService-WS in the Web Services table in the Entry Points section of the page.

e. On the Test Web Services page, note the WSDL URL for the Web service.

f. Repeat steps c through e for the CreditService and CustomerService
applications.

2. Modify the SOAOrderBooking composite with the new WSDL URLs:
a. Expand the SOAOrderBooking project and double-click composite.xml.
b. Oracle JDeveloper displays the SOAOrderBooking composite in the SOA Composite Editor.
c. Double-click the icon that represents the RapidService external reference in the right swimlane.
This external reference represents the RapidService Web service. When you double-click this reference, Oracle JDeveloper displays the Update References dialog box.
d. Enter the new 11g WSDL URL in the WSDL URL field and click OK.
e. Repeat Steps c and d for the CreditValidationService and CustomerService external references.
f. Save your changes to the project.



3. If you upgraded the CustomerService project to 11g, then you must also modify the SOAOrderBooking.bpel file to reflect the changes made to the CustomerService while upgrading it to 11g. This involves reconnecting the Web services binding, and updating the customerServiceRequest, customerServiceResponse, and subsequent variable queries.

7.7.3 Compiling and Deploying the SOAOrderBooking Project:
To compile and redeploy the SOAOrderBooking project:
1. Right-click the project in the Application Navigator.
2. From the context-menu, select Make.
The project should compile successfully.
3. Right-click the project again and select Deploy > SOAOrderBooking > to >
SoademoApplicationServer.
The project should deploy successfully.

8 OrderBookingESB
The OrderBookingESB project is the entry point to the SOA Order Booking application. The OrderBookingESB project invokes the SOAOrderBooking project, which is a BPEL project that defines the main flow of the SOA Order Booking application. It was created in 10g Release 3 (10.1.3) as an Oracle Enterprise Service Bus (ESB) project. Before you can compile and deploy this project from Oracle JDeveloper 11g, you must make some changes:
Modifying the OrderBookingESB Project
Compiling and Deploying the OrderBookingESB Project:

8.1 Modifying the OrderBookingESB Project
To modify the OrderBookingESB project in Oracle JDeveloper 11g:
1. Expand the OrderBookingESB project and double-click composite.xml.
2. Oracle JDeveloper displays the OrderBookingESB composite in the SOA Composite Editor.
3. Double-click the icon that represents the OrderBooking external reference in the right swimlane.This external reference represents the OrderBooking Web service. When you double-click this reference, Oracle JDeveloper displays the Update References dialog box.
4. Click the WSDL icon next to the WSDL URL field to display the SOA Resource Browser.
Select Resource Palette from the drop-down menu, expand the application server connection, and select the SOAOrderBooking > Client resource from the Resource Palette.
5. Save your changes to the project.

8.2 Compiling and Deploying the OrderBookingESB Project:
To compile and redeploy the OrderBookingESB project:
1. Right-click the project in the Application Navigator.
2. From the context-menu, select Make. The project should compile successfully.
3. Right-click the project again and select Deploy > SOAOrderBookingESB > to > SoademoApplicationServer. The project should deploy successfully.

2 comments:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Oracle JDeveloper 11g Fusion, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Oracle JDeveloper 11g Fusion. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    MaxMunus
    E-mail: nitesh@maxmunus.com
    Skype id: nitesh_maxmunus
    Ph:(+91) 8553912023
    http://www.maxmunus.com/



    ReplyDelete
  2. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Oracle 11g Fusion Java Programming, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Oracle 11g Fusion Java Programming. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    MaxMunus
    E-mail: nitesh@maxmunus.com
    Skype id: nitesh_maxmunus
    Ph:(+91) 8553912023
    http://www.maxmunus.com/



    ReplyDelete