Posts filed under ‘BizTalk’

How to install a BizTalk 2013 Beta development environment

Last Tuesday the BizTalk Server Team announced the release of Microsoft BizTalk Server 2013 Beta, formerly known as Microsoft BizTalk Server 2010 R2. If you are a BizTalk professional as I am, you surely would be very excited to get your hands on the software bits.

In this post I’ll explain to you how to build a BizTalk 2013 Beta x64 development environment so you could begin to experiment with the product.

Install Microsoft Windows Server 2012

This is pretty straight forward, just like Windows 2008 and 2008 R2. You can follow the instructions detailed here.

Install IIS 8.0

1) In the Server Manager Dashboard select Add roles and features

image

2) Click Next in the welcome window.

image

3) Select Role-based or feature-based as Installation Type and click Next

image

4) Select your current server and click Next

image

5) Select the Web Server (IIS) role

image

6) Confirm the features required by clicking Add Features

image

7) Select the Application Server role and click Next

image

8) In Features select .NET Framework 3.5 Features. Microsoft SQL Server 2012 requires the .NET Framework 3.5 assemblies so you will need to have them already installed later in the setup process.

image

9) In Application Server click Next

image

10) Select the following role services:

  • .NET Framework 4.5
  • Distributed Transactions
  • Web Server (IIS) Support
  • Windows Process Activation Support

image

11) Click Add Features for each requirements as needed.

image

image

image

image

image

12) Select Create a self-signed certificate as an option for the WS-AT encryption. You can install the certificate once Microsoft BizTalk Server 2013 Beta has been installed.

image

13) In the Web Server Role (IIS) window click Next.

image

14) Leave the default role services and click Next.

image

15) Review the installation selections and click Install.

image

16) Once the wizard has finished click Close.

image

Install Microsoft Excel 2013

1) Accept the license terms and Click Continue.

image

2) Click on Costumize

image

3) Select only Microsoft Excel and Microsoft InfoPath. You can also install the full Microsoft Office 2013 suite if you like to.

image

4) Wait for the installation process to end.

image

5) Once the installation has been finished click Close.

image

Install Visual Studio 2012

1) Agree to the license terms and click Next

image

2) Confirm the optional features to install and click Install.

image

3) Wait for the installation process to end.

image

4) Once the installation process has finished close the Wizard.

image

Install Microsoft SQL Server 2012

1) In SQL Server Installation Center click Installation

image

2) Click on New SQL Server stand-alone installation or add features to an existing installation.

image

3) Wait for the Setup Support Rules to be validated and click OK

image

4) Enter your product key and click Next.

image

5) Agree to the license terms and click Next.

image

6) Let the installation wizard check for product updates and click Next.

image

7) Once the setup files had been installed click on Ok in the computer restart confirmation window.

image

8) Make sure there are not critical errors in the Setup Support Rules and click Next.

image

9) In Setup Role select SQL Server Feature Installation and click Next.

image

10) Select the following features and click Next.

  • Database Engine Services
    • SQL Server Replication
    • Full-text and Semantic Extractions for Search
  • Analysis Services
  • Reporting Services – Native
  • Client Tools Connectivity
  • Integration Services
  • Management Tools – Basic
    • Management Tools – Complete

As this is a development environment you should consider installing also the Documentation Components.

image

image

11) Validate the Installation Rules summary and click Next.

image

12) Select Default instance in Instance Configuration and click next.

image

13) Review the Disk Space Requirements and click Next.

image

14) Enter the proper account information for each SQL Service instance and click Next.

image

15) In Database Engine Configuration leave de default values and click on Add Current User, then click next.

image

16) Enter the account information for the Analysis Services administration role and click Next.

image

17) In Reporting Services Configuration select Install and configure and click Next.

image

18) In Error Reporting click Next.

image

19) Review the Installation Configuration Rules summary and click Next.

image

20) Review the features to be installed and click Install.

image

21) Once the installation has finished click Close.

image

Install SQL Server 2012 SP1

1) Download and install the Microsoft SQL Server 2012 SP1.

Disable Shared Memory

1) In the Start Screen click on SQL Server Configuration Manager

image

2) Expand SQL Server Network Configuration and click Protocols for MSSQLSERVER. Disable Shared Memory

image

Install SharePoint Foundation 2013

1) Download and run the SharePoint Foundation 2013 installation file.

2) Click on Install software prerequisites.

image

3) In the welcome window click Next.

image

4) Accept the license terms and click Next.

image

5) Once the installation is completed click on Finish.

image

Install SharePoint Foundation

1) Click on Install SharePoint Foundation.

image

2) Accept the license terms and click Continue.

image

3) Select Complete as Server Type and click Install Now.

image

4) If your computer is running stand alone, once the installation is completed don’t run the SharePoint Product Configuration Wizard.

image

5) In the Start Screen click on SharePoint 2013 Management Shell

image

6) Run the New-SPConfigurationDatabase cmdlet and enter the proper values.

image

7) In the Start Screen launch the SharePoint 2013 Products Configuration Wizard.

image

8) In the welcome window click Next.

image

9) Select Do not disconnect from this server farm and click Next.

image

10) In the Central Administration Web Application configuration window leave the default values and click Next.

image

11) Review the configuration information and click Next.

image

12) Once the configuration has finished click Finish.

image

13) In the Initial Farm Configuration Wizard click OK.

image

14) Start the wizard.

image

15) Enter the service account and services to install information and click Next.

image

image

16) Enter the initial site collection information and click OK.

image

17) Once the process has been completed Close the Farm Configuration Wizard.

image

Install Microsoft BizTalk 2013 Beta

1) Download and run the Microsoft BizTalk 2013 installation file.

2) Download the prerequisites CAB file.

3) Click on Install Microsoft BizTalk Server 2013 Beta

image

4) Accept the default product key and click Next.

image

5) Accept the license agreement and click Next.

image

6) In Customer Experience Improvement Program select to participate or not and click Next.

image

7) Select the following additional components and click Next:

  • Enterprise Single Sign-On Administration
  • Enterprise Single Sign-On Master Secret
  • Developer Tools and SDK
  • Documentation
  • Server Runtime
    • BizTalk EDI/AS2 Runtime
    • Windows Communication Foundation Adapter
  • Administration Tools and Monitoring
    • Windows Communication Foundation Administration Tools
  • Additional Software

image

image

8) Select the prerequisites file previously downloaded and click Next.

image

9) Review the installation summary and click Install.

image

10) Enable Microsoft Update and click Next.

image

12) Once the installation is finished click Finish.

image

At this point you are now ready to configure your BizTalk installation just like you would do in BizTalk 2010.

image

image

In my development environment I’ve tested all the common adapters and they work just fine, event with SharePoint 2013. I’ll be conducting more tests with other adapters like SAP and Azure and I’ll keep you posted on my findings.

November 12, 2012 at 12:03 pm Leave a comment

How to create a BizTalk 2010 R2 CTP Virtual Machine in Windows Azure

At TechEd 2012 members of the BizTalk product team promised a CTP release for BizTalk 2010 R2 in July.  This was true, but the CTP was made available only for a company that qualified for the TAP program. This changed a couple of weeks ago when the Windows Azure Team announced the availability of BizTalk Server 2010 R2 CTP Release in Windows Azure Virtual Machines gallery.

Now you can setup a complete BizTalk 2010 R2 CTP environment easily and quickly, without having the hassle of procuring hardware for your physical servers or virtual machines in your organization.

To create your BizTalk 2010 R2 CTP virtual machine you need access to a Windows Azure subscription. If you don’t have one already, you can sign up for Windows Azure 90-day free trial here.

Once you have your Azure subscription just follow these simple steps to get your environment up and running:

1) Sign in to the Windows Azure Management Portal.

SNAGHTML73c8b24

2) On the command bar, click New.

SNAGHTML74417aa

3) Click Virtual Machine, and then click From Gallery.

SNAGHTML74d3a95

4) In VM Box Selection click Platform Images, select the Microsoft BizTalk Server 2010 R2 CTP image, and then click the arrow to continue.

image

5) In VM Configuration enter the Virtual Machine name and the Administrator’s password. Select the size needed for your application. Click the right arrow.

SNAGHTML74614ec

6) You can connect virtual machines together under a cloud service but for testing purposes select Standalone Virtual Machine. Enter the DNS name for the VM, select the storage account for the VHD file and select the proper Affinity Group according to your geographic location.

SNAGHTML746d8c7

7) In VM Options select None. Tis page apply only if you are connecting this virtual machine to other virtual machines or if you are adding the virtual machine to a virtual network. Click the check mark to create the virtual machine.

SNAGHTML747d889

The VM creation process takes some minutes. Meanwhile you can watch its progress in the All Items page.

SNAGHTML74841d6

Once the VM has been created and provisioned its status will change to Running.

SNAGHTML7489dab

Click in the VM name and you will be redirected to its Dashboard, from here you can perform common administrative tasks as Restart, Shutdown or even delete the VM if necessary.

SNAGHTML151ee78f

In order to access your BizTalk 2010 R2 CTP VM you need to click in the Connect icon. This will download a remote desktop shortcut to your PC. Just double click it and you will be connected to the VM.

image

image

As you can see Windows Azure facilitates enormously the creation of VMs for software evaluation purposes. You can also learn more about the new features in BizTalk 2010 R2 CTP in this great post by Nitin Mehrotra.

September 17, 2012 at 8:42 am Leave a comment

Implementing the Microsoft BizTalk 2010 Adapter for mySAP Business Suite

Microsoft BizTalk Server 2010 has a lot of great capabilities and one of the most interesting is the BizTalk Adapter Pack because it provides service enablement for Line of Business (LOB) applications on top of the .NET Windows Communication Foundation (WCF) technology. Out of the box it supports popular packaged applications and databases like:

  • SAP
  • Siebel eBusiness Applications
  • Oracle eBusiness Suite
  • Oracle Database
  • SQL Server Database

Because of its easy of use one of the most popular scenarios in which you implement the BizTalk Adapter Pack is to integrate Microsoft BizTalk Server and mySAP Business Suite.

In this post I’ll show you how to implement the Microsoft BizTalk 2010 Adapter for mySAP Business Suite Client Version 7.1 in a development environment. There are several configurations supported for production and development but for this post we’ll use the one suggested for 32-bit BizTalk processes:

 image

The VM configured for this implementation consists of the following characteristics:

Hardware
Intel Core i7 @ 2.2GHz
4GB RAM
100GB HDD

Software
Windows 2008 R2 Enterprise x64 SP1
SQL Server 2008 R2 Developer x64 SP1
BizTalk Server 2010 Developer x64
Visual Studio 2010 Ultimate SP1

In order to begin the installation process you first need to install several DLLs required by the BizTalk Adapter Pack to interface with the SAP system. Most of the packages that contain these DLLs must be downloaded from the SAP Service Marketplace by the SAP administrator in your organization. This is required because access to the SAP Software Distribution Center is restricted by a ‘Download Software’ authorization object. This ensures that software is downloaded only by authorized users.

Because we are planning to use only 32-bit only hosts there is no need to install the x64 versions of the RFCSDK, R3DLLINS and Visual C++ run-time DLLs.

1) Download and extract the RFCSDK 7.0 (Unicode) (32-bit) client files
Confirm that SAP GUI for Windows is not installed. Uninstall SAP GUI if installed.

Get RFCSDK at SAP software download center (http://service.sap.com/swdc)

Download RFC_9-20000972.SAR (RFC) and extract using SAPCAR.exe. From command prompt  execute SAPCAR –xvf <file path>

image

image

image

image

2) Copy required files (icudt30.dll, icuin30.dll, icuuc30.dll, librfc32u.dll, libsapu16vc71.dll, libsapucum.dll) to c:\windows\sysWOW64

File version of icudt30.dll, icuin30.dll, icuuc30.dll : 3.0.0.0
File version of librfc32u.dll : 7000.0.100.5358
File version of libsapu16vc71.dll, libsapucum.dll : 7000.100.13.42057

image

image

3) Download and setup R3DLLINS.exe (SAP Note 684106) for SAP release 6.40 and 7.00
Get attached file of SAP note 684106 (http://service.sap.com/notes)
Related files : msvcr71.dll, msvcp71.dll, mfc71.dll, mfc71u.dll
File version of msvcr71.dll : 7.10.3052.4
File version of other files : 7.10.3077.0

image

image

4) Download and setup Microsoft Visual C++ run-time DLLs required for SAP 7.1 client (SAP Note 684106) from the following link http://go.microsoft.com/fwlink/?LinkId=107086

image

Once the SAP prerequisites are installed we can proceed to setup the remaining BizTalk components.

5) Install the Windows Communication Foundation Line of Business SDK 2010 x64.

Execute the AdapterFramework.msi installer located in the BizTalk Server  2010 installation media.

image

image

image

image

In a production environment you should only install the WCF LOB SDK Runtime, in this case we are setting up a development server so we will install all the features.

image

image

6) Install the BizTalk 2010 Adapter Pack x86. If you are planning to use the SAP Adapter in x64 Hosts you should also install de x64 version of the Adapter Pack.

Execute the AdapterSetup.msi installer located in the BizTalk Server 2010 installation media.

image

image

image

For this installation select only the following features:

  • Microsoft BizTalk Adapter for mySAP Business Suite
  • .Net Framework Data Provider for mySAP Business Suite

image

image

image

image

At this point you have installed successfully the Microsoft BizTalk 2010 Adapter for mySAP Business Suite. Now you can configure and test it.

SAP Adapter Configuration

Ton configure the SAP Adapter you need to perform the following steps:

1) Open the BizTalk Administration Console. Expand the Adapters folder and right click New – Adapter

image

2) Enter a meaningful name for the adapter and select WCF-SAP from the adapters drop down list.

image

3) Click OK in the warning window.

image

Now the WCF SAP Adapter has been added in BizTalk make sure it is configured to use the proper Adapter Handler (x86 or x64) according with the Adapter Pack version previously installed.

image

Consuming the Adapter in Visual Studio

Once the SAP Adapter is installed and configured you can consume it from Visual Studio to extract the metadata and message formats needed to communicate with SAP.

For example, lets suppose we want to construct and send a MATMAS IDOC to SAP, to do so we only need to do the following easy steps:

1) Open a BizTalk project in Visual Studio, right click over it and select Add – Add Generated Items

image

2) Select Consume Adapter Service – Consume Adapter Service and click on Add

image

3) In the Consume Adapter Window select sapBinding and click on Configure

image

4) In Security select you SAP credentials type and enter them

image

5) Go to URI Properties and enter the connection parameters

image

image

6) In Binding Properties set Enable BizTalk Compatibility Mode to True and click on OK

image

7) Click Connect

image

8) Select the proper Contact Type, Category (BAPI, IDOC, RFC), and Operation (MATMAS03). Click Add, enter a file name prefix and click OK.

image

Once the service has been imported you will see an XSD of the operation previously selected and the correspondent binding file needed to configure the BizTalk port.

image

From here you would implement your BizTalk application as usual, using the supplied XSD to build the messages needed to communicate with SAP.

Send Port Configuration

Once your BizTalk application has been deployed you can use the WFC-Custom binding file generated in Visual Studio

image

or manually create an specific transport configuration

image

just don’t forget to specify the SOAP Action Header as in the XML binding file otherwise you’ll get an error like this:

image

Conclusion

Implementing the Microsoft BizTalk 2010 Adapter for mySAP Business Suite is an easy task once you have all the files from de SAP Service market place. Having it in place allows you to considerably reduce the amount of time needed to develop intercommunication processes with SAP.

You can learn more about the Microsoft BizTalk 2010 Adapter Pack in the following guides:

Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK 2010 Documentation

Microsoft BizTalk Adapter Pack 2010 Documentation

August 30, 2012 at 10:58 am 2 comments

Connecting BizTalk 2010 To MySQL using TwoConnect ODBC Adapter

MySQL is the world’s most popular open source database, falling behind only to Oracle and Microsoft SQL Server.

image

Because of its popularity sooner than later you will be facing the need to interact with MySQL from BizTalk Server. MySQL provides ADO .Net and ODBC drivers so you can use helper classes to access the database. However if you want a more message oriented approach the TwoConnect ODBC Adapter is the way to go.

The Adapter is very easy to use, stable and has a good performance. In this post I’ll show you how to use the adapter to execute an stored procedure in MySQL from BizTalk 2010.

For this example we are going to call an stored procedure in a MySQL database that inserts certain values into a table and returns the identity value of the record just added.

image

First of all you need to download the adapter from TwoConnect’s web site. The installation process is quite forward:

image

image

image

image

Once the installation is done you need to add the Adapter in the BizTalk Server Administration Console.

Open the Administration Console and expand BizTalk Group – Platform Settings. Right click in the Adapters folder and Select New – Adapter..

image

In the ODBC – Adapter Properties select the ODBC adapter and enter a proper name for it. Click on the Ok button to close the window.

image

Don’t forget to restart your host instances for the change to take effect.

image

Now that the adapter is ready you need to download the MySQL ODBC driver. The driver is available in x86 and x64 versions. You will need the x86 version for design time tasks in Visual Studio and the BizTalk Administration Console (both are x86 applications). The x64 will be required if the ODBC Adapter is going to run in a x64 Host Instance.

The installation process of the ODBC driver is also straight forward:

image

image

image

image

image

At this point we are ready for the next step, add the adapter metadata to create the artifacts needed to communicate with MySQL thru ODBC.

Right click with your mouse on your BizTalk project and select Add – Add Generated Items…

image

Select Add Adapter Metadata and click on the Add button

image

In Add Adapter Wizard select the ODBC Adapter and click on the Next button

image

Click on Set to define the DSN to be used

image

Select or create a System DSN and click on Ok

image

Type the credentials to be used for the DSN just selected and click on the Ok button

image

Click on Next to continue with the wizard

image

Because you are going to invoke a stored procedure that returns data, in the Schema Information step select Send Port and type the target namespace, request and response root name values.

SNAGHTML97e3bf8

Select Stored Procedure and click Next

image

In the Statement Information step type the proper query in the form databasename.spname an click on Generate. Once the Processed Command window has been populated click on Next

image

Click the Finish button and the wizard proceeds to create the needed XSD and ODX files.

image

At this point the adapter created the Request and Response schemas and a BizTalk Orchestration containing the port and multipart message types

image

image

There are two things to consider at this point:

1) The ODBC adapter created two individual Request and Response port types. You need to delete them because the operation is a synchronous Request/Response and create a new one.

Right click the Port Type folder and Select New Request-Response Port Type

image

Enter a proper name

image

2) The Multi-part Message Types are improperly assigned. Select the correct ones.

image

Once this two errors have been solved you just need to build the orchestration, connect the ports and deploy the BizTalk project.

image

Once the artifacts have been deployed the Send Port to MySQL needs to be created and configured.

In the Configure Application windows select the outbound port and click on New send port…

image

In Send Port Properties select the ODBC adapter and click Configure. Don’t forget to select also XML Transmit and Receive pipelines.

image

Next in the ODBC Transport Properties click on the ellipsis to configure the connection string to be used.

image

Choose your MySQL data source previously created

image

Type the credentials to be used for the DSN just selected and click on the Ok button

image

Close the remaining windows

image

Now you can start your application and test the TwoConnect ODBC Adapter. For example, if you submit a Xml document like this:

image

The adapter would execute the stored procedure and generate the following response with the ID assigned to the record in the MySQL table:

image

If you open MySQL Workbench the record is showed with the values defined in the Xml Request.

image

As you can see the TwoConnect ODBC adapter is very easy to use, has a very good performance and stability. Give it a try and share your experience with me.

July 27, 2012 at 3:26 pm 3 comments

How to create a custom BizTalk 2010 functoid using the Item Class Template for Visual Studio 2010

A week ago BizTalk MVP Sandro Pereira announced the release of a new Functoid Class item template for Visual Studio 2010 that allows you to create new functoids for BizTalk Server 2010 without having to code the entire class.

In this post I will show you how to use the template to easily create a new Functoid and test it in BizTalk 2010.

Item Template Installation

First you need to download the class item template from the TechNet Gallery:

image

image

Once the .zip file is downloaded you should copy it to C:\Users\UserName\Documents\Visual Studio 2010\Templates\ItemTemplates\VisualC#

image

Class Library Project Creation

Now that the item template file is in place you can proceed to create a new class library project in Visual Studio 2010. This project will be used to hold the functoid classes to be constructed.

image

image

In the new project select Add – New Item…

image

In the Add New Item window select Custom Functoid Class, enter a proper name and click Add

image

The templeates creates a new class and adds a reference to the Microsoft.BizTalk.BaseFunctoids assembly

image

The new class contains of the elements needed to implement the new Functoid with comments explaining the purpose of each section. I’ll discuss it in a few moments.

image

At this point you only need two more things to end the initial setup of your project:

1) A folder to hold your functoid icons

image

image

2) A resource file in which define certain values required for the functoid configuration.

image

image

Now you are ready to start modifying the functoid class with the proper values. The Item Template makes the process so easy and quick that you could develop your first functoid in just minutes.

First you need to define an Id for the functoid. Certain functoid IDs are reserved by standard/inbuilt Mapper functoids. Usually, the standard Mapper functoids use the IDs from 1 to 10000. While creating custom functoids, do not use the functoid IDs less than 10000.

Code Snippet
  1. //ID for this functoid
  2. this.ID = 10001;

 

Next you need to type the resource assembly name, it is composed by the project namespace + the resource file internal class name (it should be the same as the resource file name)

Code Snippet
  1. // resource assembly must be ProjectName.ResourceName if building with VS.Net
  2. SetupResourceAssembly("BizTalk.MapperExtensions.RESTFunctoids.RESTFunctoidsResources", Assembly.GetExecutingAssembly());

 

image

image

Next you need to define the following resources:

1) Name. Name of the functoid to be displayed in the toolbox, grid and properties window.

image

2) Tooltip. Tooltip of the functoid.

3) Description. Description of the functoid to be displayed in the toolbox, configuration and properties windows.

 image

4) Bitmap file for the functoid. A string key name associated with the resource in the resource file. This bitmap must be a Windows Bitmap file measuring 16 x16 pixels and 24 bit color. You can use GIMP to create a file with those characteristics.

Code Snippet
  1. //Setup the Name, ToolTip, Help Description, and the Bitmap for this functoid
  2. SetName("IDS_RESTSERVICECONSUME_NAME");
  3. SetTooltip("IDS_RESTSERVICECONSUME_TOOLTIP");
  4. SetDescription("IDS_RESTSERVICECONSUME_DESCRIPTION");
  5. SetBitmap("IDS_RESTSERVICECONSUME_BITMAP");

 

The name, tooltip and description values are added to the resource file as strings.

image

To add the bitmap file simply drag it from its folder and into the Images section, then enter the same name you defined in the class file.

image

Next a category must defined for the functoid. This value describes under which tab the functoid will be placed upon insertion in the toolbox. You can find more information about the FunctoidCategory enumeration here.

Code Snippet
  1. //category for this functoid. This functoid goes under the String Functoid Tab in the
  2. this.Category = FunctoidCategory.None;

Once the functoid category has been defined you will proceed to define values related to the functoid inputs, outputs and operation.

The first values to define in this section are the minimum and maximum quantity of parameters supported by the functoid.

Code Snippet
  1. // Set the limits for the number of input parameters. This example: 4 parameters
  2. this.SetMinParams(4);
  3. this.SetMaxParams(4);

Next you will define the type of each input parameter expected by the functoid. You can use this value to restrict the type of data your functoid should accept, for example a field, an element or another functoid type. More information about the ConnectionType Enumeraion here.

Code Snippet
  1. // Add one line of code as set out below for each input param. For multiple input params, each line would be identical.
  2. AddInputConnectionType(ConnectionType.All); //first input
  3. AddInputConnectionType(ConnectionType.All); //second input
  4. AddInputConnectionType(ConnectionType.All); //third input
  5. AddInputConnectionType(ConnectionType.All); //fourth input

We use the ConnectionType Enumeration again to subsequently define the output type supported by the functoid.

Code Snippet
  1. // The functoid output can go to any node type.
  2. this.OutputConnectionType = ConnectionType.All;

Finally in the last step of the configuration section you need to define the name of the function that will be called when this functoid is invoked in the mapper.

Code Snippet
  1. // Set the function name that is to be called when invoking this functoid.
  2. // To test the map in Visual Studio, this functoid does not need to be in the GAC.
  3. // If using this functoid in a deployed BizTalk app. then it must be in the GAC
  4. SetExternalFunctionName(GetType().Assembly.FullName, GetType().FullName, "RESTConsume");

At this point you are now ready to write down the real function that will be implemented by the functoid. This function name should be the same one defined previously in SetExternalFunctionName.

For this example I used a function that consume REST services. It receives four string parameneters:

  • URI of the service
  • HTTP method used (GET, POST, DELETE, PUT)
  • Timeout of the call in milliseconds
  • Request message to be sent to the REST service

Once the service has been consumed the function returns the corresponding response.

Code Snippet
  1. public string RESTConsume(string uri, string method, string timeout, string messageRequest)
  2. {
  3.     try
  4.     {
  5.         bool error = false;
  6.         string response = "";
  7.  
  8.         WebRequest webRequest = WebRequest.Create(uri);
  9.         ((HttpWebRequest)webRequest).UserAgent = @"Mozilla/5.0 (Windows; Windows NT 6.1) AppleWebKit/534.23 (KHTML, like Gecko) Chrome/11.0.686.3 Safari/534.23";
  10.         webRequest.ContentType = @"text/xml;charset=""utf-8""";
  11.         webRequest.Method = method;
  12.         if (timeout == "") webRequest.Timeout = 300000;
  13.         else webRequest.Timeout = Int32.Parse(timeout);
  14.         byte[] bytes = Encoding.ASCII.GetBytes(messageRequest);
  15.         Stream os = null;
  16.         StreamReader sr = null;
  17.  
  18.         if (method == "POST" || method == "PUT")
  19.         {
  20.             try
  21.             { // send the Post
  22.                 webRequest.ContentLength = bytes.Length;   //Count bytes to send
  23.                 os = webRequest.GetRequestStream();
  24.                 os.Write(bytes, 0, bytes.Length);         //Send it
  25.             }
  26.             catch (WebException ex)
  27.             {
  28.                 error = true;
  29.             }
  30.             finally
  31.             {
  32.                 if (os != null)
  33.                 {
  34.                     os.Close();
  35.                 }
  36.             }
  37.         }
  38.  
  39.         if (error == false && method != "PUT")
  40.             try
  41.             { // get the response
  42.                 WebResponse webResponse = webRequest.GetResponse();
  43.                 if (webResponse != null)
  44.                 {
  45.                     sr = new StreamReader(webResponse.GetResponseStream());
  46.                     response = sr.ReadToEnd().Trim();
  47.                 }
  48.                 webResponse.Close();
  49.             }
  50.             catch (WebException ex)
  51.             {
  52.                 error = true;
  53.             }
  54.             finally
  55.             {
  56.                 if (sr != null)
  57.                 {
  58.                     sr.Close();
  59.                 }
  60.             }
  61.  
  62.         return response;
  63.     }
  64.     catch (Exception ex)
  65.     {
  66.         return "";
  67.     }
  68. }

You are ready now to test the functoid. Just remember to define a strong name key for your project and add the compiled assembly to the GAC using gacutil.exe

Testing the functoid

In order to test your new functoid you need to perform this two actions:

1) Copy the functoid assembly to the C:\Program Files (x86)\Microsoft BizTalk Server 2010\Developer Tools\Mapper Extensions folder

image

2) Use gacutil.exe to register the functoid assembly in the GAC, otherwise you’ll receive an error like this when testing the map:

Could not load file or assembly ‘BizTalk.MapperExtensions.RESTFunctoids, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b4cf5e060283c1d7’ or one of its dependencies. The system cannot find the file specified.

Once the assembly is copied and registered in the GAC you can create a new map and add the functoid to the toolbox. Right click in the toolbox window and select Choose items…

image

In the Choose Toolbox Items window click on BizTalk Mapper functoids and select your functoid name

image

Now you should see your functoid displayed in the toolbox.

image

For this example I created another functoid to extract a xml part using XPath so I could access specific information in the response generated by the REST service.

The map I created to test my functoids performs the following actions:

image

1) Receives a purchase order xml file.

image

2) Copies the PONumber and InvoiceID values from the incoming to the outgoing message.

3) Concatenates the the InvoiceID value to the REST service URI (http://www.thomas-bayer.com/sqlrest/INVOICE/) and the invokes it using the Consume REST functoid.

image

image

4) From the REST service response extracts the CusstomerID and Total values using the XPath Extractor functoid.

image

image

Once the map is tested you can see the CustomerID and Total values have been correctly extracted from the REST service response and copied to the output message.

image

image

Conclusion

BizTalk 2010 functoid creation is now easier than ever thanks to the Custom Functoid Item Template for Visual Studio 2010 developed by Sandro and his team! Now you can focus on the functionality of the functoid above anything else.

I have created a Codeplex Project for the RESTFunctions project explained in this post, feel free to download it and try it in your own implementations and tell me what do you think about it.

July 5, 2012 at 11:14 am 2 comments

Improvements to the BizTalk Schedule Task Adapter

Last September I wrote about the BizTalk Schedule Task Adapter and how easy to use and powerful it is.

This adapter was initially developed by Greg Forsythe and now is being coordinated by BizTalk expert Sandro Pereira. Sandro has extensive experience developing adapters and he has applied all his knowledge to improve the Schedule Task Adapter.

More information about the new changes in the adapter can be found at Sandro’s Blog.

June 13, 2012 at 2:43 pm Leave a comment

DBFunktoids for BizTalk 2010

Last year I posted the BizTalk 2009 version of the DBFunktoids Mapper extensions. This weekend I updated the DBFunktoids solution to BizTalk 2010 and decided to create a project repository in Codeplex.

Originally developed by Eric Battalio, DBFunktoids is a collection of three BizTalk Server functoids that enable the invocation and manipulation of SQL Server stored procedures and their results.

There are three functoids included in this solution:

Stored Procedure Runner
The Stored Procedure Runner executes SQL Server stored procedures.

Value Extraktor
The Value Extraktor retrieves a value corresponding to a column name from the first row of records returned by the stored procedure.

Error Extraktor
The Error Extraktor returns either an error message if there was an error in executing the stored procedure or an empty string if there was not (or the results cannot be found).

You can download the DBFunktoids for BizTalk Server 2010 binaries here

March 6, 2012 at 9:08 am Leave a comment

GIMP an alternative to Adobe Photoshop

Yesterday I was updating a mapper extension from BizTalk 2006 to BizTalk 2010 but the functoids icons wouldn’t display correctly. After further analysis I found out the problem was with the color palette used by the images. Usually I would use Adobe Photoshop but I just bought a new notebook and hadn’t had the time to reinstall it.

Because the solution needed to be compiled ASAP I contacted a friend of mine with vast experience in Graphics Design and she recommended me to download GIMP. At first I was hesitant to use it because I have never heard of it but I decided to give it a try.

GIMP stands for GNU Image Manipulation Program. It was first released back in 1996 and its currently release is 2.6. It has been developed and matured to be recognized as a real alternative for Photoshop and the best of all: It is free!

image

GIMP supports a lot of file formats, a very complete toolbox and a wide range of effects and filters.

You can download GIMP here.

February 27, 2012 at 2:42 pm Leave a comment

Entreprise Single Sign-On Configuration Error

Configuring ESSO in BizTalk 2009 is a no brainer, but have you ever run into this error?

image

image

At first glance you would suspect something is wrong with the database communication or with the account configured to access it. But as it turns out the communication and credentials used to access the database are just fine.

The installation of BizTalk was successful and there are no error events recorded neither in the Application or System Windows logs.

There is no more information and no matter what you do the configuration process keeps stopping at this error. So what cold it be? Well if the communication and credentials are Ok so the problem should be with something the configuration wizard is using to connect to Microsoft SQL Server. To further support this theory this problem looks pretty much like the one you have when the .Net Framework 4.0 is installed in a BizTalk Server.

Upon further inspection the theory is confirmed, the .Net Framework 4 was previously installed in the server:

image

How can you overcome this? Simply follow the instructions in my previous post to correct the problem with SSOSQL.dll and the ESSO configuration should proceed with no further errors.

image

February 9, 2012 at 4:18 pm Leave a comment

BizTalk 2010 BAM Tools Installation Woes

Next week I’ll be training a new BizTalk administrator for a client so today I spent most of the morning setting up a single VM with BizTalk 2010 in order to better explain the themes and concepts I plan to cover in the training.

If you haven’t  worked with BizTalk 2010 before you can get the Installation guide at Microsoft Download Center. The general procedure is quite simple and straight forward. Once you have installed the product you proceed to configure it using the Microsoft BizTalk Server Configuration Wizard.

image

Because this client has a Business Activity Monitoring (BAM) infrastructure I needed to also configure BAM in the VM. BAM also is a no brainer to configure and I myself have successfully done it before so I was quite surprised when the configuration failed with the following logged error message:

image

ERROR: Failed to set up BAM database(s).
There was a failure while executing nscontrol.exe. Error:"Microsoft Notification Services Control Utility 9.0.242.0
c Microsoft Corp. All rights reserved.

An error was encountered when running this command.
Could not load file or assembly ‘Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.

" (Microsoft.BizTalk.Bam.CfgExtHelper.Utility)

The Microsoft.SqlServer.Smo comes with the Microsoft SQL Server 2005 Management Objects Collection and as a prerequisite software I had installed it before installing BizTalk, It should be present in the in the VM! I looked for the DLL in the GAC but only found the version 10 installed. This was the version corresponding to the Microsoft SQL Server 2008 R2 installed in the VM. This shouldn’t be a problem because the SQL 2005 and 2008 versions of the assembly can coexist without a problem.

image

If the Microsoft.SqlServer.Smo.dll assembly wasn’t installed in the GAC I expected at least to find it in the “C:\Program Files (x86)\Microsoft SQL Server\90\SDK\Assemblies” path but to my surprise this directory didn’t even exist anymore!

image

Some program had completely uninstalled the Microsoft SQL Server 2005 Management Objects Collection and if I tried to reinstall it I couldn’t because a newer version was detected. I suspected this was because the Microsoft SQL Server 2008 R2 Management Objects were installed, but even if I uninstalled them the conflicting version error kept showing up.

image

By this point I was pretty sure of two things:

1) Some program I installed before BizTalk had removed the Microsoft SQL Server 2005 Management Objects.

2) This same program wasn’t allowing me to reinstall the Microsoft SQL Server 2005 Management Objects because a conflict of versions.

I started to review my installation log and the only viable suspect was SharePoint Foundation 2010. Because I was installing everything in a single VM this was the first time I was using a configuration like that. I was sure the problem wasn’t SharePoint Foundation 2010 per se but some of the programs installed by it as prerequisites.

I found a very complete list of these prerequisites at Manish Patil’s Blog. Almost all of these programs seem quite innocuous but for one, SQL 2008 R2 Reporting Services SharePoint 2010 Add-in. I searched online for some clue about any incompatibility between the Reporting Services Add-in and the SQL 2005 Management Objects but nothing come out.

image

Nevertheless something kept telling me this program was the main cause of the problem so after I made sure there was an offline installer of the plug-in, in case my hunch proved to be wrong, I uninstalled it and tried to reinstall the SQL 2005 Management Objects.

I was right and this time the SQL 2005 Management Objects installation was uneventful and finally I was able to correctly configure BAM in the VM.

image

I am still trying to figure it out what could be the reason why the SQL Server 2008 R2 Reporting Services Add-in uninstalls and blocks the SQL 2005 Management Objects. I have shared my finding with some colleagues at Microsoft. As soon as I have an answer from them I’ll let you know.

In the mean time, if you are installing a VM or development server and need to have SharePoint Foundation 2010 and BAM side by side uninstall the SQL Server 2008 R2 Reporting Services Add-in to avoid further headaches.

February 7, 2012 at 8:59 am 4 comments

Older Posts


May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories