Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2009 : WCF LOB Adapter SDK (part 6)

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
6/26/2011 4:45:45 PM

6. Step 6: Deployment

To make the HotelAdapter available for consumption by the client applications, you have to deploy it. The deployment procedure is not complicated. First you have to GAC the adapter by signing the adapter's assembly with a strong name key and calling the gacutil.exe utility with the /if switch. Second, you have to register the adapter with WCF by making a few entries in the machine.config file. Here is the process to follow to register the HotelAdapter with WCF:

  1. Go to the <%WINDIR%>\Microsoft.NET\Framework\Config folder, locate the machine.config file, and open it in Visual Studio.

  2. Update the <system.serviceModel> configuration section to include the HotelAdapter entries as follows:

    <system.serviceModel>
    <system.serviceModel>
    <client>
    <endpoint binding="hotelBinding" contract="IMetadataExchange"
    name="hotel" />
    </client>
    <extensions>
    <bindingElementExtensions>
    <add name="HotelAdapter"
    type="HotelApp.HotelAdapter.HotelAdapterBindingElementExtension,
    HotelApp.HotelAdapter.HotelAdapter,Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=XXXXXXXXXXXXX" />
    </bindingElementExtensions>
    <bindingExtensions>
    <add name="hotelBinding"
    type="HotelApp.HotelAdapter.HotelAdapterBindingCollectionElement,
    HotelApp.HotelAdapter.HotelAdapter,Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXX" />/>
    </bindingExtensions>
    </extensions>
    </system.serviceModel>


7. Step 7: Consuming from an .NET Application

Now that you have finished the deployment, the HotelAdapter can be consumed from the WCF-enabled client applications. You have to generate a proxy and update the app.config file to include the adapter configuration. The Add Adapter Service Reference plug-in is your main tool to do the job.

Here is the process to follow:

  1. Open Visual Studio, and create new project called ConsumeAdapterApplication.

  2. In the Solution Explorer, right-click the ConsumeAdapterApplication project, and select the Add Adapter Service Reference menu item.

  3. In the Select Binding combo box, select hotelBinding. Click the Configure button. The Configure Adapter dialog box will open.

  4. Specify the username and password, as shown in Figure 11. Click the OK button to return to the Add Adapter Service Reference plug-in.

  5. Click the Connect button. Make sure that the connection status has changed to "connected."

  6. In the "Select a category" list, select "Hotel operations."

  7. In the "Available categories and operations" list, select Get Rooms, and click the Add button. The Add Adapter Service Reference window now should look like Figure 13.

    Figure 13. Add Adapter Service Reference window
  8. Click the OK button to generate a proxy file. The app.config file will also be updated. Note that the proxy file named HotelAdapterBindingClient.cs is now part of the solution.

  9. Open the Program.cs file, and replace content with the following code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace ConsumeAdapterApplication
    {
    class Program
    {
    static void Main(string[] args)

    {
    HotelServiceClient client = new HotelServiceClient();
    client.ClientCredentials.UserName.UserName = "Probiztalk2009";
    string response = client.GetRooms("Indigo hotel");
    Console.WriteLine(response);
    Console.Read();
    }
    }
    }

  10. Build and run the application. You will see the HotelAdapter response, as shown in Figure 14.

    Figure 14. The HotelAdapter response

8. Step 8: Consuming from BizTalk Application

To consume the HotelAdapter from a BizTalk application, you have to generate the schemas for the operations supported by the adapter and the binding file to create physical ports. In case of a BizTalk application, the tool to do the job is the Consume Adapter Service add-in. This tool has the same UI as the Add Adapter Service Reference plug-in, but it generates different artifacts.

Here is the process to follow:

  1. In Visual Studio, open your BizTalk project.

  2. In Solution Explorer, right-click the project, and select Add => Add Generated Items => Consume Adapter Service.

  3. In the Select Binding box, select hotelBinding. Click the Configure button. The Configure Adapter dialog box will open.

  4. Specify the username and password. Click the OK button to return to the Add Adapter Service Reference window.

  5. Click the Connect button. Make sure that the connection status has changed to "connected."

  6. In the "Select a category" list, select "Hotel operations."

  7. In the "Available categories and operations" list, select Get Rooms, and click the Add button.

  8. Click OK to generate the schemas and the binding file. The schema file named HotelAdapterBindings.xsd contains message definitions for the HotelAdapter request and response messages, as shown in Figure 15.

    Figure 15. Generated schema definitions
  9. Implement your project orchestration to communicate with the HotelAdapter through a request-response port. Your orchestration should look like Figure 16.

  10. Build and deploy the project.

  11. Open the BizTalk Administration Console.

  12. Import the binding file to create physical ports. Right-click your application under the Applications group, select Import => Bindings, navigate to your binding file, and click the Open button.

  13. Map the orchestration logical ports to the newly created physical ports.

  14. Enlist and start your orchestration.

  15. Start your application.

Figure 16. HotelAdapter orchestration
Other -----------------
- SQL Server 2008 : Configuring the Instance (part 3)
- SQL Server 2008 : Configuring the Instance (part 2) - Specifying the Backup Compression Default & Enabling Login Failure Auditing
- SQL Server 2008 : Configuring the Instance (part 1) - Viewing Configuration Settings & Specifying Maximum and Minimum Server Memory
- Microsoft PowerPoint 2010 : Expanding PowerPoint Functionality - Loading and Unloading Add-ins
- Microsoft PowerPoint 2010 : Expanding PowerPoint Functionality - Viewing and Managing Add-ins
- Microsoft Dynamics CRM 2011 : Sending and Tracking Email Messages in Microsoft Dynamics CRM for Outlook
- Microsoft Dynamics CRM 2011 : Using Microsoft Dynamics CRM for Outlook - Using the Add Contacts Wizard
- Microsoft Dynamics CRM 2011 : Using Microsoft Dynamics CRM for Outlook - Creating and Tracking Contacts
- Windows Server 2008 R2 : Managing Disks and Disk Storage - Understand the Basics (part 2) - Work with Partitions & Use DiskPart
- Windows Server 2008 R2 : Managing Disks and Disk Storage - Understand the Basics (part 1) - Work with Your Storage
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer