Thursday, March 31, 2011

BizTalk Server 2010 Exam : How to prepare?

In previous post I yesterday I wrote that new BizTalk 2010 exam is out. And you may figure how to prepare as in preparation material nothing is mentioned.Let’s look at what skills are measured. In a nutshell these topics are:

  • Configuring messaging architecture (setup, manage ports, configure adapters, implement messaging solutions);
  • Developing BizTalk Artefacts (building orchestrations, create schema’s, maps and pipelines);
  • Debugging and Exception Handling (debug orchestrations, validate and test artefacts like schema’s, maps, pipelines);
  • Integrating Web Services and Windows Communication Foundation (WCF) Services (WCF Adapters);
  • Implementing Extended Capabilities (this is the BAM, BRE, RFID and EDI part);
  • Deploying, Tracking, and Supporting a BizTalk Solution (Installation in different kinds of scenario’s, deployment of applications, bindings).

You can find a lot of resources that can help in preparation through BizTalk Development Center like the BizTalk tutorials for EAI and EDI. These tutorials can beneficial for preparing on topics Messaging architecture and extended capabilities. There are more video’s and webcasts found here. Another great set of materials to use of preparation are BizTalk Server 2010 Training Kit you can download.To be able to use these materials you will need a BizTalk environment, developer edition can be downloaded for free using documentation to be able to set up an environment. You might have to get OS, database and so on (dependencies for BizTalk) either through MSDN or by downloading evaluation editions. If you need training you could go to local training center to follow a course or go for online training through quicklearn (with possible of sample/demo training for BizTalk Server 2010). For BizTalk 2010 RFID there are also tutorials available. Finally you could browse internet and find recent posts on BizTalk Server 2010, WCF, EDI, etcetera. You will need some time depending on your skill and experience to prepare for this exam. If you do I wish you success and perhaps these links can be useful in your preparation.

Cheers!

Technorati:

Wednesday, March 30, 2011

BizTalk 2010 Exam is available

Short blog post this time. As of now the BizTalk 2010 exam is now available. You can find details on the webpage for this exam 70-595 TS: Developing Business Process and Integration Solutions by Using Microsoft BizTalk Server 2010. One of interesting skills measured are Implementing Extended Capabilities. This deals with RFID, EDI, BAM and BRE. I quoted from the overview:

“Candidates should have a solid understanding of fundamental BizTalk concepts around the core messaging engine and building business processes using orchestrations. Candidates will have some exposure to larger-scale multi-server solutions and deployment/management familiarity. This core knowledge is required for BizTalk 2006 R2, 2009, and 2010.  In addition, core knowledge of Windows Communication Foundation (WCF) and Electronic Data Interchange  (EDI) is also required.

Candidates should also have at least two years’ experience developing, deploying, testing, troubleshooting, and debugging BizTalk Server 2006 and later solutions across multiple projects and have experience using the Microsoft .NET Framework, XML, Microsoft Visual Studio, Microsoft SQL Server, Web services, and WCF while developing BizTalk integration solutions”

Notice also EDI being mentioned here, so extra attention to this is necessary so studying the Trading Partner Manager (one of the new BizTalk 2010 features) for one is mandatory I think.

Technorati:

Thursday, March 24, 2011

BizTalk AppFabric Connect: WCF-Adapter Service Stored Procedure

In a post yesterday I should a way to invoke a stored procedure in SQL Azure using WCF-SQL Adapter. There is another to invoke a stored procedure using AppFabric Connect for Services functionality in BizTalk Server 2010. This new feature feature brings together the capabilities of BizTalk Server and Windows Azure AppFabric thereby enabling enterprises to extend the reach of their on-premise Line of Business (LOB) systems and BizTalk applications to cloud. To be able to bridge the capabilities of BizTalk Server and Windows Azure AppFabric you will need Biztalk Server 2010 Feature Pack.

In this post I will show how to leverage BizTalk WCF-SQL Adapter to extend reach of stored procedure to the cloud. First I will create a service that will expose the stored-procedure. I create a VS Studio project and select WCF Adapter Service. Steps that follow are also described in an article called Exposing LOB Services on the Cloud Using AppFabric Connect for Services. I skip first page concerning and go to choose the operations to generate a service contract page.

image

I choose local database, stored procedure ADD_EMP_DETAILS (same as in previous posts) and click Next. In AppFabric Connect page, select the Extend the reach of the service on the cloud checkbox. In the Service Namespace text box, enter the service namespace that you must have already registered with the Service Bus.

image

image

Next step is configure the service behavior. You will have to configure the service behavior (for both on-premises and cloud-based services) and the endpoint behavior (for only endpoints on the Service Bus).

image

I enabled the EnableMetadatExchange to True, so the service metadata is available using standardized protocols, such as WS-Metadata Exchange (MEX). I not using security features as in certificates so the UseServiceCertificate is set to False. I enabled EndpointDiscovery, which makes the endpoints publicly discoverable. Next page is around configuring endpoints.

image

I accepted the the defaults for the on-premises endpoint and focus on configuring the Service Bus endpoints. I select netTcpRelayBinding for which the URL scheme is sb and set EnableMexEndPoint to True. Rest I accepted default values. After configuration you will have to click Apply. Then click and final screen will appear.

image

Finish and the wizard creates both on-premise and Service Bus endpoints for the WCF service.

 image

Next steps involve publishing the service. In the Visual Studio project for the service, right-click the project in Solution Explorer and click Properties. On the Properties page, in the Web tab, under Servers category, select the Use Local IIS Web Server option.The Project URL text box is automatically populated and then click Create Virtual Directory.In Solution Explorer, right-click the project again and then click Build. When service is build you will have to configure it in IIS for auto-start. By right clicking the service, Manage WCF and WF Service and then configure you might run into this error (which you can ignore a this element is not present in intellisense).

image

In Auto-Start you can set it to enable. Next step is to verify if the Service Bus endpoints for the WCF service are published. You will have to view all the available endpoints in the Service Bus ATOM feed page for the specified service namespace:

https://<namespace>.servicebus.windows.net

image

I typed this URL in a Web browser and saw a list of the all the endpoints available under the specified service bus namespace. To be able to consume the WCF service to able to invoke the procedure you will need to build a client. I create a Windows Application to consume WCF Service, so inside my project I created a new project a Windows Forms Application and added a service reference using the URL for the relay metadata exchange endpoint.

image

In ServiceBus Endpoint the RelayClientAuthentication was set to RelayAccessToken, which means that the client will need to pass the authentication token to authenticate itself to the Service Bus. Therefore you will have to add following section in app.config.

<behaviors>
  <endpointBehaviors>
    <behavior name="secureService">
      <transportClientEndpointBehavior credentialType="SharedSecret">
        <clientCredentials>
          <sharedSecret issuerName="<name>" issuerSecret="<value>" />
        </clientCredentials>
      </transportClientEndpointBehavior>
    </behavior>
  </endpointBehaviors>
</behaviors>

You must get the values for issuerName and issuerSecret from the organization (e.g. your Azure account) that hosts the service. The endpoint configuration in app.config has to be changed to this:

<endpoint address="sb://contoso.servicebus.windows.net/Procedures_dbo/"
               binding="netTcpRelayBinding" bindingConfiguration="Procedures_dboRelayEndpoint"
               contract="ServiceReferenceSP.Procedures_dbo" name="Procedures_dboRelayEndpoint" behaviorConfiguration="secureService"/>

Code for making this work (implementation of invoke button).

image

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ExposeSPCloudTestClient.ServiceReferenceSP;

namespace ExposeSPCloudTestClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnInvoke_Click(object sender, EventArgs e)
        {
            int returnValue = -1;

            Procedures_dboClient client = new Procedures_dboClient("Procedures_dboRelayEndpoint");
            client.ClientCredentials.UserName.UserName = "sa";
            client.ClientCredentials.UserName.Password = "B@rRy#06";

            try
            {
                Console.WriteLine("Opening client...");
                Console.WriteLine();
                client.Open();
                client.ADD_EMP_DETAILS("Steef-Jan Wiggers", "Architect", 20000, out returnValue);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception: " + ex.Message);
            }
            finally
            {
                client.Close();
            }
 
            txtResult.Text = returnValue.ToString();
    

        }
    }
}

Query employee table before execution of code above results as depicted below:

image

After invoking stored-procedure through consuming the service the new record is added.

image

As you can see I am added to employees table through adapter service called by the client.As you can see there is another way of invoking a stored-procedure making use of BizTalk AppFabric Connect Feature.

Wednesday, March 23, 2011

WCF-SQL Adapter Stored Procedure : SQL Azure

In previous post I explained how call stored procedure using WCF-SQL Adapter from BizTalk. I now want to do same thing, but instead of calling a stored-procedure in SQL Server I will call a stored procedure in SQL-Azure. If you want to do you will need a Windows Azure Account. If you do than you can sign in through Azure Management Portal and if you do not have SQL Azure database you can go database in portal and click Create a new SQL Database.

image

You will then go through set of steps (e.g. wizard), where you will have to select subscription and server, region (my case North Europe), credentials, firewall rules (I did not apply any), database name, edition (web), and size (1 Gb).

image

So I now have a database in the cloud and I can access it through SQL management studio 2008 R2 on my machine. That’s what I thought, but I got the message below stating I need a firewall rule.

image

This meant I had to go back to the portal and create a firewall rule for IP address of my laptop. I dropped the database and started over again. And tried again and yes I could access the database instantly.

image

Now I needed to create a database with same tables and stored procedure as on-premise version. In SQL Azure you can create a new database by right clicking database and click new database. A script will appear that looks like below that needs to be executed.

CREATE DATABASE ADAPTER_SAMPLES;

image

This may take a few seconds, but then you have a database. Next step was to execute the script for creating table (just Employee) and stored procedure. I right clicked tables and then new table a new query screen appears where I execute following statements:

CREATE TABLE [dbo].[Employee](
[Employee_ID] [int] IDENTITY(10001,1) NOT NULL,
[Name] [varchar](50) NOT NULL,
[DOJ] [datetime] NULL,
[Designation] [varchar](50) NOT NULL,
[Job_Description] [varchar](max) NULL,
[Photo] [image] NULL,
[Salary] [decimal](18, 2) NOT NULL,
[Last_Modified] [timestamp] NULL,
[Status] [int] NULL CONSTRAINT [DF_Employee_Status] DEFAULT ((0)),
[Address] [xml] NULL,
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
(
[Employee_ID] ASC
))
GO

Now of course I needed to have some data in there.

INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Jeff Price','Manager',500000)
INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Don Hall','Accountant',40000)
INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Keith Harris','Supervisor',300000)
INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Jim Hance','Admin',200000)
INSERT INTO [Employee]([Name],[Designation],[Salary])VALUES('Andy Jacobs','Accountant',400000)

And the stored procedure by navigate to stored-procedure and right click new new stored procedure. I deleted the preformatted stuff en pasted the code below:

CREATE PROCEDURE [dbo].[ADD_EMP_DETAILS]
-- Add the parameters for the stored procedure here
@emp_name varchar(50),
@emp_desig varchar(50),
@salary decimal(18,2)

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
INSERT INTO [ADAPTER_SAMPLES].[dbo].[Employee]
([Name]
,[Designation]
,[Salary])
VALUES
(@emp_name
,@emp_desig
,@salary)
SELECT [Employee_ID] FROM Employee where [Employee_ID] = (select IDENT_CURRENT('Employee'))

END

GO

I am fairly new to SQL Azure so some of steps or things can be done differently. You can find many information online, like this MSDN article Getting Started with SQL Azure Development. Now that I have got things set up I now go through same steps to invoke the stored-procedure in SQL Azure using WCF-SQL Adapter.First I fire up VS2010 and create a new BizTalk project and then through add generated items I choose Consume Adapter Service.

image

I configured the URI accordingly,click Configure in security tab name of database administrator and then password, URI Properties the InitialCatalog Name and Server and you will get URI like:

mssql://kwtn4rghlk.database.windows.net//ADAPTER_SAMPLES?

Connect and category will appear. You will then select Procedure and add procedure and click OK.

image

Once that is done then binding and schema’s are generated.

image

After deploying I imported the binding file accompanied with this sample called WcfSendPort_SqlAdapterBinding_Custom.bindinginfo.xml. Send port will be created and only thing I had to do is adding filter to this send ports. If you go to generated send port and click configure for custom-adapter you will see in general tab and others the details.

image

One important things to be noted here is that in binding the useAmbientTransaction has to be set to false! If not you will error message below:

image

You will need to fill in credentials in credential tab! Next step is to add a filter for message type.

image

When this is done I created a receive location for incoming message that will look like this:

<ns0:ADD_EMP_DETAILS xmlns:ns0="http://schemas.microsoft.com/Sql/2008/05/Procedures/dbo">
<ns0:emp_name></ns0:emp_name>
<ns0:emp_desig></ns0:emp_desig>
<ns0:salary></ns0:salary>
</ns0:ADD_EMP_DETAILS>

And a send port that will send response message to a folder. Message that will placed in receive folder is:

image

As a result to follow message is returned:

image

When I run the follow T-SQL command in SQL Azure I get the following result:

image

So as you can see I am in there now.I have showed you a way to invoke a stored procedure in SQL Azure using BizTalk Server with a messaging solution. Cool stuff.

Technorati:

Thursday, March 03, 2011

Interview by Richard Seroter: MVP Summit

During MVP summit I was interviewed by my fellow MVP Richard Seroter. MVP summit was great and it was nice to be elected/nominated for diner with Soma. Thanks Richard for including me in the monthly interviews and the entertaining "Soma" diner together with Stephen. I enjoyed the conversations and laughs.