Changing Interoperability Methods


When you have the XBikes Web application operating correctly, you can change the interoperability methods so that XBikes uses different use case adapters or resource interoperability adapters. This section describes the possible options in the following topics:

  • Using Web Services Adapters

  • Using Ja.NET Adapters

  • Using Message Queue Adapters

The following sections describe how to use each kind of adapter.

Using Web Services Adapters

You can use Web services adapters in the following scenarios:

  • Using Web Service Adapters between the Web and Business Tiers

  • Using Web Service Adapters between the Business and Data Tiers

To change XBikes to use Web services adapters, you must modify the application configuration to use the Web services adapters, update the application configuration with the URLs of the Web services, and then restart the application server. The following sections describe how to perform these tasks in each scenario.

Using Web Service Adapters between the Web and Business Tiers

This section describes how to use Web services between the Web and Business tiers. You can either use J2EE Web services or .NET Framework Web services; complete the steps in one of the following procedures.

To use J2EE Web services between the Web and Business tiers

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open WebConfig.xml.

    This file contains six entries for interoperability, one for each use case.

  3. Locate the tag associated with the use case you want to change.

    For example, if you want to change the GetCategories use case, locate the <GetCategories> XML tag.

  4. Change the class name defined in the use case tag to xbikes.usecaseinteropadapters.j2ee.ws.XXXX, where XXXX is the name of the use case you want to change. (You can change all the use cases if you want.)

  5. Locate the <j2eews> tag, and change the URL to the location of the J2EE Web services.

    For example, if the J2EE Web services reside on a computer named J2EEBLL, the <j2eews> tag would look like the following.

     <j2eews>http://J2EEBLL:9080/ XBikesBLLServiceInterface/services/BLLWSServiceInterface.wsdl</j2eews> 

  6. Save WebConfig.xml.

  7. Restart the application server that contains the Web tier to flush out the cached adapter configuration file.

To use .NET Web services between the Web and Business tiers

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open WebConfig.xml.

    This file contains six entries for interoperability, one for each use case.

  3. Locate the tag associated with the use case you want to change.

    For example, if you want to change the GetCategories use case, locate the <GetCategories> XML tag.

  4. Change the class name defined in the use case tag to xbikes.usecaseinteropadapters.net.ws.XXXX, where XXXX is the name of the use case you want to change. (You can change all the use cases if you want.)

  5. Locate the <netws> tag, and change the URL to the location of the .NET Framework Web services.

    For example, if the .NET Framework Web services reside on a computer named NETBLL, the <netws> tag would look like the following.

     <netws>http://NETBLL/XBikes-BLL- WSServiceInterface/BLLWSServiceInterface.asmx?WSDL</netws> 

  6. Save WebConfig.xml.

  7. Restart the application server that contains the Web tier to flush out the cached adapter configuration file.

Using Web Service Adapters between the Business and Data Tiers

This section describes how to use Web services between the Business and Data tiers. You can either use J2EE Web services or .NET Framework Web services; follow the steps in one of the following procedures.

To use J2EE Web services between the Business and Data tiers

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open BLLConfig.xml.

    This file contains two entries, one for the resource adapters and one for the POResourceAdapter. The ResourceAdapter tag is used for all data access except for placing an order, which is configured using the POResourceAdapter tag.

  3. Locate the tag that you want to change.

  4. Change the class name defined in the ResourceAdapter tag to xbikes.resourceinteropadapters.dal.j2ee.ws.DALServiceFacadeAdapter.

  5. Locate the <j2eews> tag, and change the URL to the location of the J2EE Web services.

    For example, if the J2EE Web services reside on a computer named J2EEDAL, the <j2eews> tag would look like the following.

     <j2eews>http://J2EEDAL:9080/  XBikesResWS/services/DALWSServiceInterface.wsdl</j2eews> 

  6. Save BLLConfig.xml.

  7. Restart the application server that contains the Business tier to flush out the cached adapter configuration file.

To use .NET Framework Web services between the Business and Data tiers

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open BLLConfig.xml.

    This file contains two entries, one for the resource adapters and one for the POResourceAdapter. The ResourceAdapter tag is used for all data access except for placing an order, which is configured using the POResourceAdapter tag.

  3. Locate the tag that you want to change.

  4. Change the class name defined in the ResourceAdapter tag to xbikes.resourceinteropadapters.dal.net.ws.DALServiceFacadeAdapter.

  5. Locate the <netws> tag, and change the URL to the location of the .NET Framework Web services.

    For example, if the .NET Framework Web services reside on a computer named NETDAL, the <netws> tag would look like the following.

     <netws>http://NETDAL/ XBikes-DAL- WSServiceInterface/DALWSServiceInterface.asmx?WSDL</netws> 

  6. Save BLLConfig.xml.

  7. Restart the application server that contains the Business tier to flush out the cached adapter configuration file.

Note

If you want to change the Place Order functionality to use Web services, repeat one of the preceding procedures for the POResourceAdapter tag, using the class name xbikes.resourceinteropadapters.dal.net.ws.PlaceOrderResourceAdapter.

Using Ja.NET Adapters

You can use Ja.NET adapters in the following scenarios:

  • Using Ja.NET Adapters between the J2EE Web Tier and the .NET Framework Business Tier

  • Using Ja.NET Adapters between the J2EE Business Tier and the .NET Framework Data Tier

To change XBikes to use Ja.NET adapters, you must modify the application configuration to use the Ja.NET adapters, update the server configuration file to load the correct Ja.NET configuration file, and then restart the application server. The following sections describe how to perform these tasks in each scenario.

Using Ja.NET Adapters between the J2EE Web Tier and the .NET Framework Business Tier

This section describes how to use Ja.NET adapters between the J2EE Web tier and the .NET Framework Business tier.

Using Ja.NET adapters between the J2EE Web tier and the .NET Framework Business tier

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open WebConfig.xml. This file contains six entries for interoperability, one for each use case.

  3. Locate the tag associated with the use case you want to change. For example, if you want to change the GetCategories use case, locate the <GetCategories> XML tag.

  4. Change the class name defined in the use case tag to xbikes.usecaseinteropadapters.net.janet.XXXX, where XXXX is the name of the use case you want to change. (You can change all the use cases if you want.)

  5. Save WebConfig.xml.

  6. In Notepad, open the C:\Xbikes\Config\Janet_bll.xml file.

  7. Locate the JaNETConfiguration element, followed by the ClientMap child element, followed by the default child element, followed by the URI child element. Make sure the URI element contains the correct URL to the XBikes BLL JaNetServiceInterface Web project.

  8. Save the Janet_bll.xml file.

  9. Copy the Janet_bll.xml file in the C:\Xbikes\Config folder to Janet_config.xml in the same folder.

    Note

    The Janet_config.xml file already exists, so overwrite it with the Janet_bll.xml file.

  10. Restart the Web tier application server.

Using Ja.NET Adapters between the J2EE Business Tier and the .NET Framework Data Tier

This section describes how to use Ja.NET adapters between the J2EE Business tier and the .NET Framework Data tier.

Using Ja.NET adapters between the J2EE Business tier and the .NET Framework Data tier

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open BLLConfig.xml.

    This file contains two entries, one for the resource adapters and one for the POResourceAdapter. The ResourceAdapter tag is used for all data access except for placing an order, which is configured using the POResourceAdapter tag.

  3. Change the class name defined in the ResourceAdapter tag to xbikes.resourceinteropadapters.dal.net.janet.JaNetDALServiceFacadeAdapter.

  4. Save BLLConfig.xml.

  5. In Notepad, open the C:\Xbikes\Config\Janet_dal.xml file.

  6. Locate the JaNETConfiguration element, followed by the ClientMap child element, followed by the default child element, followed by the URI child element. Make sure the URI element contains the correct URL to the XBikes DAL JaNetServiceInterface Web project.

  7. Save the Janet_dal.xml file.

  8. Copy the Janet_dal.xml file in the C:\Xbikes\Config folder to Janet_config.xml in the same folder.

    Note

    The Janet_config.xml file already exists, so overwrite it with the Janet_dal.xml file.

  9. Restart the Business tier application server.

Using Message Queue Adapters

XBikes allows you to use a message queue to place orders. To configure the XBikes application to use the message queue, complete the following steps.

To configure the “Place Order” functionality to use message queues

  1. Open Windows Explorer and navigate to the C:\Xbikes\Config folder.

  2. In Notepad, open BLLConfig.xml.

  3. Change the POResourceAdapter entry to xbikes.resourceinteropadapters.queue.wsmq.PlaceOrderResourceAdapter.

  4. Save the BLLConfig.xml file.

  5. Restart the application server.

The J2EE XBikes application contains a Web application on the Data tier to read orders from the queue and insert them into the database. If you have configured XBikes to use message queuing, and you have successfully placed an order, you can complete the following steps to view and process the orders.

To view and process orders from the message queue

  1. Open a Web browser window and enter http://localhost:9080/MQTestClient.

  2. Click the Check MQ for Orders button to display orders in the Web browser window.




Application Interoperability. Microsoft. NET and J2EE
Application Interoperability: Microsoft .NET and J2EE: Microsoft(r) .Net and J2ee (Patterns & Practices)
ISBN: 073561847X
EAN: 2147483647
Year: 2003
Pages: 104

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net